Behat / Symfony2Extension

Symfony2 extension for Behat
MIT License
392 stars 106 forks source link

Prevent require dir error when kernel path is null #156

Closed guilliamxavier closed 1 year ago

guilliamxavier commented 4 years ago

Bug fix: yes.

After #141, the new default value for kernel bootstrap and path options is null, but, unlike for bootstrap, the processing of path doesn't check for emptiness, thus the test file_exists($kernel = $basePath . '/' . $kernelPath) where $kernelPath is null (or empty string) does like file_exists($kernel = $basePath . '/') which is true although $kernel then denotes a directory (not a file) which later causes an error.

So I simply added a check similar to $bootstrapPath a few lines above.

hopeseekr commented 2 years ago

I have merged this wonderful PR into my continuation of this project: https://github.com/PHPExpertsInc/SymfonyExtension/

composer require --dev phpexperts/symfony-extension

It's 100% backward compatible with behat/symfony2-extension.