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: IssuedByTest.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\IssuedBy */ final class IssuedByTest extends ConstraintTestCase { /** * @test * * @covers ::__construct * @covers ::assert * * @uses \Lcobucci\JWT\Token\DataSet * @uses \Lcobucci\JWT\Token\Plain * @uses \Lcobucci\JWT\Token\Signature */ public function assertShouldRaiseExceptionWhenIssuerIsNotSet(): void { $this->expectException(ConstraintViolation::class); $this->expectExceptionMessage('The token was not issued by the given issuers'); $constraint = new IssuedBy('test.com', 'test.net'); $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 assertShouldRaiseExceptionWhenIssuerValueDoesNotMatch(): void { $this->expectException(ConstraintViolation::class); $this->expectExceptionMessage('The token was not issued by the given issuers'); $constraint = new IssuedBy('test.com', 'test.net'); $constraint->assert($this->buildToken([RegisteredClaims::ISSUER => 'example.com'])); } /** * @test * * @covers ::__construct * @covers ::assert * * @uses \Lcobucci\JWT\Token\DataSet * @uses \Lcobucci\JWT\Token\Plain * @uses \Lcobucci\JWT\Token\Signature */ public function assertShouldRaiseExceptionWhenIssuerTypeValueDoesNotMatch(): void { $this->expectException(ConstraintViolation::class); $this->expectExceptionMessage('The token was not issued by the given issuers'); $constraint = new IssuedBy('test.com', '123'); $constraint->assert($this->buildToken([RegisteredClaims::ISSUER => 123])); } /** * @test * * @covers ::__construct * @covers ::assert * * @uses \Lcobucci\JWT\Token\DataSet * @uses \Lcobucci\JWT\Token\Plain * @uses \Lcobucci\JWT\Token\Signature */ public function assertShouldNotRaiseExceptionWhenIssuerMatches(): void { $token = $this->buildToken([RegisteredClaims::ISSUER => 'test.com']); $constraint = new IssuedBy('test.com', 'test.net'); $constraint->assert($token); $this->addToAssertionCount(1); } }