Skip to content

Commit

Permalink
Fixed WidgetTest path for old twig-bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
core23 committed Mar 24, 2016
1 parent cff8480 commit a18a2d7
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions Tests/Form/Widget/BaseWidgetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,16 @@ interface_exists('Symfony\Component\Security\Csrf\CsrfTokenManagerInterface') ?

$this->extension = new FormExtension($renderer);

$twigPaths = array(__DIR__.'/../../../Resources/views/Form');

//this is ugly workaround for different build strategies and, possibly,
//different TwigBridge installation directories
if (is_dir(__DIR__.'/../../../vendor/symfony/twig-bridge/Resources/views/Form')) {
$twigPaths[] = __DIR__.'/../../../vendor/symfony/twig-bridge/Resources/views/Form';
} elseif (is_dir(__DIR__.'/../../../vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form')) {
$twigPaths[] = __DIR__.'/../../../vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form';
} else {
$twigPaths[] = __DIR__.'/../../../../../symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form';
}
$twigPaths = array_filter(array(
__DIR__.'/../../../vendor/symfony/twig-bridge/Symfony/Bridge/Twig/Resources/views/Form',
__DIR__.'/../../../vendor/symfony/twig-bridge/Resources/views/Form',
__DIR__.'/../../../vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form',
__DIR__.'/../../../../../symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form',
), 'is_dir');

$twigPaths[] = __DIR__.'/../../../Resources/views/Form';

$loader = new StubFilesystemLoader($twigPaths);

Expand Down

0 comments on commit a18a2d7

Please sign in to comment.