Feature: Accessing a context in another context Scenario: Accessing a context in another context Given a working Symfony application with SymfonyExtension configured And a Behat configuration containing: """ default: suites: default: contexts: - App\Tests\SomeContext - App\Tests\AnotherContext """ And a feature file containing: """ Feature: Scenario: Then it should pass """ And a context file "tests/SomeContext.php" containing: """ getEnvironment(); $this->someContext = $environment->getContext('App\Tests\SomeContext'); } /** @Then it should pass */ public function itShouldPass(): void { $this->someContext->someMethod(); } } """ And a YAML services file containing: """ services: App\Tests\SomeContext: public: true App\Tests\AnotherContext: public: true """ When I run Behat Then it should pass