-
Notifications
You must be signed in to change notification settings - Fork 203
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
[POC - Behat] Add RepositoryContext trait #1584
[POC - Behat] Add RepositoryContext trait #1584
Conversation
d21b451
to
cb0393a
Compare
private $adminUserId = 14; | ||
|
||
/** | ||
* @var Repository |
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.
Please use the full namespace in phpdoc (same below).
cb0393a
to
a973922
Compare
@bdunogier Improved the docs in the Context and added a more detailed to a dedicated behat docs file. |
How is the repository injected in the trait again ? |
@bdunogier the repository has to be injected into the context in which this trait is used, using the ArgumentResolver (#1586), pass it through the behat.yml into the constructor or any other way... |
5727a34
to
6e624e5
Compare
/** | ||
* @param eZ\Publish\API\Repository\Repository $repository | ||
*/ | ||
public function setRepository(Repository $repository) |
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 should be protected, not public. Each context that uses the trait would expose setRepository & loginAdmin, while it is not necessary.
I'm not sure what to say. It is fine, and it works, but for many little reasons it does not sound right... But let's say that if you:
I'll be +1 then. |
@dpobel changed the visibility and added the getter |
de9242c
to
09ade8b
Compare
09ade8b
to
38bb920
Compare
Actually the |
ping @bdunogier |
And it is merged. Let's see during the 16.06 cycle how it behaves. I'll use it in a scenario of mine right away. |
As decided BehatBundle is to be deprecated and separated between the kernel and platformUI bundle. The idea is to make the Behat easier to maintain, having less repo dependencies should help releases and versions also.
This PR moves the RepositoryContext trait into the kernel. This is trait contains all the methods related to the repo . Since this is to be used by any contexts that need the repo it should be in the kernel to be easily included and not duplicate.
Related PRs: