-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add testcase
- Loading branch information
Showing
4 changed files
with
38 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,14 +31,19 @@ jobs: | |
image: redis | ||
ports: | ||
- 6379:6379 | ||
|
||
memcached: | ||
image: memcached:alpine3.20 | ||
ports: | ||
- "11211:11211" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
tools: composer:v2 | ||
extensions: pinpoint_php-https://github.com/pinpoint-apm/pinpoint-c-agent@dev, mongodb-mongodb/[email protected] | ||
extensions: pinpoint_php-https://github.com/pinpoint-apm/pinpoint-c-agent@dev, mongodb-mongodb/[email protected], php-memcached-dev/[email protected] | ||
- run: | | ||
composer install --prefer-dist | ||
vendor/bin/phpunit --configuration PHPUnit_aop_libraries.xml --testsuit pinpoint --testdox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace Pinpoint\Plugins\SysV2\_memcached; | ||
|
||
use Pinpoint\test\TraceTest; | ||
|
||
use Memcached; | ||
|
||
// vendor/bin/phpunit --configuration PHPUnit_aop_libraries.xml --testsuit pinpoint --testdox --filter Mem_Test | ||
class Mem_Test extends TraceTest | ||
{ | ||
|
||
public function test_mem_flow() | ||
{ | ||
$mc = new Memcached(); | ||
$mc->addServer("memcached", 11211); | ||
$mc->set('key', "abc"); | ||
$this->assertTrue($mc->get('key') == 'abc'); // boolean false | ||
var_dump($mc->getResultCode()); // int 0 which is Memcached::RES_SUCCESS | ||
var_dump($mc->add("test_add", 234)); // int 0 which is Memcached::RES_SUCCESS | ||
// var_dump($Memcached->appendByKey("xxx", "test_add", 234)); // int 0 which is Memcached::RES_SUCCESS | ||
var_dump($mc->delete("test_add")); // int 0 which is Memcached::RES_SUCCESS | ||
var_dump($mc->deleteMulti(["test_add", "a", "b", "c"])); // int 0 which is Memcached::RES_SUCCESS | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters