/** * @group accessors */ public function testGetKeyFingerprint() { $signature = new Crypt_GPG_Signature(array('id' => 'KuhELanvhPRXozEjFWb2mam1q20', 'fingerprint' => '8D2299D9C5C211128B32BBB0C097D9EC94C06363', 'creation' => 1221785858, 'expiration' => 1421785858, 'valid' => false, 'userId' => 'Alice <*****@*****.**>')); $this->assertEquals('8D2299D9C5C211128B32BBB0C097D9EC94C06363', $signature->getKeyFingerprint()); }
protected function assertSignatureEquals(Crypt_GPG_Signature $expected, Crypt_GPG_Signature $actual) { $expectedUserId = $expected->getUserId(); $actualUserId = $actual->getUserId(); $this->assertEquals($expectedUserId, $actualUserId, 'Signature user ids do not match.'); $expectedId = $expected->getId(); $actualId = $actual->getId(); $this->assertEquals(strlen($expectedId), strlen($actualId), 'Signature IDs are of different length.'); $this->assertEquals($expected->getKeyFingerprint(), $actual->getKeyFingerprint(), 'Signature key fingerprints do not match.'); $this->assertEquals($expected->getKeyId(), $actual->getKeyId(), 'Signature key IDs do not match.'); $this->assertEquals($expected->getCreationDate(), $actual->getCreationDate(), 'Signature creation dates do not match.'); $this->assertEquals($expected->getExpirationDate(), $actual->getExpirationDate(), 'Signature expiration dates do not match.'); $this->assertEquals($expected->isValid(), $actual->isValid(), 'Signature validity does match.'); }