X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fbehat%2Fmink-goutte-driver%2Fsrc%2FGoutteDriver.php;fp=vendor%2Fbehat%2Fmink-goutte-driver%2Fsrc%2FGoutteDriver.php;h=a42d5a26ac73f312078d1162eb356e51a933d2d9;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/vendor/behat/mink-goutte-driver/src/GoutteDriver.php b/vendor/behat/mink-goutte-driver/src/GoutteDriver.php new file mode 100644 index 000000000..a42d5a26a --- /dev/null +++ b/vendor/behat/mink-goutte-driver/src/GoutteDriver.php @@ -0,0 +1,75 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Behat\Mink\Driver; + +use Behat\Mink\Driver\Goutte\Client as ExtendedClient; +use Goutte\Client; + +/** + * Goutte driver. + * + * @author Konstantin Kudryashov + */ +class GoutteDriver extends BrowserKitDriver +{ + /** + * Initializes Goutte driver. + * + * @param Client $client Goutte client instance + */ + public function __construct(Client $client = null) + { + parent::__construct($client ?: new ExtendedClient()); + } + + /** + * {@inheritdoc} + */ + public function setBasicAuth($user, $password) + { + if (false === $user) { + $this->getClient()->resetAuth(); + + return; + } + + $this->getClient()->setAuth($user, $password); + } + + /** + * Gets the Goutte client. + * + * The method is overwritten only to provide the appropriate return type hint. + * + * @return Client + */ + public function getClient() + { + return parent::getClient(); + } + + /** + * {@inheritdoc} + */ + public function reset() + { + parent::reset(); + $this->getClient()->resetAuth(); + } + + /** + * {@inheritdoc} + */ + protected function prepareUrl($url) + { + return $url; + } +}