Merge pull request #26 from srizzling/master

Added a step for creating a breakpoint
This commit is contained in:
Ingo Schommer 2014-02-12 15:38:01 +13:00
commit b0af00bf9d
1 changed files with 14 additions and 0 deletions

View File

@ -421,6 +421,20 @@ JS;
}
}
/**
* Pauses the scenario until the user presses a key. Useful when debugging a scenario.
*
* @Then /^(?:|I )put a breakpoint$/
*/
public function iPutABreakpoint()
{
fwrite(STDOUT, "\033[s \033[93m[Breakpoint] Press \033[1;93m[RETURN]\033[0;93m to continue...\033[0m");
while (fgets(STDIN, 1024) == '') {}
fwrite(STDOUT, "\033[u");
return;
}
/**
* Transforms relative time statements compatible with strtotime().
* Example: "time of 1 hour ago" might return "22:00:00" if its currently "23:00:00".