| @@ 125-138 (lines=14) @@ | ||
| 122 | /** |
|
| 123 | * @test |
|
| 124 | */ |
|
| 125 | public function validationWillFailWhenPrincipleIsMissing() |
|
| 126 | { |
|
| 127 | $claims = ['prn' => 'joe']; |
|
| 128 | ||
| 129 | $key = new JwtKey(['secret' => 'Buy the book']); |
|
| 130 | $key->validateClaims($claims); |
|
| 131 | ||
| 132 | unset($claims['prn']); |
|
| 133 | ||
| 134 | $this->setExpectedException('\InvalidArgumentException'); |
|
| 135 | ||
| 136 | $key = new JwtKey(['secret' => 'Buy the book']); |
|
| 137 | $key->validateClaims($claims); |
|
| 138 | } |
|
| 139 | ||
| 140 | ||
| 141 | ||
| @@ 145-158 (lines=14) @@ | ||
| 142 | /** |
|
| 143 | * @test |
|
| 144 | */ |
|
| 145 | public function validationWillFailWhenSubjectMissing() |
|
| 146 | { |
|
| 147 | $claims = ['sub' => 'joe']; |
|
| 148 | ||
| 149 | $key = new JwtKey(['secret' => 'Buy the book']); |
|
| 150 | $key->validateClaims($claims); |
|
| 151 | ||
| 152 | unset($claims['sub']); |
|
| 153 | ||
| 154 | $this->setExpectedException('\InvalidArgumentException'); |
|
| 155 | ||
| 156 | $key = new JwtKey(['secret' => 'Buy the book']); |
|
| 157 | $key->validateClaims($claims); |
|
| 158 | } |
|
| 159 | ||
| 160 | /** |
|
| 161 | * @test |
|