Skip to content

Commit

Permalink
Merge pull request #162 from stof/support_symfony_5
Browse files Browse the repository at this point in the history
Add support for Symfony 5
  • Loading branch information
stof authored Dec 11, 2021
2 parents f615f92 + 5f25788 commit 680ba74
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@
"require": {
"php": ">=7.2",
"behat/mink": "^1.9.0@dev",
"symfony/browser-kit": "^4.4",
"symfony/dom-crawler": "^4.4"
"symfony/browser-kit": "^4.4 || ^5.0",
"symfony/dom-crawler": "^4.4 || ^5.0"
},

"require-dev": {
"mink/driver-testsuite": "dev-master",
"symfony/error-handler": "^4.4",
"symfony/http-client": "^4.4",
"symfony/http-kernel": "^4.4",
"symfony/mime": "^4.4",
"symfony/error-handler": "^4.4 || ^5.0",
"symfony/http-client": "^4.4 || ^5.0",
"symfony/http-kernel": "^4.4 || ^5.0",
"symfony/mime": "^4.4 || ^5.0",
"phpunit/phpunit": "^8.5 || ^9.5",
"yoast/phpunit-polyfills": "^1.0"
},
Expand Down
6 changes: 5 additions & 1 deletion src/BrowserKitDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,11 @@ private function getFilteredCrawler($xpath)
*/
private function getCrawler()
{
$crawler = $this->client->getCrawler();
try {
$crawler = $this->client->getCrawler();
} catch (BadMethodCallException $e) {
$crawler = null;
}

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

0 comments on commit 680ba74

Please sign in to comment.