Skip to content

Commit

Permalink
Change content() to response()
Browse files Browse the repository at this point in the history
You may call this method from your tests, if you wish.
  • Loading branch information
JeffreyWay committed Apr 13, 2015
1 parent d1415d3 commit 0791eda
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Extensions/Goutte.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ protected function getDbAdapter()
*
* @return string
*/
protected function content()
protected function response()
{
return (string) $this->client->getResponse();
}
Expand Down
6 changes: 3 additions & 3 deletions src/Extensions/IntegrationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function see($text)
"Could not find '%s' on the page, '%s'.", $text, $this->currentPage
);

$this->assertRegExp("/{$text}/i", $this->content(), $message);
$this->assertRegExp("/{$text}/i", $this->response(), $message);
} catch (PHPUnitException $e) {
$this->logLatestContent();

Expand Down Expand Up @@ -294,7 +294,7 @@ public function dump()
{
$this->logLatestContent();

die(var_dump($this->content()));
die(var_dump($this->response()));
}

/**
Expand Down Expand Up @@ -466,7 +466,7 @@ protected function filterByNameOrId($name, $element = '*')
*/
protected function logLatestContent()
{
$this->files()->put("tests/logs/output.txt", $this->content());
$this->files()->put("tests/logs/output.txt", $this->response());
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/Extensions/Laravel.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ protected function makeRequest($requestType, $uri, $parameters = [], $cookies =

$this->currentPage = $this->app['request']->url();

$this->crawler = new Crawler($this->content(), $this->currentPage);
$this->crawler = new Crawler($this->response(), $this->currentPage);

return $this;
}
Expand Down Expand Up @@ -118,7 +118,7 @@ protected function seeRowsWereReturned($table, $data)
*
* @return string
*/
protected function content()
protected function response()
{
return $this->response->getContent();
}
Expand All @@ -142,7 +142,7 @@ protected function statusCode()
*/
protected function handleInternalError($message = null)
{
$crawler = new Crawler($this->content(), $this->currentPage);
$crawler = new Crawler($this->response(), $this->currentPage);

// A little weird, but we need to parse the output HTML to
// figure out the specifics of where the error occurred.
Expand Down
4 changes: 2 additions & 2 deletions src/Extensions/Selenium.php
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ protected function updateCurrentUrl()
*
* @return string
*/
protected function content()
protected function response()
{
return $this->session->source();
}
Expand All @@ -418,7 +418,7 @@ protected function content()
*/
protected function statusCode()
{
$response = $this->content();
$response = $this->response();

// Todo: Temporary. What is the correct way to get the status code?
Expand Down

0 comments on commit 0791eda

Please sign in to comment.