Merge pull request #216 from creative-commoners/pulls/4.9/int

FIX Use usleep for fractions of a second
This commit is contained in:
Guy Sartorelli 2022-07-25 16:04:22 +12:00 committed by GitHub
commit 7bb03997cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -104,8 +104,8 @@ class LoginContext implements Context
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;

View File

@ -510,7 +510,7 @@ abstract class SilverStripeContext extends MinkContext implements SilverStripeAw
}
$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'));
}