Skip to content

Commit c467d2e

Browse files
committed
Deprecated the URL alteration in visit()
This was introduced to strip the base url from the url when using the HttpKernel client in early versions of the driver. However, this was only half-working as it was impacting the current url later. A proper way to support the base url has been introduced for the HttpKernel client, so the old one can be deprecated.
1 parent 31c4e38 commit c467d2e

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

src/Behat/Mink/Driver/BrowserKitDriver.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public function __construct(Client $client, $baseUrl = null)
6161

6262
if ($baseUrl !== null && $client instanceof HttpKernelClient) {
6363
$client->setServerParameter('SCRIPT_FILENAME', parse_url($baseUrl, PHP_URL_PATH));
64+
$this->removeScriptFromUrl = false;
6465
}
6566
}
6667

@@ -86,19 +87,31 @@ public function setSession(Session $session)
8687
* Tells driver to remove hostname from URL.
8788
*
8889
* @param Boolean $remove
90+
*
91+
* @deprecated Deprecated as of 1.2, to be removed in 2.0. Pass the base url in the constructor instead.
8992
*/
9093
public function setRemoveHostFromUrl($remove = true)
9194
{
95+
trigger_error(
96+
'setRemoveHostFromUrl() is deprecated as of 1.2 and will be removed in 2.0. Pass the base url in the constructor instead.',
97+
E_USER_DEPRECATED
98+
);
9299
$this->removeHostFromUrl = (bool) $remove;
93100
}
94101

95102
/**
96103
* Tells driver to remove script name from URL.
97104
*
98105
* @param Boolean $remove
106+
*
107+
* @deprecated Deprecated as of 1.2, to be removed in 2.0. Pass the base url in the constructor instead.
99108
*/
100109
public function setRemoveScriptFromUrl($remove = true)
101110
{
111+
trigger_error(
112+
'setRemoveScriptFromUrl() is deprecated as of 1.2 and will be removed in 2.0. Pass the base url in the constructor instead.',
113+
E_USER_DEPRECATED
114+
);
102115
$this->removeScriptFromUrl = (bool) $remove;
103116
}
104117

0 commit comments

Comments
 (0)