public function check(Event $event) { list($algorithm, $signature) = explode('=', $event->getSignature()); $payLoadHash = hash_hmac($algorithm, $event->getContent(), $this->secret); if ($payLoadHash === $signature) { return true; } else { return false; } }
public function it_will_return_false_on_check_fail(Event $event) { $event->getSignature()->willReturn('sha1=abc123'); $event->getContent()->willReturn('{}'); $this->check($event)->shouldReturn(false); }