Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jerome_ks's avatar

Behat Setup for Modules

We are working on a laravel project, that consist of one main app that is more or less a container for many vendor modules. When we implement a new feature set this is solved as a module hat goes into the vendor folder, installed via composer. I would like to be able to test each module independently. Having its own test config, features and suits. But for now when I followed the Behat for laravel Installation Guide I can only test features in the main app context. Running Behat init in a submodule folder works as expected. Running a test in the submodule folder fails with laravel bootstrap file not found.

Could not locate the path to the Laravel bootstrap file.

This is my behat.yml in vendor/mymodule/mysubmodule/

default: extensions: Laracasts\Behat: # env_path: .env.behat Behat\MinkExtension: default_session: laravel base_url: http://myproject.box laravel: ~

Any hints for me?

0 likes
1 reply
jerome_ks's avatar

Seems I mixed up behat 2.5 and 3.0, correct config should look like default: extensions: Laracasts\Behat: env_path: .env Behat\MinkExtension: base_url: http://myproject.box default_session: laravel laravel: ~ poicms: autoload: '': %paths.base%/vendor/mymodule/mysubmodule/features/bootstrap/admin suites: admin: paths: - %paths.base%/vendor/mymodule/mysubmodule/features/admin

I am still unsatisfied as this config is now part of the global app. I would prefer each submodule to have a own config.

Please or to participate in this conversation.