Skip to content

Commit

Permalink
Improve code coverage. (#1292)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmichot authored and tymondesigns committed Aug 30, 2017
1 parent c19a5e7 commit 6959beb
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/Providers/JWT/NamshiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,34 @@ public function it_should_throw_a_exception_when_the_algorithm_passed_is_invalid
$this->getProvider('secret', 'AlgorithmWrong')->decode('foo.bar.baz');
}

/**
* @test
*/
public function it_should_return_the_public_key()
{
$provider = $this->getProvider(
'does_not_matter',
'RS256',
$keys = ['private' => $this->getDummyPrivateKey(), 'public' => $this->getDummyPublicKey()]
);

$this->assertSame($keys['public'], $provider->getPublicKey());
}

/**
* @test
*/
public function it_should_return_the_keys()
{
$provider = $this->getProvider(
'does_not_matter',
'RS256',
$keys = ['private' => $this->getDummyPrivateKey(), 'public' => $this->getDummyPublicKey()]
);

$this->assertSame($keys, $provider->getKeys());
}

public function getProvider($secret, $algo, array $keys = [])
{
return new Namshi($secret, $algo, $keys, $this->jws);
Expand Down

0 comments on commit 6959beb

Please sign in to comment.