Пример #1
0
 public function testHookAction()
 {
     $this->handler->expects($this->once())->method('handle')->with($this->identicalTo($headers = ['foo' => ['bar']]), $this->identicalTo($body = 'body'));
     $request = $this->createRequestMock();
     $request->headers = $this->createParameterBagMock();
     $request->headers->expects($this->once())->method('all')->will($this->returnValue($headers));
     $request->expects($this->once())->method('getContent')->will($this->returnValue($body));
     $response = $this->controller->hookAction($request);
     $this->assertInstanceOf(Response::class, $response);
     $this->assertSame(Response::HTTP_OK, $response->getStatusCode());
     $this->assertEmpty($response->getContent());
 }