[http kernel] Added client response type test.
This commit is contained in:
parent
ce7e1e6c9a
commit
686854b245
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
namespace Symfony\Component\HttpKernel\Tests;
|
namespace Symfony\Component\HttpKernel\Tests;
|
||||||
|
|
||||||
|
use Symfony\Component\BrowserKit\Response as DomResponse;
|
||||||
use Symfony\Component\HttpKernel\Client;
|
use Symfony\Component\HttpKernel\Client;
|
||||||
use Symfony\Component\HttpKernel\HttpKernel;
|
use Symfony\Component\HttpKernel\HttpKernel;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
@ -34,6 +35,7 @@ class ClientTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
$client->request('GET', '/');
|
$client->request('GET', '/');
|
||||||
$this->assertEquals('Request: /', $client->getResponse()->getContent(), '->doRequest() uses the request handler to make the request');
|
$this->assertEquals('Request: /', $client->getResponse()->getContent(), '->doRequest() uses the request handler to make the request');
|
||||||
|
$this->assertTrue($client->getResponse() instanceof DomResponse, '->getResponse() returns a Symfony\Component\BrowserKit\Response instance');
|
||||||
|
|
||||||
$client->request('GET', 'http://www.example.com/');
|
$client->request('GET', 'http://www.example.com/');
|
||||||
$this->assertEquals('Request: /', $client->getResponse()->getContent(), '->doRequest() uses the request handler to make the request');
|
$this->assertEquals('Request: /', $client->getResponse()->getContent(), '->doRequest() uses the request handler to make the request');
|
||||||
|
Reference in New Issue
Block a user