-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a feature test to demonstrate injection #1
Conversation
composer.lock
Outdated
@@ -4,25 +4,25 @@ | |||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The composer.lock
should be in .gitignore
for a library, since it leads to impossible compatibility scenarios in CI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
@@ -2,7 +2,7 @@ | |||
|
|||
Allows injecting services from a PSR-11-compatibile container in a Behat context. | |||
|
|||
Created with lots of help from @ciaranmcnulty. | |||
Created with lots of help from [@ciaranmcnulty](https://github.com/ciaranmcnulty). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/help/swearing
/cc @ciaranmcnulty
* @Given /^I have a Zend\\ServiceManager container$/ | ||
*/ | ||
public function iHaveAZendServiceManagerContainer() | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An assertion should be added here, verifying that the container can be injected too
* @When /^I instantiate a context$/ | ||
*/ | ||
public function iInstantiateAContext() | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This... is weird
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, but it's pretty tricky to test Behat extensions - you normally end up resorting to something where you're checking from inside behat that the extension's doing its thing.
A more complete strategy would be to run another Behat process end-to-end, but that's also a bit clunky.
This is better than no tests at least
@@ -2,7 +2,7 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This documentation still has the "old way" of instantiating a ServiceManager
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean "old" way? That code was taken from a fresh (within the last 2 weeks) Expressive skeleton ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All tge configuration mumbo-jumbo: the servicemanager just accepts ctor config now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created issue #3 to handle.
Feature: | ||
|
||
Scenario: | ||
Given I have a Zend\ServiceManager container |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe PSR-11 container?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the explicitness, it's an example of a container.
Specifically this extension is for 'PSR-11 containers that are returned from an included file' which is not all of them (but applies for Zend)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright 👍
@@ -5,7 +5,8 @@ | |||
"require": { | |||
"php": "^7.1", | |||
"behat/behat": "^3.3", | |||
"psr/container": "^1.0" | |||
"psr/container": "^1.0", | |||
"symfony/dependency-injection": "^3.3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to fix the tags instead, in the services.yml - I'll look at that as a separate change after this is merged though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok thanks, I'll create a separate issue for it
No description provided.