本文整理匯總了PHP中Goutte\Client::resetAuth方法的典型用法代碼示例。如果您正苦於以下問題:PHP Client::resetAuth方法的具體用法?PHP Client::resetAuth怎麽用?PHP Client::resetAuth使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Goutte\Client
的用法示例。
在下文中一共展示了Client::resetAuth方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testResetsAuth
public function testResetsAuth()
{
$guzzle = $this->getGuzzle();
$client = new Client();
$client->setClient($guzzle);
$client->setAuth('me', '**');
$client->resetAuth();
$crawler = $client->request('GET', 'http://www.example.com/');
$request = $this->history->getLastRequest();
$this->assertNull($request->getConfig()->get('auth')[0]);
$this->assertNull($request->getConfig()->get('auth')[1]);
}
示例2: testResetsAuth
public function testResetsAuth()
{
$guzzle = $this->getGuzzle();
$client = new Client();
$client->setClient($guzzle);
$client->setAuth('me', '**');
$client->resetAuth();
$client->request('GET', 'http://www.example.com/');
$request = end($this->history)['request'];
$this->assertEquals('', $request->getHeaderLine('authorization'));
}
示例3: testResetsAuth
public function testResetsAuth()
{
$guzzle = $this->getGuzzle();
$client = new Client();
$client->setClient($guzzle);
$client->setAuth('me', '**');
$client->resetAuth();
$crawler = $client->request('GET', 'http://www.example.com/');
$request = $this->historyPlugin->getLastRequest();
$this->assertNull($request->getUsername());
$this->assertNull($request->getPassword());
}