コード例 #1
0
 public function testBasicAuth()
 {
     $request = new Consumer\Request();
     $username = '******';
     $password = '******';
     $authentication = new Consumer\Authentication\BasicAuth($username, $password);
     $key = $authentication->getName();
     $request = $request->withBasicAuth($username, $password);
     $this->assertArrayHasKey($key, $request->getHeaders());
     $this->assertEquals($authentication->getValue(), $request->getHeaderLine($key));
 }
コード例 #2
0
 public function testName()
 {
     $authentication = new Authentication\BasicAuth($this->username, $this->password);
     $this->assertEquals('Authorization', $authentication->getName());
 }