Merge pull request #135 from BiffBangPow/pulls/1.0-given-the-current-time-is-error

Corrected variable name in givenTheCurrentTimeIs to address error in v1.0
This commit is contained in:
Daniel Hensby 2016-12-12 13:43:26 +00:00 committed by GitHub
commit bca133254c

View File

@ -13,6 +13,7 @@ use Behat\Mink\Driver\GoutteDriver,
Behat\Mink\Exception\UnsupportedDriverActionException,
Behat\Mink\Exception\ElementNotFoundException;
use InvalidArgumentException;
use SilverStripe\BehatExtension\Context\SilverStripeAwareContextInterface;
use Symfony\Component\Yaml\Yaml;
@ -414,9 +415,9 @@ class SilverStripeContext extends MinkContext implements SilverStripeAwareContex
* @Given /^the current time is "([^"]*)"$/
*/
public function givenTheCurrentTimeIs($time) {
$newDatetime = \DateTime::createFromFormat('H:i:s', $date);
$newDatetime = \DateTime::createFromFormat('H:i:s', $time);
if(!$newDatetime) {
throw new InvalidArgumentException(sprintf('Invalid date format: %s (requires "H:i:s")', $date));
throw new InvalidArgumentException(sprintf('Invalid date format: %s (requires "H:i:s")', $time));
}
$state = $this->testSessionEnvironment->getState();