Skip to content

Commit 7c882ce

Browse files
committed
Migrate to the AbstractBrowser class
This is a BC break, but the impact should be fairly small for users.
1 parent 25f2735 commit 7c882ce

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/BrowserKitDriver.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
use Behat\Mink\Exception\DriverException;
1414
use Behat\Mink\Exception\UnsupportedDriverActionException;
15+
use Symfony\Component\BrowserKit\AbstractBrowser;
1516
use Symfony\Component\BrowserKit\Client;
1617
use Symfony\Component\BrowserKit\Cookie;
1718
use Symfony\Component\BrowserKit\Exception\BadMethodCallException;
@@ -21,9 +22,8 @@
2122
use Symfony\Component\DomCrawler\Field\FileFormField;
2223
use Symfony\Component\DomCrawler\Field\FormField;
2324
use Symfony\Component\DomCrawler\Field\InputFormField;
24-
use Symfony\Component\DomCrawler\Field\TextareaFormField;
2525
use Symfony\Component\DomCrawler\Form;
26-
use Symfony\Component\HttpKernel\Client as HttpKernelClient;
26+
use Symfony\Component\HttpKernel\HttpKernelBrowser;
2727

2828
/**
2929
* Symfony2 BrowserKit driver.
@@ -47,20 +47,20 @@ class BrowserKitDriver extends CoreDriver
4747
* @param Client $client BrowserKit client instance
4848
* @param string|null $baseUrl Base URL for HttpKernel clients
4949
*/
50-
public function __construct(Client $client, $baseUrl = null)
50+
public function __construct(AbstractBrowser $client, $baseUrl = null)
5151
{
5252
$this->client = $client;
5353
$this->client->followRedirects(true);
5454

55-
if ($baseUrl !== null && $client instanceof HttpKernelClient) {
55+
if ($baseUrl !== null && $client instanceof HttpKernelBrowser) {
5656
$client->setServerParameter('SCRIPT_FILENAME', parse_url($baseUrl, PHP_URL_PATH));
5757
}
5858
}
5959

6060
/**
61-
* Returns BrowserKit HTTP client instance.
61+
* Returns BrowserKit browser instance.
6262
*
63-
* @return Client
63+
* @return AbstractBrowser
6464
*/
6565
public function getClient()
6666
{

0 commit comments

Comments
 (0)