Always require symfony/polyfill-apcu to provide APCuIterator everywhere

This commit is contained in:
Guillaume LECERF 2017-08-28 23:40:21 +02:00
parent 2230e31727
commit 9d444421ea
3 changed files with 28 additions and 5 deletions

View File

@ -26,6 +26,7 @@
"psr/link": "^1.0",
"psr/log": "~1.0",
"psr/simple-cache": "^1.0",
"symfony/polyfill-apcu": "~1.1",
"symfony/polyfill-intl-icu": "~1.0",
"symfony/polyfill-mbstring": "~1.0",
"symfony/polyfill-php56": "~1.0",
@ -96,7 +97,6 @@
"predis/predis": "~1.0",
"egulias/email-validator": "~1.2,>=1.2.8|~2.0",
"symfony/phpunit-bridge": "~3.2",
"symfony/polyfill-apcu": "~1.1",
"symfony/security-acl": "~2.8|~3.0",
"phpdocumentor/reflection-docblock": "^3.0|^4.0",
"sensio/framework-extra-bundle": "^3.0.2"

View File

@ -77,6 +77,31 @@ class ApcuAdapterTest extends AdapterTestCase
$this->assertNull($item->get());
}
public function testNamespace()
{
$namespace = str_replace('\\', '.', get_class($this));
$pool1 = new ApcuAdapter($namespace.'_1', 0, 'p1');
$item = $pool1->getItem('foo');
$this->assertFalse($item->isHit());
$this->assertTrue($pool1->save($item->set('bar')));
$item = $pool1->getItem('foo');
$this->assertTrue($item->isHit());
$this->assertSame('bar', $item->get());
$pool2 = new ApcuAdapter($namespace.'_2', 0, 'p1');
$item = $pool2->getItem('foo');
$this->assertFalse($item->isHit());
$this->assertNull($item->get());
$item = $pool1->getItem('foo');
$this->assertTrue($item->isHit());
$this->assertSame('bar', $item->get());
}
public function testWithCliSapi()
{
try {

View File

@ -23,7 +23,8 @@
"php": "^5.5.9|>=7.0.8",
"psr/cache": "~1.0",
"psr/log": "~1.0",
"psr/simple-cache": "^1.0"
"psr/simple-cache": "^1.0",
"symfony/polyfill-apcu": "~1.1"
},
"require-dev": {
"cache/integration-tests": "dev-master",
@ -34,9 +35,6 @@
"conflict": {
"symfony/var-dumper": "<3.3"
},
"suggest": {
"symfony/polyfill-apcu": "For using ApcuAdapter on HHVM"
},
"autoload": {
"psr-4": { "Symfony\\Component\\Cache\\": "" },
"exclude-from-classmap": [