gorghoa / ScenarioStateBehatExtension

Provide a way to share scenario state through steps
MIT License
33 stars 7 forks source link

Add ScenarioStateArgument annotation for method argument injection #11

Closed vincentchalamon closed 8 years ago

vincentchalamon commented 8 years ago

Fix #7 & #12

This PR changes method argument injection: to inject arguments from store to method declaration, this annotation must be used, otherwise arguments won't be injected.

/**
 * @ScenarioStateArgument("scenarioBanana")
 */
public function foo($scenarioBanana)
{
    // ...
}
/**
 * @ScenarioStateArgument(name="scenarioBanana")
 */
public function foo($scenarioBanana)
{
    // ...
}
/**
 * @ScenarioStateArgument(name="scenarioBanana", argument="banana")
 */
public function foo($banana)
{
    // ...
}
vincentchalamon commented 8 years ago

Add unit tests