Inheritance: implements Emarref\Jwt\Verification\VerifierInterface
コード例 #1
0
 /**
  * @expectedException \RuntimeException
  * @expectedExceptionMessage Cannot use "bar" algorithm to decrypt token encrypted with algorithm "foo".
  */
 public function testAlgorithmMismatch()
 {
     $algorithmParameter = $this->getMockBuilder('Emarref\\Jwt\\HeaderParameter\\Algorithm')->getMock();
     $algorithmParameter->expects($this->exactly(2))->method('getValue')->will($this->returnValue('foo'));
     $this->header->expects($this->once())->method('findParameterByName')->with(HeaderParameter\Algorithm::NAME)->will($this->returnValue($algorithmParameter));
     $this->encryption->expects($this->exactly(2))->method('getAlgorithmName')->will($this->returnValue('bar'));
     $verifier = new EncryptionVerifier($this->encryption, $this->encoder);
     $verifier->verify($this->token);
 }
コード例 #2
0
 public function __construct(Encryption\EncryptionInterface $encryption, Encoding\EncoderInterface $encoder, SignerInterface $signer)
 {
     parent::__construct($encryption, $encoder);
     $this->signer = $signer;
 }