From fa247495374d2ea9e3dcf3069fd6905d31e2de0a Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 4 Mar 2014 17:04:39 +0100 Subject: [PATCH] [Yaml] fix for a HHVM bug --- src/Symfony/Component/Yaml/Tests/DumperTest.php | 2 +- src/Symfony/Component/Yaml/Tests/ParserTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Yaml/Tests/DumperTest.php b/src/Symfony/Component/Yaml/Tests/DumperTest.php index c51a257dc0..ec2c65e3d0 100644 --- a/src/Symfony/Component/Yaml/Tests/DumperTest.php +++ b/src/Symfony/Component/Yaml/Tests/DumperTest.php @@ -95,7 +95,7 @@ EOF; } elseif (isset($test['todo']) && $test['todo']) { // TODO } else { - $expected = eval('return '.trim($test['php']).';'); + eval('$expected = '.trim($test['php']).';'); $this->assertEquals($expected, $this->parser->parse($this->dumper->dump($expected, 10)), $test['test']); } diff --git a/src/Symfony/Component/Yaml/Tests/ParserTest.php b/src/Symfony/Component/Yaml/Tests/ParserTest.php index c7d3b071e6..07e6222d7e 100644 --- a/src/Symfony/Component/Yaml/Tests/ParserTest.php +++ b/src/Symfony/Component/Yaml/Tests/ParserTest.php @@ -62,9 +62,9 @@ class ParserTest extends \PHPUnit_Framework_TestCase if (isset($test['todo']) && $test['todo']) { // TODO } else { - $expected = var_export(eval('return '.trim($test['php']).';'), true); + eval('$expected = '.trim($test['php']).';'); - $tests[] = array($file, $expected, $test['yaml'], $test['test']); + $tests[] = array($file, var_export($expected, true), $test['yaml'], $test['test']); } } }