Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better DX error handling when misuse of SymfonyExtension config #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

symfonyaml
Copy link

Issue

As a dummy symfony user, when I don't use the MinkExtension correctly with the following config

# behat.yml.dist
...
    extensions:
        Behat\MinkExtension: ~   # <---- empty invalid config

we have the following PHP fatal error :

PHP Fatal error: Uncaught TypeError: array_key_exists():
Argument #2 ($array) must be of type array, null given in MinkExtension.php:120

Reproduce

composer create-project symfony/symfony-demo mink-reproduce-bug
cd ./mink-reproduce-bug
composer require --dev behat/behat friends-of-behat/symfony-extension friends-of-behat/mink-extension
echo "        Behat\MinkExtension: ~" >> behat.yml.dist
vendor/bin/behat

Solution

Checking that the config is an array, so we get this error instead :
mink

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

Successfully merging this pull request may close these issues.

1 participant