Example #1
0
 public function testNormaliseWithInvalidScheme()
 {
     $sign = new Signature\Plaintext('foo');
     $url = 'mailto://www.example.com/request?foo=bar';
     try {
         $sign->normaliseBaseSignatureUrl($url);
     } catch (InvalidArgumentException $e) {
         $this->assertEquals('Invalid URL provided; must be an HTTP or HTTPS scheme', $e->getMessage());
     }
 }
Example #2
0
 public function testSignatureWithNULLAccessSecretIsOnlyConsumerSecretString()
 {
     $params = array('oauth_version' => '1.0', 'oauth_consumer_key' => 'dpf43f3p2l4k3l03', 'oauth_signature_method' => 'PLAINTEXT', 'oauth_timestamp' => '1191242090', 'oauth_nonce' => 'hsu94j3884jdopsl');
     $signature = new Signature\Plaintext('1234567890', null);
     $this->assertEquals('1234567890&', $signature->sign($params));
 }
Example #3
0
 public function testNormaliseHttpsRemovesQueryFromBaseSignatureUrl()
 {
     $sign = new Signature\Plaintext('foo');
     $url = 'https://www.example.com/request?foo=bar';
     $this->assertEquals('https://www.example.com/request', $sign->normaliseBaseSignatureUrl($url));
 }