Behat / Symfony2Extension

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

File permissions and Symfony 4 #149

Open nicwortel opened 5 years ago

nicwortel commented 5 years ago

In Symfony 4, umask() is used in bin/console and public/index.php so that (cache) files created by Symfony are writable for both the console user as well as the www-data user. See https://symfony.com/doc/current/setup/file_permissions.html for more information.

However, when using the Symfony2Extension, the Symfony kernel is booted directly, so the umask isn't set and also Debug::enable() isn't called. In our case we're also using Behat to test against a version of our application that is running in Docker (using Mink over HTTP), but that fails because the web server in Docker isn't allowed to write cache files to the cache directory that was created just a moment before.

We can work around that by creating a custom bootstrap file containing umask(0000); and then requiring the Symfony bootstrap file, but perhaps this is something that can be fixed in this extension?