diff --git a/src/Context/LoginContext.php b/src/Context/LoginContext.php index dbed6446..085d6523 100644 --- a/src/Context/LoginContext.php +++ b/src/Context/LoginContext.php @@ -104,8 +104,8 @@ public function stepILogInWith($email, $password) if ($btn->getText() !== 'Setup later') { continue; } - // There's been issues clicking the button, so try waiting for a little bit - sleep(0.3); + // There's been issues clicking the button, so try waiting for 0.3 seconds + usleep(0.3 * 1000000); $btn->click(); $clicked = true; break; diff --git a/src/Context/SilverStripeContext.php b/src/Context/SilverStripeContext.php index 54f87987..197be81b 100644 --- a/src/Context/SilverStripeContext.php +++ b/src/Context/SilverStripeContext.php @@ -510,7 +510,7 @@ public function givenTheCurrentDateIs($date) } $state = $this->testSessionEnvironment->getState(); - $oldDatetime = \DateTime::createFromFormat('Y-m-d H:i:s', isset($state->datetime) ? $state->datetime : null); + $oldDatetime = \DateTime::createFromFormat('Y-m-d H:i:s', $state->datetime ?? ''); if ($oldDatetime) { $newDatetime->setTime($oldDatetime->format('H'), $oldDatetime->format('i'), $oldDatetime->format('s')); }