As in v1.0, to inject a state fragment key to a step method, the methods argument must match the wanted state fragment’s key.
v1.0 Example (granted that scenarioBonobo state fragment has been provided before):
/**
* @When bonobo gives this banana to :monkey
*/
public function giveBananaToGorilla($monkey, Bonobo $scenarioBonobo)
{
…
}
It would be nice to declare a more flexible mapping through annotations.
Proposal:
/**
* @When bonobo gives this banana to :monkey
* @ScenarioStateInject scenarioBonobo to $bonobo
*/
public function giveBananaToGorilla($monkey, Bonobo $bonobo)
{
…
}
As in v1.0, to inject a state fragment key to a step method, the methods argument must match the wanted state fragment’s key.
v1.0 Example (granted that
scenarioBonobo
state fragment has been provided before):It would be nice to declare a more flexible mapping through annotations.
Proposal: