Kaynağa Gözat

Allow unit test suite to run from projects (#3966)

Romain Mouillard 9 yıl önce
ebeveyn
işleme
d5d3a0a70b
1 değiştirilmiş dosya ile 5 ekleme ve 2 silme
  1. 5 2
      Tests/Menu/Integration/BaseMenuTest.php

+ 5 - 2
Tests/Menu/Integration/BaseMenuTest.php

@@ -29,10 +29,13 @@ abstract class BaseMenuTest extends \PHPUnit_Framework_TestCase
      */
     public function setUp()
     {
-        $twigPaths = array(
+        // Adapt to both bundle and project-wide test strategy
+        $twigPaths = array_filter(array(
+            __DIR__.'/../../../../../../vendor/knplabs/knp-menu/src/Knp/Menu/Resources/views',
             __DIR__.'/../../../vendor/knplabs/knp-menu/src/Knp/Menu/Resources/views',
             __DIR__.'/../../../Resources/views',
-        );
+        ), 'is_dir');
+
         $loader = new StubFilesystemLoader($twigPaths);
         $this->environment = new \Twig_Environment($loader, array('strict_variables' => true));
     }