Ejemplo n.º 1
0
 /**
  * @test
  *
  * Test to ensure header is created with identifiable information with a verifier
  */
 public function verifyHeaderHasIdentifiableInformationWithVerifier()
 {
     $this->signature->setHttpMethod('get');
     $this->signature->setResourceURL('https://example.com/api');
     $this->signature->setVerifier('12345abc');
     $this->signature->setCallback('https://my.site/callback');
     $header = new Header();
     $header->setSignature($this->signature);
     $headerString = $header->createAuthorizationHeader(true);
     $this->assertContains('oauth_token="ACCESS_TOKEN"', $headerString, 'Access token not set');
     $this->assertContains('Authorization:', $headerString, 'Authorization prefix missing');
     $this->assertContains('oauth_version="1.0"', $headerString, 'OAuth version missing');
     $this->assertContains('oauth_signature_method="HMAC-SHA1"', $headerString, 'Signature method missing');
     $this->assertContains('oauth_verifier="12345abc"', $headerString, 'Verifier Missing');
 }
Ejemplo n.º 2
0
 /**
  * @test
  *
  * Ensure verifier can be set
  */
 public function ensureVerifierCanBeSet()
 {
     $verifier = '12345abc';
     $signature = $this->signature->setVerifier($verifier);
     $this->assertEquals($verifier, $this->signature->getVerifier());
     $this->assertSame($signature, $this->signature);
 }