Skip to content

Commit

Permalink
Merge pull request #966 from bendavies/fix-schema-filters
Browse files Browse the repository at this point in the history
Fix schema filters
  • Loading branch information
alcaeus committed May 13, 2019
2 parents cc3e327 + 4806ff1 commit 51f8a11
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions DoctrineBundle.php
Expand Up @@ -2,6 +2,7 @@

namespace Doctrine\Bundle\DoctrineBundle;

use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DbalSchemaFilterPass;
use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\EntityListenerPass;
use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\ServiceRepositoryCompilerPass;
use Doctrine\Common\Util\ClassUtils;
Expand Down Expand Up @@ -36,6 +37,7 @@ public function build(ContainerBuilder $container)
$container->addCompilerPass(new DoctrineValidationPass('orm'));
$container->addCompilerPass(new EntityListenerPass());
$container->addCompilerPass(new ServiceRepositoryCompilerPass());
$container->addCompilerPass(new DbalSchemaFilterPass());
}

/**
Expand Down
5 changes: 5 additions & 0 deletions Tests/BundleTest.php
Expand Up @@ -2,6 +2,7 @@

namespace Doctrine\Bundle\DoctrineBundle\Tests;

use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DbalSchemaFilterPass;
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass\DoctrineValidationPass;
Expand All @@ -21,16 +22,20 @@ public function testBuildCompilerPasses()

$foundEventListener = false;
$foundValidation = false;
$foundSchemaFilter = false;

foreach ($passes as $pass) {
if ($pass instanceof RegisterEventListenersAndSubscribersPass) {
$foundEventListener = true;
} elseif ($pass instanceof DoctrineValidationPass) {
$foundValidation = true;
} elseif ($pass instanceof DbalSchemaFilterPass) {
$foundSchemaFilter = true;
}
}

$this->assertTrue($foundEventListener, 'RegisterEventListenersAndSubscribersPass was not found');
$this->assertTrue($foundValidation, 'DoctrineValidationPass was not found');
$this->assertTrue($foundSchemaFilter, 'DbalSchemaFilterPass was not found');
}
}

0 comments on commit 51f8a11

Please sign in to comment.