OAuthTestUnitCommonHttpAbstractClientTest

The Gravity Forms Salesforce Add-On OAuthTest Unit Common Http AbstractClientTest class.

Defined (1)

The class is defined in the following location(s).

/lib/PHPoAuthLib/tests/Unit/Common/Http/Client/AbstractClientTest.php  
  1. class AbstractClientTest extends \PHPUnit_Framework_TestCase 
  2. /** 
  3. * @covers OAuth\Common\Http\Client\AbstractClient::__construct 
  4. */ 
  5. public function testConstructCorrectInterface() 
  6. $client = $this->getMockForAbstractClass('\\OAuth\\Common\\Http\\Client\\AbstractClient'); 
  7.  
  8. $this->assertInstanceOf('\\OAuth\\Common\\Http\\Client\\ClientInterface', $client); 
  9.  
  10. /** 
  11. * @covers OAuth\Common\Http\Client\AbstractClient::__construct 
  12. * @covers OAuth\Common\Http\Client\AbstractClient::setMaxRedirects 
  13. */ 
  14. public function testSetMaxRedirects() 
  15. $client = $this->getMockForAbstractClass('\\OAuth\\Common\\Http\\Client\\AbstractClient'); 
  16.  
  17. $this->assertInstanceOf('\\OAuth\\Common\\Http\\Client\\AbstractClient', $client->setMaxRedirects(10)); 
  18. $this->assertInstanceOf('\\OAuth\\Common\\Http\\Client\\ClientInterface', $client->setMaxRedirects(10)); 
  19.  
  20. /** 
  21. * @covers OAuth\Common\Http\Client\AbstractClient::__construct 
  22. * @covers OAuth\Common\Http\Client\AbstractClient::setTimeout 
  23. */ 
  24. public function testSetTimeout() 
  25. $client = $this->getMockForAbstractClass('\\OAuth\\Common\\Http\\Client\\AbstractClient'); 
  26.  
  27. $this->assertInstanceOf('\\OAuth\\Common\\Http\\Client\\AbstractClient', $client->setTimeout(25)); 
  28. $this->assertInstanceOf('\\OAuth\\Common\\Http\\Client\\ClientInterface', $client->setTimeout(25)); 
  29.  
  30. /** 
  31. * @covers OAuth\Common\Http\Client\AbstractClient::__construct 
  32. * @covers OAuth\Common\Http\Client\AbstractClient::normalizeHeaders 
  33. */ 
  34. public function testNormalizeHeaders() 
  35. $client = $this->getMockForAbstractClass('\\OAuth\\Common\\Http\\Client\\AbstractClient'); 
  36.  
  37. $original = array( 
  38. 'lowercasekey' => 'lowercasevalue',  
  39. 'UPPERCASEKEY' => 'UPPERCASEVALUE',  
  40. 'mIxEdCaSeKey' => 'MiXeDcAsEvAlUe',  
  41. '31i71casekey' => '31i71casevalue',  
  42. ); 
  43.  
  44. $goal = array( 
  45. 'lowercasekey' => 'Lowercasekey: lowercasevalue',  
  46. 'UPPERCASEKEY' => 'Uppercasekey: UPPERCASEVALUE',  
  47. 'mIxEdCaSeKey' => 'Mixedcasekey: MiXeDcAsEvAlUe',  
  48. '31i71casekey' => '31i71casekey: 31i71casevalue',  
  49. ); 
  50.  
  51. $client->normalizeHeaders($original); 
  52.  
  53. $this->assertSame($goal, $original);