Skip to content

Commit

Permalink
Merge pull request #1174 from derrabus/improvement/skip-orm-on-php8
Browse files Browse the repository at this point in the history
Skip ORM tests on php 8
  • Loading branch information
alcaeus committed May 26, 2020
2 parents 3ca4709 + 4c906c9 commit ffea292
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Tests/CacheSchemaSubscriberTest.php
Expand Up @@ -4,6 +4,7 @@

use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\CacheSchemaSubscriberPass;
use Doctrine\Bundle\DoctrineBundle\DependencyInjection\DoctrineExtension;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bridge\Doctrine\SchemaListener\PdoCacheAdapterDoctrineSchemaSubscriber;
use Symfony\Bundle\FrameworkBundle\DependencyInjection\FrameworkExtension;
use Symfony\Component\DependencyInjection\Alias;
Expand All @@ -19,6 +20,9 @@ public function testSchemaSubscriberWiring() : void
if (! class_exists(PdoCacheAdapterDoctrineSchemaSubscriber::class)) {
$this->markTestSkipped('This test requires Symfony 5.1 or higher');
}
if (! interface_exists(EntityManagerInterface::class)) {
self::markTestSkipped('This test requires ORM');
}

$container = new ContainerBuilder(new ParameterBag([
'kernel.name' => 'app',
Expand Down
4 changes: 4 additions & 0 deletions Tests/DataCollector/DoctrineDataCollectorTest.php
Expand Up @@ -56,6 +56,10 @@ public function testCollectEntities() : void

public function testDoesNotCollectEntities() : void
{
if (! interface_exists(EntityManagerInterface::class)) {
self::markTestSkipped('This test requires ORM');
}

$manager = $this->createMock('Doctrine\ORM\EntityManager');
$config = $this->createMock('Doctrine\ORM\Configuration');
$collector = $this->createCollector(['default' => $manager], false);
Expand Down

0 comments on commit ffea292

Please sign in to comment.