diff options
| author | Greg Roach <fisharebest@webtrees.net> | 2019-10-10 00:28:20 +0100 |
|---|---|---|
| committer | Greg Roach <fisharebest@webtrees.net> | 2019-10-10 00:28:20 +0100 |
| commit | 1413eee0f149cccf7c528e3673d7569a368e4a9b (patch) | |
| tree | 0f7c151dcd9d1bbc1694e9d0aade1cdae5cc54e2 /vendor/symfony/cache/Tests | |
| parent | 3ecf8b4e3b9edb7773bcf328f4533da4f452929a (diff) | |
| download | webtrees-1413eee0f149cccf7c528e3673d7569a368e4a9b.tar.gz webtrees-1413eee0f149cccf7c528e3673d7569a368e4a9b.tar.bz2 webtrees-1413eee0f149cccf7c528e3673d7569a368e4a9b.zip | |
Update vendor dependencies
Diffstat (limited to 'vendor/symfony/cache/Tests')
4 files changed, 75 insertions, 12 deletions
diff --git a/vendor/symfony/cache/Tests/Adapter/AdapterTestCase.php b/vendor/symfony/cache/Tests/Adapter/AdapterTestCase.php index de2562d637..63a7f39e53 100644 --- a/vendor/symfony/cache/Tests/Adapter/AdapterTestCase.php +++ b/vendor/symfony/cache/Tests/Adapter/AdapterTestCase.php @@ -109,7 +109,7 @@ abstract class AdapterTestCase extends CachePoolTest $cache->deleteItem('foo'); $cache->get('foo', function ($item) { $item->expiresAfter(10); - sleep(1); + usleep(999000); return 'bar'; }); @@ -252,16 +252,6 @@ abstract class AdapterTestCase extends CachePoolTest $this->assertFalse($this->isPruned($cache, 'foo')); $this->assertTrue($this->isPruned($cache, 'qux')); } - - /** - * @group issue-32995 - * - * @runInSeparateProcess https://github.com/symfony/symfony/issues/32995 - */ - public function testSavingObject() - { - parent::testSavingObject(); - } } class NotUnserializable diff --git a/vendor/symfony/cache/Tests/Adapter/TagAwareAdapterTest.php b/vendor/symfony/cache/Tests/Adapter/TagAwareAdapterTest.php index 490e50339a..ef939bae8c 100644 --- a/vendor/symfony/cache/Tests/Adapter/TagAwareAdapterTest.php +++ b/vendor/symfony/cache/Tests/Adapter/TagAwareAdapterTest.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Cache\Tests\Adapter; use PHPUnit\Framework\MockObject\MockObject; +use Psr\Cache\CacheItemInterface; use Symfony\Component\Cache\Adapter\AdapterInterface; use Symfony\Component\Cache\Adapter\FilesystemAdapter; use Symfony\Component\Cache\Adapter\TagAwareAdapter; @@ -65,6 +66,39 @@ class TagAwareAdapterTest extends AdapterTestCase $this->assertFalse($cache->prune()); } + public function testKnownTagVersionsTtl() + { + $itemsPool = new FilesystemAdapter('', 10); + $tagsPool = $this + ->getMockBuilder(AdapterInterface::class) + ->getMock(); + + $pool = new TagAwareAdapter($itemsPool, $tagsPool, 10); + + $item = $pool->getItem('foo'); + $item->tag(['baz']); + $item->expiresAfter(100); + + $tag = $this->getMockBuilder(CacheItemInterface::class)->getMock(); + $tag->expects(self::exactly(2))->method('get')->willReturn(10); + + $tagsPool->expects(self::exactly(2))->method('getItems')->willReturn([ + 'baz'.TagAwareAdapter::TAGS_PREFIX => $tag, + ]); + + $pool->save($item); + $this->assertTrue($pool->getItem('foo')->isHit()); + $this->assertTrue($pool->getItem('foo')->isHit()); + + sleep(20); + + $this->assertTrue($pool->getItem('foo')->isHit()); + + sleep(5); + + $this->assertTrue($pool->getItem('foo')->isHit()); + } + /** * @return MockObject|PruneableCacheInterface */ diff --git a/vendor/symfony/cache/Tests/DependencyInjection/CachePoolPassTest.php b/vendor/symfony/cache/Tests/DependencyInjection/CachePoolPassTest.php index 85b7e64b1c..e763dabe48 100644 --- a/vendor/symfony/cache/Tests/DependencyInjection/CachePoolPassTest.php +++ b/vendor/symfony/cache/Tests/DependencyInjection/CachePoolPassTest.php @@ -70,6 +70,33 @@ class CachePoolPassTest extends TestCase $this->assertSame('xmOJ8gqF-Y', $cachePool->getArgument(0)); } + public function testNamespaceArgumentIsSeededWithAdapterClassNameWithoutAffectingOtherCachePools() + { + $container = new ContainerBuilder(); + $container->setParameter('kernel.container_class', 'app'); + $container->setParameter('kernel.project_dir', 'foo'); + $adapter = new Definition(); + $adapter->setAbstract(true); + $adapter->addTag('cache.pool'); + $adapter->setClass(RedisAdapter::class); + $container->setDefinition('app.cache_adapter', $adapter); + $container->setAlias('app.cache_adapter_alias', 'app.cache_adapter'); + + $otherCachePool = new ChildDefinition('app.cache_adapter_alias'); + $otherCachePool->addArgument(null); + $otherCachePool->addTag('cache.pool'); + $container->setDefinition('app.other_cache_pool', $otherCachePool); + + $cachePool = new ChildDefinition('app.cache_adapter_alias'); + $cachePool->addArgument(null); + $cachePool->addTag('cache.pool'); + $container->setDefinition('app.cache_pool', $cachePool); + + $this->cachePoolPass->process($container); + + $this->assertSame('xmOJ8gqF-Y', $cachePool->getArgument(0)); + } + public function testNamespaceArgumentIsNotReplacedIfArrayAdapterIsUsed() { $container = new ContainerBuilder(); diff --git a/vendor/symfony/cache/Tests/Marshaller/DefaultMarshallerTest.php b/vendor/symfony/cache/Tests/Marshaller/DefaultMarshallerTest.php index aa0e0221d4..141291d6e4 100644 --- a/vendor/symfony/cache/Tests/Marshaller/DefaultMarshallerTest.php +++ b/vendor/symfony/cache/Tests/Marshaller/DefaultMarshallerTest.php @@ -24,7 +24,7 @@ class DefaultMarshallerTest extends TestCase 'b' => function () {}, ]; - $expected = ['a' => \extension_loaded('igbinary') ? igbinary_serialize(123) : serialize(123)]; + $expected = ['a' => \extension_loaded('igbinary') && \PHP_VERSION_ID !== 70400 ? igbinary_serialize(123) : serialize(123)]; $this->assertSame($expected, $marshaller->marshall($values, $failed)); $this->assertSame(['b'], $failed); } @@ -43,6 +43,10 @@ class DefaultMarshallerTest extends TestCase */ public function testIgbinaryUnserialize() { + if (\PHP_VERSION_ID === 70400) { + $this->markTestSkipped('igbinary is not compatible with PHP 7.4.0.'); + } + $marshaller = new DefaultMarshaller(); $this->assertNull($marshaller->unmarshall(igbinary_serialize(null))); $this->assertFalse($marshaller->unmarshall(igbinary_serialize(false))); @@ -63,6 +67,10 @@ class DefaultMarshallerTest extends TestCase */ public function testIgbinaryUnserializeNotFoundClass() { + if (\PHP_VERSION_ID === 70400) { + $this->markTestSkipped('igbinary is not compatible with PHP 7.4.0.'); + } + $this->expectException('DomainException'); $this->expectExceptionMessage('Class not found: NotExistingClass'); $marshaller = new DefaultMarshaller(); @@ -87,6 +95,10 @@ class DefaultMarshallerTest extends TestCase */ public function testIgbinaryUnserializeInvalid() { + if (\PHP_VERSION_ID === 70400) { + $this->markTestSkipped('igbinary is not compatible with PHP 7.4.0'); + } + $this->expectException('DomainException'); $this->expectExceptionMessage('igbinary_unserialize_zval: unknown type \'61\', position 5'); $marshaller = new DefaultMarshaller(); |
