OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
firebase
/
vendor
/
lcobucci
/
jwt
/
test
/
unit
/
Validation
/
Constraint
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
08/12/2024 10:36:32 AM
rwxr-xr-x
📄
ConstraintTestCase.php
685 bytes
08/12/2024 10:36:32 AM
rw-r--r--
📄
IdentifiedByTest.php
1.97 KB
08/12/2024 10:36:32 AM
rw-r--r--
📄
IssuedByTest.php
2.63 KB
08/12/2024 10:36:32 AM
rw-r--r--
📄
PermittedForTest.php
2.65 KB
08/12/2024 10:36:32 AM
rw-r--r--
📄
RelatedToTest.php
2.01 KB
08/12/2024 10:36:32 AM
rw-r--r--
📄
SignedWithTest.php
3.89 KB
08/12/2024 10:36:32 AM
rw-r--r--
📄
ValidAtTest.php
6.74 KB
08/12/2024 10:36:32 AM
rw-r--r--
Editing: IdentifiedByTest.php
Close
<?php declare(strict_types=1); namespace Lcobucci\JWT\Validation\Constraint; use Lcobucci\JWT\Token\RegisteredClaims; use Lcobucci\JWT\Validation\ConstraintViolation; /** @coversDefaultClass \Lcobucci\JWT\Validation\Constraint\IdentifiedBy */ final class IdentifiedByTest extends ConstraintTestCase { /** * @test * * @covers ::__construct * @covers ::assert * * @uses \Lcobucci\JWT\Token\DataSet * @uses \Lcobucci\JWT\Token\Plain * @uses \Lcobucci\JWT\Token\Signature */ public function assertShouldRaiseExceptionWhenIdIsNotSet(): void { $this->expectException(ConstraintViolation::class); $this->expectExceptionMessage('The token is not identified with the expected ID'); $constraint = new IdentifiedBy('123456'); $constraint->assert($this->buildToken()); } /** * @test * * @covers ::__construct * @covers ::assert * * @uses \Lcobucci\JWT\Token\DataSet * @uses \Lcobucci\JWT\Token\Plain * @uses \Lcobucci\JWT\Token\Signature */ public function assertShouldRaiseExceptionWhenIdDoesNotMatch(): void { $this->expectException(ConstraintViolation::class); $this->expectExceptionMessage('The token is not identified with the expected ID'); $constraint = new IdentifiedBy('123456'); $constraint->assert($this->buildToken([RegisteredClaims::ID => 15])); } /** * @test * * @covers ::__construct * @covers ::assert * * @uses \Lcobucci\JWT\Token\DataSet * @uses \Lcobucci\JWT\Token\Plain * @uses \Lcobucci\JWT\Token\Signature */ public function assertShouldNotRaiseExceptionWhenIdMatches(): void { $token = $this->buildToken([RegisteredClaims::ID => '123456']); $constraint = new IdentifiedBy('123456'); $constraint->assert($token); $this->addToAssertionCount(1); } }