/** * 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(); }
/** * @test * * Ensure Post Fields can be retrieved */ public function ensurePostFieldsCanBeRetrieved() { $postFields = ['name' => 'Matt Frost']; $this->signature->setPostFields($postFields); $this->assertEquals($postFields, $this->signature->getPostFields()); }