* @since 2.1.0 */ class KeychainTest extends \PHPUnit_Framework_TestCase { /** * @test * * @uses Lcobucci\JWT\Signer\Key * * @covers Lcobucci\JWT\Signer\Keychain::getPrivateKey */ public function getPrivateKeyShouldReturnAKey() { $keychain = new Keychain(); $key = $keychain->getPrivateKey('testing', 'test'); $this->assertInstanceOf(Key::class, $key); $this->assertAttributeEquals('testing', 'content', $key); $this->assertAttributeEquals('test', 'passphrase', $key); } /** * @test * * @uses Lcobucci\JWT\Signer\Key * * @covers Lcobucci\JWT\Signer\Keychain::getPublicKey */ public function getPublicKeyShouldReturnAValidResource() { $keychain = new Keychain(); $key = $keychain->getPublicKey('testing'); $this->assertInstanceOf(Key::class, $key); $this->assertAttributeEquals('testing', 'content', $key); $this->assertAttributeEquals(null, 'passphrase', $key); } }