Skip to content

Commit

Permalink
Allow unit test suite to run from projects (#3966)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wharenn authored and soullivaneuh committed Jul 5, 2016
1 parent 2674406 commit d5d3a0a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Tests/Menu/Integration/BaseMenuTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down

0 comments on commit d5d3a0a

Please sign in to comment.