public function ClientTest::testInsulatedRequests in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/browser-kit/Tests/ClientTest.php \Symfony\Component\BrowserKit\Tests\ClientTest::testInsulatedRequests()
File
- vendor/
symfony/ browser-kit/ Tests/ ClientTest.php, line 565
Class
Namespace
Symfony\Component\BrowserKit\TestsCode
public function testInsulatedRequests() {
$client = new TestClient();
$client
->insulate();
$client
->setNextScript("new Symfony\\Component\\BrowserKit\\Response('foobar')");
$client
->request('GET', 'http://www.example.com/foo/foobar');
$this
->assertEquals('foobar', $client
->getResponse()
->getContent(), '->insulate() process the request in a forked process');
$client
->setNextScript("new Symfony\\Component\\BrowserKit\\Response('foobar)");
try {
$client
->request('GET', 'http://www.example.com/foo/foobar');
$this
->fail('->request() throws a \\RuntimeException if the script has an error');
} catch (\Exception $e) {
$this
->assertInstanceOf('RuntimeException', $e, '->request() throws a \\RuntimeException if the script has an error');
}
}