[HttpKernel] added a missing unit test

This commit is contained in:
Fabien Potencier 2013-01-24 07:51:29 +01:00
parent c0d72d275f
commit 6a53180aa9

View File

@ -33,11 +33,22 @@ class HttpContentRendererTest extends \PHPUnit_Framework_TestCase
$renderer->render('/', 'foo');
}
/**
* @expectedException InvalidArgumentException
*/
public function testRenderWithUnknownStrategy()
{
$strategy = $this->getStrategy($this->returnValue(new Response('foo')));
$renderer = $this->getRenderer($strategy);
$renderer->render('/', 'bar');
}
/**
* @expectedException RuntimeException
* @expectedExceptionMessage Error when rendering "http://localhost/" (Status code is 404).
*/
public function testDeliverWithUnSuccessfulResponse()
public function testDeliverWithUnsuccessfulResponse()
{
$strategy = $this->getStrategy($this->returnValue(new Response('foo', 404)));
$renderer = $this->getRenderer($strategy);