You are here

public function BasicAuthTest::testResetBasicAuth in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/behat/mink/driver-testsuite/tests/Basic/BasicAuthTest.php \Behat\Mink\Tests\Driver\Basic\BasicAuthTest::testResetBasicAuth()

File

vendor/behat/mink/driver-testsuite/tests/Basic/BasicAuthTest.php, line 31

Class

BasicAuthTest

Namespace

Behat\Mink\Tests\Driver\Basic

Code

public function testResetBasicAuth() {
  $session = $this
    ->getSession();
  $session
    ->setBasicAuth('mink-user', 'mink-password');
  $session
    ->visit($this
    ->pathTo('/basic_auth.php'));
  $this
    ->assertContains('is authenticated', $session
    ->getPage()
    ->getContent());
  $session
    ->setBasicAuth(false);
  $session
    ->visit($this
    ->pathTo('/headers.php'));
  $this
    ->assertNotContains('PHP_AUTH_USER', $session
    ->getPage()
    ->getContent());
}