Exemplo n.º 1
0
 /**
  * @test
  *
  * @uses Lcobucci\JWT\Signer\Ecdsa::__construct
  * @uses Lcobucci\JWT\Signer\Key
  *
  * @covers Lcobucci\JWT\Signer\Ecdsa::doVerify
  * @covers Lcobucci\JWT\Signer\Ecdsa::createSigningHash
  * @covers Lcobucci\JWT\Signer\Ecdsa::extractSignature
  */
 public function doVerifyShouldDelegateToEcdsaSignerUsingPublicKey()
 {
     $signer = $this->getSigner();
     $key = new Key('testing');
     $publicKey = $this->getMock(PublicKeyInterface::class);
     $this->parser->expects($this->once())->method('getPublicKey')->with($key)->willReturn($publicKey);
     $this->adapter->expects($this->exactly(3))->method('hexDec')->willReturn('123');
     $this->signer->expects($this->once())->method('verify')->with($publicKey, $this->isInstanceOf(Signature::class), $this->isType('string'))->willReturn(true);
     $this->assertTrue($signer->doVerify('testing', 'testing2', $key));
 }