Skip to content

Commit

Permalink
Merge branch '3.4' into 4.2
Browse files Browse the repository at this point in the history
* 3.4:
  [TwigBridge] fix tests
  • Loading branch information
nicolas-grekas committed Apr 12, 2019
2 parents 69b43fa + d134dfc commit 1d02ef2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .travis.yml
Expand Up @@ -48,6 +48,8 @@ before_install:
# Enable Sury ppa
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6B05F25D762E3157
sudo add-apt-repository -y ppa:ondrej/php
sudo rm /etc/apt/sources.list.d/google-chrome.list
sudo rm /etc/apt/sources.list.d/mongodb-3.4.list
sudo apt update
sudo apt install -y librabbitmq-dev libsodium-dev
Expand Down
Expand Up @@ -30,9 +30,14 @@ public function testCompile($source, $expected)
{
$env = new Environment($this->getMockBuilder('Twig\Loader\LoaderInterface')->getMock(), ['cache' => false, 'autoescape' => false, 'optimizations' => 0]);
$env->addTokenParser(new FormThemeTokenParser());
$stream = $env->tokenize(new Source($source, ''));
$source = new Source($source, '');
$stream = $env->tokenize($source);
$parser = new Parser($env);

if (method_exists($expected, 'setSourceContext')) {
$expected->setSourceContext($source);
}

$this->assertEquals($expected, $parser->parse($stream)->getNode('body')->getNode(0));
}

Expand Down

0 comments on commit 1d02ef2

Please sign in to comment.