Skip to content

Commit 7e9652a

Browse files
committed
Merge pull request #69 from stof/deprecate_url_alteration
Deprecated the URL alteration in visit()
2 parents 31c4e38 + b0909b6 commit 7e9652a

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

src/Behat/Mink/Driver/BrowserKitDriver.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class BrowserKitDriver extends CoreDriver
4545
private $forms = array();
4646
private $serverParameters = array();
4747
private $started = false;
48-
private $removeScriptFromUrl = true;
48+
private $removeScriptFromUrl = false;
4949
private $removeHostFromUrl = false;
5050

5151
/**
@@ -86,19 +86,31 @@ public function setSession(Session $session)
8686
* Tells driver to remove hostname from URL.
8787
*
8888
* @param Boolean $remove
89+
*
90+
* @deprecated Deprecated as of 1.2, to be removed in 2.0. Pass the base url in the constructor instead.
8991
*/
9092
public function setRemoveHostFromUrl($remove = true)
9193
{
94+
trigger_error(
95+
'setRemoveHostFromUrl() is deprecated as of 1.2 and will be removed in 2.0. Pass the base url in the constructor instead.',
96+
E_USER_DEPRECATED
97+
);
9298
$this->removeHostFromUrl = (bool) $remove;
9399
}
94100

95101
/**
96102
* Tells driver to remove script name from URL.
97103
*
98104
* @param Boolean $remove
105+
*
106+
* @deprecated Deprecated as of 1.2, to be removed in 2.0. Pass the base url in the constructor instead.
99107
*/
100108
public function setRemoveScriptFromUrl($remove = true)
101109
{
110+
trigger_error(
111+
'setRemoveScriptFromUrl() is deprecated as of 1.2 and will be removed in 2.0. Pass the base url in the constructor instead.',
112+
E_USER_DEPRECATED
113+
);
102114
$this->removeScriptFromUrl = (bool) $remove;
103115
}
104116

tests/Behat/Mink/Driver/BrowserKitDriverTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ protected static function getDriver()
1515
{
1616
$client = new Client(require(__DIR__.'/../../../app.php'));
1717
$driver = new BrowserKitDriver($client);
18-
$driver->setRemoveScriptFromUrl(false);
1918

2019
return $driver;
2120
}

0 commit comments

Comments
 (0)