diff --git a/features/autowiring_contexts.feature b/features/autowiring_contexts.feature index bcc2418..c6b9f40 100644 --- a/features/autowiring_contexts.feature +++ b/features/autowiring_contexts.feature @@ -89,3 +89,45 @@ Feature: Autowiring contexts """ When I run Behat Then it should pass + + Scenario: Autowiring and autoconfiguring context based on prototype + Given a feature file containing: + """ + Feature: + Scenario: + Then the container should be passed + """ + And a context file "tests/SomeContext.php" containing: + """ + container = $container; } + + /** @Then the container should be passed */ + public function containerShouldBePassed(): void + { + assert(is_object($this->container)); + assert($this->container instanceof ContainerInterface); + } + } + """ + And a YAML services file containing: + """ + services: + _defaults: + autowire: true + autoconfigure: true + + App\Tests\: + resource: '../tests/*' + """ + When I run Behat + Then it should pass