8000 minor #31091 [TwigBridge] fix tests (nicolas-grekas) · symfony/symfony@d134dfc · GitHub
[go: up one dir, main page]

Skip to content

Commit d134dfc

Browse files
minor #31091 [TwigBridge] fix tests (nicolas-grekas)
This PR was merged into the 3.4 branch. Discussion ---------- [TwigBridge] fix tests | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Follows twigphp/Twig#2935 Commits ------- 33c6681 [TwigBridge] fix tests
2 parents 9483779 + 33c6681 commit d134dfc

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ before_install:
4848
# Enable Sury ppa
4949
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6B05F25D762E3157
5050
sudo add-apt-repository -y ppa:ondrej/php
51+
sudo rm /etc/apt/sources.list.d/google-chrome.list
52+
sudo rm /etc/apt/sources.list.d/mongodb-3.4.list
5153
sudo apt update
5254
5355
- |

src/Symfony/Bridge/Twig/Tests/TokenParser/FormThemeTokenParserTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,14 @@ public function testCompile($source, $expected)
3030
{
3131
$env = new Environment($this->getMockBuilder('Twig\Loader\LoaderInterface')->getMock(), ['cache' => false, 'autoescape' => false, 'optimizations' => 0]);
3232
$env->addTokenParser(new FormThemeTokenParser());
33-
$stream = $env->tokenize(new Source($source, ''));
33+
$source = new Source($source, '');
34+
$stream = $env->tokenize($source);
3435
$parser = new Parser($env);
3536

37+
if (method_exists($expected, 'setSourceContext')) {
38+
$expected->setSourceContext($source);
39+
}
40+
3641
$this->assertEquals($expected, $parser->parse($stream)->getNode('body')->getNode(0));
3742
}
3843

0 commit comments

Comments
 (0)
0