diff --git a/Tests/DependencyInjection/AbstractIvorySerializerExtensionTest.php b/Tests/DependencyInjection/AbstractIvorySerializerExtensionTest.php index 8fea944..1d6db82 100644 --- a/Tests/DependencyInjection/AbstractIvorySerializerExtensionTest.php +++ b/Tests/DependencyInjection/AbstractIvorySerializerExtensionTest.php @@ -229,7 +229,11 @@ public function testMappingCache() (string) $classMetadataFactoryDefinition->getArgument(0) ); - $this->assertSame('cache.system', (string) $classMetadataFactoryDefinition->getArgument(1)); + $this->assertSame( + class_exists(CachePoolPass::class) ? 'cache.system' : 'ivory.serializer.cache', + (string) $classMetadataFactoryDefinition->getArgument(1) + ); + $this->assertSame('ivory_serializer', $classMetadataFactoryDefinition->getArgument(2)); $this->assertInstanceOf( @@ -240,7 +244,7 @@ public function testMappingCache() public function testCustomMappingCache() { - $this->container->set('cache.custom', $this->createCacheItemPoolMock()); + $this->container->setDefinition('cache.custom', new Definition($this->createCacheItemPoolMockClass())); $this->loadConfiguration($this->container, 'mapping_cache'); $this->container->compile(); @@ -545,6 +549,14 @@ private function loadService($service) $loader->load($service.'.xml'); } + /** + * @return string + */ + private function createCacheItemPoolMockClass() + { + return $this->getMockClass(CacheItemPoolInterface::class); + } + /** * @return \PHPUnit_Framework_MockObject_MockObject|CacheItemPoolInterface */