diff --git a/DataCollector/DoctrineDataCollector.php b/DataCollector/DoctrineDataCollector.php index 35fe766e..c7c241e4 100644 --- a/DataCollector/DoctrineDataCollector.php +++ b/DataCollector/DoctrineDataCollector.php @@ -77,6 +77,10 @@ public function collect(Request $request, Response $response, \Exception $except } } + if (version_compare(\Doctrine\ORM\Version::VERSION, '2.5.0-DEV') < 0) { + continue; + } + /** @var $emConfig \Doctrine\ORM\Configuration */ $emConfig = $em->getConfiguration(); $slcEnabled = $emConfig->isSecondLevelCacheEnabled(); diff --git a/Tests/DependencyInjection/AbstractDoctrineExtensionTest.php b/Tests/DependencyInjection/AbstractDoctrineExtensionTest.php index 3dd1e3e8..a35bddf7 100644 --- a/Tests/DependencyInjection/AbstractDoctrineExtensionTest.php +++ b/Tests/DependencyInjection/AbstractDoctrineExtensionTest.php @@ -492,6 +492,10 @@ public function testSetNamingStrategy() public function testSecondLevelCache() { + if (version_compare(\Doctrine\ORM\Version::VERSION, '2.5.0-DEV') < 0) { + $this->markTestSkipped('Second-level cache requires doctrine-orm 2.5.0 or newer'); + } + $container = $this->getContainer(); $loader = new DoctrineExtension();