How can I use variable between the steps within one scenario in behat? I need to store the value of $output and then use it in the second step.
Let's say I have the following structure:
class testContext extends DefaultContext
{
/** @When /^I click "([^"]*)"$/ */
public function iClick($element) {
if ($element = 2){
$output = 5
}
}
/** @When /^I press "([^"]*)"$/ */
public function iPress($button) {
if($button == $output){
echo "ok";
}
}
}