diff --git a/.gitignore b/.gitignore index 15fa182..60f39b5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ /.idea/ -/tests/ /var/ /vendor/ diff --git a/tests/FreeElephants/Jwt/FirebaseJwtAdapterTest.php b/tests/FreeElephants/Jwt/FirebaseJwtAdapterTest.php new file mode 100644 index 0000000..3d12603 --- /dev/null +++ b/tests/FreeElephants/Jwt/FirebaseJwtAdapterTest.php @@ -0,0 +1,39 @@ +authid = 'joe'; + $expected->authroles = [ + 'subscriber' + ]; + + $this->assertEquals($expected, $decoder->decode($signature)); + } + + public function testUseEmptyAllowedAlgorithmsListInvalidArgumentException() + { + $this->expectException(InvalidArgumentException::class); + new FirebaseJwtDecoderAdapter('example_key', []); + } + + public function testSetAllowedAlgorithmsOutOfBoundsException() + { + $this->expectException(OutOfBoundsException::class); + new FirebaseJwtDecoderAdapter('example_key', ['foo bar']); + } +} \ No newline at end of file