Corrected variable name in givenTheCurrentTimeIs to address error

This commit is contained in:
William Arslett 2016-12-12 12:12:11 +00:00
parent 7205b83615
commit ad7957587e

View File

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