Skip to content

Commit 5584b9c

Browse files
committed
playing with basic auth
1 parent 0295f7b commit 5584b9c

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

test/BrowserMobProxyTest.php

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class ProxyTest extends PHPUnit_Framework_TestCase {
1010

1111
public function setUp() {
1212
self::$driver = new PHPWebDriver_WebDriver();
13-
self::$client = new PHPBrowserMobProxy_Client("localhost:9090");
13+
self::$client = new PHPBrowserMobProxy_Client("localhost:8080");
1414
}
1515

1616
public function tearDown() {
@@ -43,5 +43,28 @@ public function testFirefox() {
4343
$this->session = self::$driver->session('firefox', $additional_capabilities);
4444
$this->session->open("http://github.com/adamgoucher");
4545
}
46+
47+
/**
48+
* @group proxy
49+
* @group firefox
50+
* @group auth
51+
*/
52+
public function testAuthentication() {
53+
$additional_capabilities = array();
54+
$proxy = new PHPWebDriver_WebDriverProxy();
55+
$proxy->httpProxy = self::$client->url;
56+
$proxy->add_to_capabilities($additional_capabilities);
57+
$this->session = self::$driver->session('firefox', $additional_capabilities);
58+
59+
self::$client->basic_auth('www.httpwatch.com', array('username' => 'httpwatch', 'password' => 'blah'));
60+
$this->session->open("http://www.httpwatch.com/httpgallery/authentication/authenticatedimage/default.aspx?0.992212271085009");
61+
62+
sleep(3);
63+
64+
self::$client->headers(array('monkey' => 'butt'));
65+
$this->session->open("http://www.cylog.org/headers/");
66+
67+
sleep(4);
68+
}
4669
}
4770
?>

0 commit comments

Comments
 (0)