예제 #1
0
 /**
  * @group accessors
  */
 public function testGetCreationDate()
 {
     $signature = new Crypt_GPG_Signature(array('id' => 'KuhELanvhPRXozEjFWb2mam1q20', 'fingerprint' => '8D2299D9C5C211128B32BBB0C097D9EC94C06363', 'creation' => 1221785858, 'expiration' => 1421785858, 'valid' => false, 'userId' => 'Alice <*****@*****.**>'));
     $this->assertEquals(1221785858, $signature->getCreationDate());
 }
예제 #2
0
파일: TestCase.php 프로젝트: pear/crypt_gpg
 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.');
 }