12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <?php
- namespace Lcobucci\JWT;
- class SignatureTest extends \PHPUnit\Framework\TestCase
- {
-
- protected $signer;
-
- protected function setUp()
- {
- $this->signer = $this->createMock(Signer::class);
- }
-
- public function constructorMustConfigureAttributes()
- {
- $signature = new Signature('test');
- $this->assertAttributeEquals('test', 'hash', $signature);
- }
-
- public function toStringMustReturnTheHash()
- {
- $signature = new Signature('test');
- $this->assertEquals('test', (string) $signature);
- }
-
- public function verifyMustReturnWhatSignerSays()
- {
- $this->signer->expects($this->any())
- ->method('verify')
- ->willReturn(true);
- $signature = new Signature('test');
- $this->assertTrue($signature->verify($this->signer, 'one', 'key'));
- }
- }
|