Skip to content

Commit 5cde5c6

Browse files
committed
add jwt_is_not_valid test
1 parent 1b97342 commit 5cde5c6

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/ValidJwtTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,19 @@ public function jwt_is_valid()
3030

3131
$this->assertTrue($passes);
3232
}
33+
34+
/**
35+
* Test jwt is not valid.
36+
*
37+
* @test
38+
* @return void
39+
*/
40+
public function jwt_is_not_valid()
41+
{
42+
$rules = ['jwt' => [new ValidJwt()]];
43+
$data = ['jwt' => '1ZSwiZXhwIjoxNTgyNjE2MDA1fQ.umEYVDP_kZJGCI3tkU9dmq7CIumEU8Zvftc-klp-334'];
44+
$passes = $this->app['validator']->make($data, $rules)->passes();
45+
46+
$this->assertFalse($passes);
47+
}
3348
}

0 commit comments

Comments
 (0)