From b4bcbb12334df457b80c8fa1e6070a8d899982fe Mon Sep 17 00:00:00 2001 From: Kamil Kokot Date: Wed, 9 Jan 2019 23:02:55 +0100 Subject: [PATCH] Test autowired & autoconfigured contexts --- features/autowiring_contexts.feature | 42 ++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) 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