Skip to content

Commit 680ba74

Browse files
authored
Merge pull request #162 from stof/support_symfony_5
Add support for Symfony 5
2 parents f615f92 + 5f25788 commit 680ba74

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

composer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@
1717
"require": {
1818
"php": ">=7.2",
1919
"behat/mink": "^1.9.0@dev",
20-
"symfony/browser-kit": "^4.4",
21-
"symfony/dom-crawler": "^4.4"
20+
"symfony/browser-kit": "^4.4 || ^5.0",
21+
"symfony/dom-crawler": "^4.4 || ^5.0"
2222
},
2323

2424
"require-dev": {
2525
"mink/driver-testsuite": "dev-master",
26-
"symfony/error-handler": "^4.4",
27-
"symfony/http-client": "^4.4",
28-
"symfony/http-kernel": "^4.4",
29-
"symfony/mime": "^4.4",
26+
"symfony/error-handler": "^4.4 || ^5.0",
27+
"symfony/http-client": "^4.4 || ^5.0",
28+
"symfony/http-kernel": "^4.4 || ^5.0",
29+
"symfony/mime": "^4.4 || ^5.0",
3030
"phpunit/phpunit": "^8.5 || ^9.5",
3131
"yoast/phpunit-polyfills": "^1.0"
3232
},

src/BrowserKitDriver.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,11 @@ private function getFilteredCrawler($xpath)
821821
*/
822822
private function getCrawler()
823823
{
824-
$crawler = $this->client->getCrawler();
824+
try {
825+
$crawler = $this->client->getCrawler();
826+
} catch (BadMethodCallException $e) {
827+
$crawler = null;
828+
}
825829

826830
if (null === $crawler) {
827831
throw new DriverException('Unable to access the response content before visiting a page');

0 commit comments

Comments
 (0)