diff --git a/features/dependency_injection/autowiring_contexts.feature b/features/dependency_injection/autowiring_contexts.feature index c6b9f40..e7042fc 100644 --- a/features/dependency_injection/autowiring_contexts.feature +++ b/features/dependency_injection/autowiring_contexts.feature @@ -131,3 +131,44 @@ Feature: Autowiring contexts """ When I run Behat Then it should pass + + Scenario: Autowiring a context with test client + Given a feature file containing: + """ + Feature: + Scenario: + Then the client should be passed + """ + And a context file "tests/SomeContext.php" containing: + """ + client = $client; } + + /** @Then the client should be passed */ + public function clientShouldBePassed(): void + { + assert(is_object($this->client)); + assert($this->client instanceof AbstractBrowser); + } + } + """ + And a YAML services file containing: + """ + services: + _defaults: + autowire: true + + App\Tests\SomeContext: + public: true + """ + When I run Behat + Then it should pass \ No newline at end of file