@@ 116-129 (lines=14) @@ | ||
113 | /** |
|
114 | * @test |
|
115 | */ |
|
116 | public function validationWillFailWhenPrincipleIsMissing() |
|
117 | { |
|
118 | $claims = ['prn' => 'joe']; |
|
119 | ||
120 | $key = new JwtKey(['secret' => 'Buy the book']); |
|
121 | $key->validateClaims($claims); |
|
122 | ||
123 | unset($claims['prn']); |
|
124 | ||
125 | $this->setExpectedException('\InvalidArgumentException'); |
|
126 | ||
127 | $key = new JwtKey(['secret' => 'Buy the book']); |
|
128 | $key->validateClaims($claims); |
|
129 | } |
|
130 | ||
131 | ||
132 | ||
@@ 136-149 (lines=14) @@ | ||
133 | /** |
|
134 | * @test |
|
135 | */ |
|
136 | public function validationWillFailWhenSubjectMissing() |
|
137 | { |
|
138 | $claims = ['sub' => 'joe']; |
|
139 | ||
140 | $key = new JwtKey(['secret' => 'Buy the book']); |
|
141 | $key->validateClaims($claims); |
|
142 | ||
143 | unset($claims['sub']); |
|
144 | ||
145 | $this->setExpectedException('\InvalidArgumentException'); |
|
146 | ||
147 | $key = new JwtKey(['secret' => 'Buy the book']); |
|
148 | $key->validateClaims($claims); |
|
149 | } |
|
150 | ||
151 | /** |
|
152 | * @test |