Skip to content

Instantly share code, notes, and snippets.

@JustAnotherMark
Created May 16, 2016 16:21
Show Gist options
  • Select an option

  • Save JustAnotherMark/2f64cb0aa87f0543dd60242b20cbcfc1 to your computer and use it in GitHub Desktop.

Select an option

Save JustAnotherMark/2f64cb0aa87f0543dd60242b20cbcfc1 to your computer and use it in GitHub Desktop.
Run Behat tests on a site with HTTP basic auth.
<?php
/**
* Before every scenario log in to HTTP basic auth.
*
* @BeforeScenario
*/
public function beforeScenario() {
$username = 'username';
$password = 'password';
// Setup basic auth.
$this->getSession()->setBasicAuth($username, $password);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment