Initial commit with Symfony 2.1+Vendors
Signed-off-by: Gergely POLONKAI (W00d5t0ck) <polesz@w00d5t0ck.info>
This commit is contained in:
47
vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/BundleTest.php
vendored
Normal file
47
vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Tests/BundleTest.php
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Doctrine Bundle
|
||||
*
|
||||
* The code was originally distributed inside the Symfony framework.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* (c) Doctrine Project, Benjamin Eberlei <kontakt@beberlei.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Doctrine\Bundle\DoctrineBundle\Tests;
|
||||
|
||||
use Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass\DoctrineValidationPass;
|
||||
use Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass\RegisterEventListenersAndSubscribersPass;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
|
||||
|
||||
class BundleTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testBuildCompilerPasses()
|
||||
{
|
||||
$container = new ContainerBuilder();
|
||||
$bundle = new DoctrineBundle();
|
||||
$bundle->build($container);
|
||||
|
||||
$config = $container->getCompilerPassConfig();
|
||||
$passes = $config->getBeforeOptimizationPasses();
|
||||
|
||||
$foundEventListener = false;
|
||||
$foundValidation = false;
|
||||
|
||||
foreach ($passes as $pass) {
|
||||
if ($pass instanceof RegisterEventListenersAndSubscribersPass) {
|
||||
$foundEventListener = true;
|
||||
} elseif ($pass instanceof DoctrineValidationPass) {
|
||||
$foundValidation = true;
|
||||
}
|
||||
}
|
||||
|
||||
$this->assertTrue($foundEventListener, 'RegisterEventListenersAndSubcribersPass was not found');
|
||||
$this->assertTrue($foundValidation, 'DoctrineValidationPass was not found');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user