From a654ce56f62405245ec2c1b66eccacceedd1cada Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Tue, 12 Jul 2022 09:41:27 -0400 Subject: [PATCH] Add default value for agreedToTerms -- and fix values for the creationTime and lastLoginTime. --- SilMock/Google/Service/Directory/UsersResource.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/SilMock/Google/Service/Directory/UsersResource.php b/SilMock/Google/Service/Directory/UsersResource.php index fa2a398..832c80b 100644 --- a/SilMock/Google/Service/Directory/UsersResource.php +++ b/SilMock/Google/Service/Directory/UsersResource.php @@ -2,6 +2,7 @@ namespace SilMock\Google\Service\Directory; +use DateTime; use Google_Service_Directory_Alias as Alias; use Google_Service_Directory_Aliases; use SilMock\DataStore\Sqlite\SqliteUtils; @@ -154,14 +155,16 @@ protected function getAllDbUsers() */ public function insert($postBody) { + $currentDateTime = new DateTime('now'); $defaults = array( 'id' => str_replace(array(' ', '.'), '', microtime()), 'suspended' => false, 'changePasswordAtNextLogin' => false, 'isAdmin' => false, 'isDelegatedAdmin' => false, - 'lastLoginTime' => time(), - 'creationTime' => time(), + 'lastLoginTime' => $currentDateTime->format('c'), + 'creationTime' => $currentDateTime->format('c'), + 'agreedToTerms' => false, ); // array_merge will not work, since $postBody is an object which only