/** * @test */ public function to_applies_response_filters() { $filter = $this->getMockBuilder('\\Proxy\\Response\\Filter\\ResponseFilterInterface')->getMock(); $filter->expects($this->once())->method('filter'); $this->proxy->addResponseFilter($filter); $this->proxy->forward(Request::createFromGlobals())->to('/'); }
/** * @test */ public function to_applies_response_filter_closure() { $executed = false; $this->proxy->addResponseFilter(function (Response $response) use(&$executed) { $this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Response', $response); $executed = true; }); $this->proxy->forward(Request::createFromGlobals())->to('/'); $this->assertTrue($executed); }