瀏覽代碼

Fix compiler pass tests

Emmanuel Vella 10 年之前
父節點
當前提交
33ba7876b8
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      Tests/SonataAdminBundleTest.php

+ 6 - 1
Tests/SonataAdminBundleTest.php

@@ -17,6 +17,7 @@ use Symfony\Component\DependencyInjection\Compiler\PassConfig;
 use Sonata\AdminBundle\DependencyInjection\Compiler\AddDependencyCallsCompilerPass;
 use Sonata\AdminBundle\DependencyInjection\Compiler\AddFilterTypeCompilerPass;
 use Sonata\AdminBundle\DependencyInjection\Compiler\ExtensionCompilerPass;
+use Sonata\AdminBundle\DependencyInjection\Compiler\GlobalVariablesCompilerPass;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
 
 /**
@@ -30,7 +31,7 @@ class SonataAdminBundleTest extends \PHPUnit_Framework_TestCase
     {
         $containerBuilder = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder', array('addCompilerPass'));
 
-        $containerBuilder->expects($this->exactly(3))
+        $containerBuilder->expects($this->exactly(4))
             ->method('addCompilerPass')
             ->will($this->returnCallback(function (CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION) {
                 if ($pass instanceof AddDependencyCallsCompilerPass) {
@@ -45,6 +46,10 @@ class SonataAdminBundleTest extends \PHPUnit_Framework_TestCase
                     return;
                 }
 
+                if ($pass instanceof GlobalVariablesCompilerPass) {
+                    return;
+                }
+
                 $this->fail(sprintf('Compiler pass is not one of the expected types. Expects "Sonata\AdminBundle\DependencyInjection\Compiler\AddDependencyCallsCompilerPass", "Sonata\AdminBundle\DependencyInjection\Compiler\AddFilterTypeCompilerPass" or "Sonata\AdminBundle\DependencyInjection\Compiler\ExtensionCompilerPass", but got "%s".', get_class($pass)));
             }));