diff --git a/src/Symfony/Bundle/TwigBundle/Tests/Controller/ExceptionControllerTest.php b/src/Symfony/Bundle/TwigBundle/Tests/Controller/ExceptionControllerTest.php index 243bdd23a9..b3ccd2af01 100644 --- a/src/Symfony/Bundle/TwigBundle/Tests/Controller/ExceptionControllerTest.php +++ b/src/Symfony/Bundle/TwigBundle/Tests/Controller/ExceptionControllerTest.php @@ -18,31 +18,6 @@ use Symfony\Component\HttpFoundation\Request; class ExceptionControllerTest extends TestCase { - public function testOnlyClearOwnOutputBuffers() - { - $flatten = $this->getMock('Symfony\Component\Debug\Exception\FlattenException'); - $flatten - ->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue(404)); - $twig = $this->getMockBuilder('\Twig_Environment') - ->disableOriginalConstructor() - ->getMock(); - $twig - ->expects($this->any()) - ->method('render') - ->will($this->returnValue($this->getMock('Symfony\Component\HttpFoundation\Response'))); - $twig - ->expects($this->any()) - ->method('getLoader') - ->will($this->returnValue($this->getMock('\Twig_LoaderInterface'))); - $request = Request::create('/'); - $request->headers->set('X-Php-Ob-Level', 1); - - $controller = new ExceptionController($twig, false); - $controller->showAction($request, $flatten); - } - public function testShowActionCanBeForcedToShowErrorPage() { $twig = new \Twig_Environment( diff --git a/src/Symfony/Component/Routing/Loader/YamlFileLoader.php b/src/Symfony/Component/Routing/Loader/YamlFileLoader.php index 1a436a613f..817714acc1 100644 --- a/src/Symfony/Component/Routing/Loader/YamlFileLoader.php +++ b/src/Symfony/Component/Routing/Loader/YamlFileLoader.php @@ -58,7 +58,7 @@ class YamlFileLoader extends FileLoader } try { - $config = $this->yamlParser->parse(file_get_contents($path)); + $parsedConfig = $this->yamlParser->parse(file_get_contents($path)); } catch (ParseException $e) { throw new \InvalidArgumentException(sprintf('The file "%s" does not contain valid YAML.', $path), 0, $e); } @@ -67,16 +67,16 @@ class YamlFileLoader extends FileLoader $collection->addResource(new FileResource($path)); // empty file - if (null === $config) { + if (null === $parsedConfig) { return $collection; } // not an array - if (!is_array($config)) { + if (!is_array($parsedConfig)) { throw new \InvalidArgumentException(sprintf('The file "%s" must contain a YAML array.', $path)); } - foreach ($config as $name => $config) { + foreach ($parsedConfig as $name => $config) { if (isset($config['pattern'])) { if (isset($config['path'])) { throw new \InvalidArgumentException(sprintf('The file "%s" cannot define both a "path" and a "pattern" attribute. Use only "path".', $path));