FriendsOfBehat / SymfonyExtension

:musical_score: Extension integrating Behat with Symfony.
MIT License
472 stars 62 forks source link

Fix for #88 #129

Closed DonCallisto closed 2 years ago

DonCallisto commented 4 years ago

https://github.com/FriendsOfBehat/SymfonyExtension/issues/88#issuecomment-646036972

DonCallisto commented 4 years ago

@pamil forgot to add bind section to first test. This way it was failing due to misconfiguration (no service for AbstractBrowser). Just let me try to fix and see if still fails

DonCallisto commented 4 years ago

@pamil umh, I'm a little bit confused. That's the situation where it should not pass. Am I missing something?

DonCallisto commented 4 years ago

@cv65kr why environment should be different than test? This extension is used specifically in test environment, so why should the test case take into account a different env?

cv65kr commented 4 years ago

client.test is always available when environment is set to test (https://symfony.com/doc/current/reference/configuration/framework.html#test).

In previous version of this extension you have a possibility to run Behat tests with different environment then test.

DonCallisto commented 4 years ago

Umh, but when I run tests in a Symfony app (and so #88 issue arise), I suppose that environment value was/is test. Am I missing something?

cv65kr commented 4 years ago

Little weird, first of all try to set up test to true in your configuration then we will look if problem still exist.

DonCallisto commented 4 years ago

@cv65kr check out now. env is setted to test and test is green.

cv65kr commented 4 years ago

I mean

framework:
    test: true

in config/framework.yml because that's enable test.client service (https://github.com/symfony/symfony/blob/3e57f1f49f993b275fc014e029fc542ead2c15fb/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php#L261)

Let's try. If you change this value to false then test should failed. Maybe when APP_ENV is set to test this configuration is set up automatically.

Also try debug FrameworkExtension to make sure if test.client is not removed.

DonCallisto commented 4 years ago

@cv65kr this should be the same. Am I wrong? If I change the value to dev, the test fails.

cv65kr commented 4 years ago

I lost myself 😄 same with?

DonCallisto commented 4 years ago

What I've done is (practically) the same of

framework:
    test: true

Isn't it?

cv65kr commented 4 years ago

Right, that should be equals.

Yozhef commented 2 years ago

@DonCallisto can you please update your branch in master - we need run GitHub Actions

DonCallisto commented 2 years ago

@Yozhef done

Yozhef commented 2 years ago

@cv65kr tell me do you have any other comments?