예제 #1
0
 /**
  * @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('/');
 }
예제 #2
0
 /**
  * @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);
 }