Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Commit

Permalink
Added a safeguard for the Goutte version in MinkGoutteDriver
Browse files Browse the repository at this point in the history
MinkGoutteDriver 1.2 will be compatible with both Goutte 1.x and Goutte
2.x, but MinkExtension 1.3 only supports configuring Goutte 1.x. Upgrading
to Goutte 2.x will be possible only when using MinkExtension 2.0.
  • Loading branch information
stof committed May 15, 2014
1 parent e3749ff commit b885b94
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
},

"require-dev": {
"fabpot/goutte": "~1.0",
"behat/mink-goutte-driver": "~1.0"
},

Expand Down
7 changes: 7 additions & 0 deletions src/Behat/MinkExtension/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ public function load(array $config, ContainerBuilder $container)
);
}

$refl = new \ReflectionParameter(array('Goutte\Client', 'setClient'), 0);
if (!$refl->getClass() || 'Guzzle\Http\ClientInterface' !== $refl->getClass()->getName()) {
throw new \RuntimeException(
'MinkExtension 1.3 only supports Goutte 1.x for MinkGoutteDriver, not Goutte 2.x.'
);
}

$loader->load('sessions/goutte.xml');
}
if (isset($config['sahi'])) {
Expand Down

0 comments on commit b885b94

Please sign in to comment.