[TwigBundle] fix useless and failing test

This commit is contained in:
Tobias Schultze 2015-10-01 16:53:49 +02:00
parent e1ede46b7d
commit d94dd1679a

View File

@ -1,44 +0,0 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\TwigBundle\Tests\Controller;
use Symfony\Bundle\TwigBundle\Tests\TestCase;
use Symfony\Bundle\TwigBundle\Controller\ExceptionController;
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);
}
}