You are here

public function ClientTest::testUsesAuth in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/fabpot/goutte/Goutte/Tests/ClientTest.php \Goutte\Tests\ClientTest::testUsesAuth()

File

vendor/fabpot/goutte/Goutte/Tests/ClientTest.php, line 83

Class

ClientTest
Goutte Client Test.

Namespace

Goutte\Tests

Code

public function testUsesAuth() {
  $guzzle = $this
    ->getGuzzle();
  $client = new Client();
  $client
    ->setClient($guzzle);
  $client
    ->setAuth('me', '**');
  $client
    ->request('GET', 'http://www.example.com/');
  $request = end($this->history)['request'];
  $this
    ->assertEquals('Basic bWU6Kio=', $request
    ->getHeaderLine('Authorization'));
}