public function testRedirect() { $c = new Client($this->request); $url = '/go/to/home'; try { $c->redirect($url); //should not reach here $this->assertTrue(false); } catch (\Pex\Exception\HttpException $ex) { $this->assertEquals(302, $ex->getStatusCode()); $this->assertEquals(['location' => $url], $ex->getHeaders()); } }