Пример #1
0
 /**
  * @param Request $request
  *
  * @return Response
  */
 public function hookAction(Request $request)
 {
     $this->webhookHandler->handle($request->headers->all(), $request->getContent());
     return new Response();
 }
Пример #2
0
 /**
  * @expectedException \Symfony\Component\HttpKernel\Exception\BadRequestHttpException
  * @expectedExceptionMessage The request json body cannot be decoded.
  */
 public function testHandleWithInvalidJson()
 {
     $this->firewall->expects($this->once())->method('authorize')->with($this->identicalTo($headers = ['X-Hub-Signature' => 'sha1=aff354dfbc9e335aaec1e28f2305f34db176db1b']), $this->identicalTo($body = '{"foo":"bar"'))->will($this->returnValue(true));
     $this->handler->handle($headers, $body);
 }