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

Goutte\Client::setClient() does not exist #380

Open
rkeet opened this issue Jan 29, 2022 · 5 comments
Open

Goutte\Client::setClient() does not exist #380

rkeet opened this issue Jan 29, 2022 · 5 comments

Comments

@rkeet
Copy link

rkeet commented Jan 29, 2022

Having the following requirements in require-dev in composer.json:

        "atoum/atoum": "^4.0", (4.0.3)
        "behat/behat": "^3.8", (v3.10.0)
        "behat/mink-browserkit-driver": "^2.0", (v2.0.0)
        "behat/mink-goutte-driver": "^2.0", (v2.0.0)
        "behat/mink-selenium2-driver": "^1.5", (v1.5.0)

Running php vendor/bin/behat instantly crashes on:

In GoutteFactory.php line 117:

  Method Goutte\Client::setClient() does not exist  

Function causing the Exception

$refl = new \ReflectionParameter(array('Goutte\Client', 'setClient'), 0);

Function:

    private function isGoutte1()
    {
        $refl = new \ReflectionParameter(array('Goutte\Client', 'setClient'), 0);

        $type = $refl->getType();
        if ($type instanceof \ReflectionNamedType && 'Guzzle\Http\ClientInterface' === $type->getName()) {
            return true;
        }

        return false;
    }

Now, Goutte\Client is an empty class which extends Symfony\Component\BrowserKit\HttpBrowser which in turn extends Symfony\Component\BrowserKit\AbstractBrowser.

Neither of the parent classes indeed have the function setClient.

What can I do to work around this for now or create a fix?

@newscientistgeeks
Copy link

Same here, any chance to merge the #381 ?

@ghost
Copy link

ghost commented Aug 18, 2022

the #381 has been created months ago, is there any chance merge or not? I need it.

@rkeet
Copy link
Author

rkeet commented Aug 24, 2022

Looking at this: https://github.com/Behat/MinkExtension/issues?q=is%3Aissue+sort%3Aupdated-desc I'm thinking this repository is quite dead.

Also judging by the non-response on this issue from 2020: #370

Haven't tried it out yet (maybe some week soon), but I think it's worth switching to: https://github.com/FriendsOfBehat/MinkExtension

@ghost
Copy link

ghost commented Aug 24, 2022

I switched to FriendsOfBehat, it worked for me.

@tyler36
Copy link

tyler36 commented Oct 12, 2023

Replacing behat/mink-extension with friends-of-behat/mink-extension resolved issue for me.

This project seems abandoned.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants