Skip to content

Commit

Permalink
Better debugging information when we fail to get a session id
Browse files Browse the repository at this point in the history
  • Loading branch information
chibimagic committed Aug 13, 2013
1 parent 919064c commit a67b2f3
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions WebDriver/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,7 @@ protected function __construct($server_url, $capabilities) {

// Parse out session id
preg_match("/Location:.*\/(.*)/", $response['header'], $matches);
if (!empty($response['body'])) {
$additional_info = $response['body'];
} else if (!empty($response['header'])) {
$additional_info = $response['header'];
} else {
$additional_info = "No response from server.";
}
PHPUnit_Framework_Assert::assertEquals(2, count($matches), "Did not get a session id from $server_url\n$additional_info");
PHPUnit_Framework_Assert::assertEquals(2, count($matches), "Did not get a session id from $server_url\n" . print_r($response, true));
$this->session_id = trim($matches[1]);
}

Expand Down

0 comments on commit a67b2f3

Please sign in to comment.