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'); } }