Skip to content

Commit

Permalink
FIX Use usleep for fractions of a second
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Jul 25, 2022
1 parent 754b5e0 commit c460781
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Context/LoginContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Context/SilverStripeContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}
Expand Down

0 comments on commit c460781

Please sign in to comment.