Ejemplo n.º 1
0
 /**
  * @test
  *
  * Ensure different timestamps are set, offsetting the time by 10 seconds
  */
 public function differentTimestamps()
 {
     $this->signature->setTimestamp();
     $time1 = $this->signature->getTimestamp();
     $this->assertGreaterThan(0, $time1, 'Timestamp 1 is not greater than 0');
     $this->signature->setTimestamp($time1 + 10);
     $time2 = $this->signature->getTimestamp();
     $this->assertGreaterThan($time1, $time2);
 }
Ejemplo n.º 2
0
 /**
  * Accessor method for setting a preconfigured signature which will set the other
  * properties from the data contained in the signature
  *
  * @param HmacSha1 $signature
  */
 public function setSignature(HmacSha1 $signature)
 {
     $this->signature = $signature;
     $this->resourceUrl = $signature->getResourceURL();
     $this->httpMethod = $signature->getHttpMethod();
     $this->nonce = $signature->getNonce();
     $this->timestamp = $signature->getTimestamp();
     $this->verifier = $signature->getVerifier();
     $this->postFields = $signature->getPostFields();
 }