Skip to content

Commit

Permalink
Removed the deprecated url altering
Browse files Browse the repository at this point in the history
  • Loading branch information
stof committed Jan 23, 2015
1 parent eeaebb9 commit 5fb2810
Showing 1 changed file with 1 addition and 50 deletions.
51 changes: 1 addition & 50 deletions src/Behat/Mink/Driver/BrowserKitDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ class BrowserKitDriver extends CoreDriver
private $forms = array();
private $serverParameters = array();
private $started = false;
private $removeScriptFromUrl = false;
private $removeHostFromUrl = false;

/**
* Initializes BrowserKit driver.
Expand Down Expand Up @@ -68,38 +66,6 @@ public function getClient()
return $this->client;
}

/**
* Tells driver to remove hostname from URL.
*
* @param Boolean $remove
*
* @deprecated Deprecated as of 1.2, to be removed in 2.0. Pass the base url in the constructor instead.
*/
public function setRemoveHostFromUrl($remove = true)
{
trigger_error(
'setRemoveHostFromUrl() is deprecated as of 1.2 and will be removed in 2.0. Pass the base url in the constructor instead.',
E_USER_DEPRECATED
);
$this->removeHostFromUrl = (bool) $remove;
}

/**
* Tells driver to remove script name from URL.
*
* @param Boolean $remove
*
* @deprecated Deprecated as of 1.2, to be removed in 2.0. Pass the base url in the constructor instead.
*/
public function setRemoveScriptFromUrl($remove = true)
{
trigger_error(
'setRemoveScriptFromUrl() is deprecated as of 1.2 and will be removed in 2.0. Pass the base url in the constructor instead.',
E_USER_DEPRECATED
);
$this->removeScriptFromUrl = (bool) $remove;
}

/**
* {@inheritdoc}
*/
Expand Down Expand Up @@ -141,7 +107,7 @@ public function reset()
*/
public function visit($url)
{
$this->client->request('GET', $this->prepareUrl($url), array(), array(), $this->serverParameters);
$this->client->request('GET', $url, array(), array(), $this->serverParameters);
$this->forms = array();
}

Expand Down Expand Up @@ -547,21 +513,6 @@ protected function getResponse()
return $response;
}

/**
* Prepares URL for visiting.
* Removes "*.php/" from urls and then passes it to BrowserKitDriver::visit().
*
* @param string $url
*
* @return string
*/
protected function prepareUrl($url)
{
$replacement = ($this->removeHostFromUrl ? '' : '$1') . ($this->removeScriptFromUrl ? '' : '$2');

return preg_replace('#(https?\://[^/]+)(/[^/\.]+\.php)?#', $replacement, $url);
}

/**
* Returns form field from XPath query.
*
Expand Down

0 comments on commit 5fb2810

Please sign in to comment.