diff --git a/SilMock/Google/Service/Directory.php b/SilMock/Google/Service/Directory.php index 5690494..9e55aa7 100644 --- a/SilMock/Google/Service/Directory.php +++ b/SilMock/Google/Service/Directory.php @@ -7,6 +7,7 @@ use SilMock\Google\Service\Directory\UsersResource; use SilMock\Google\Service\Directory\UsersAliasesResource; use SilMock\Google\Service\Directory\VerificationCodesResource; +use SilMock\Google\Service\Directory\Resource\TwoStepVerification; class Directory { @@ -15,6 +16,7 @@ class Directory public $users; public $users_aliases; public $verificationCodes; + public $twoStepVerification; /** * Sets the users and users_aliases properties to be instances of @@ -30,5 +32,6 @@ public function __construct($client, $dbFile = null) $this->users = new UsersResource($dbFile); $this->users_aliases = new UsersAliasesResource($dbFile); $this->verificationCodes = new VerificationCodesResource($dbFile); + $this->twoStepVerification = new TwoStepVerification($dbFile); } } diff --git a/SilMock/Google/Service/Directory/Resource/TwoStepVerification.php b/SilMock/Google/Service/Directory/Resource/TwoStepVerification.php new file mode 100644 index 0000000..af6b56e --- /dev/null +++ b/SilMock/Google/Service/Directory/Resource/TwoStepVerification.php @@ -0,0 +1,43 @@ +getSqliteUtils(); + $twoStepVerificationRecord = $sqliteUtils->getAllRecordsByDataKey( + $this->dataType, + $this->dataClass, + 'twoStepVerification', + $userKey + ); + // Update it + $twoStepVerificationRecord['onOrOff'] = 'off'; + // Get the record id and update it, as needed. + $recordId = $twoStepVerificationRecord['id'] ?? null; + // If there was a recordId, then it probably would be functional + // However, we just need this method to exist, not actually work + if (! empty($recordId)) { + $sqliteUtils->updateRecordById($recordId, json_encode($twoStepVerificationRecord)); + } + } +} \ No newline at end of file diff --git a/SilMock/tests/Google/Service/Directory/Resource/TwoStepVerificationTest.php b/SilMock/tests/Google/Service/Directory/Resource/TwoStepVerificationTest.php new file mode 100644 index 0000000..06ef14e --- /dev/null +++ b/SilMock/tests/Google/Service/Directory/Resource/TwoStepVerificationTest.php @@ -0,0 +1,30 @@ +dataFile); + $this->assertIsObject($twoStepVerfication, 'Unable to instantiate twoStepVerification Mock object'); + + try { + $twoStepVerfication->turnOff('dummy@example.org'); + } catch (Exception $exception) { + $this->assertFalse( + true, + sprintf( + 'Was expecting the turnOff method to function, but got: %s', + $exception->getMessage() + ) + ); + } + } +} diff --git a/composer.json b/composer.json index d5f1e71..a83ada3 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "ext-mbstring": "*", "ext-pdo": "*", "google/apiclient": "^v2.15.0", - "google/apiclient-services": "^v0.308.0" + "google/apiclient-services": "^v0.312.0" }, "require-dev": { "phpunit/phpunit": "^9.0", diff --git a/composer.lock b/composer.lock index 5993e4f..712edb8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0135ffbfbed3d72a3d3271e1d99f6add", + "content-hash": "a79c34fc19f24150faf0f514f23a5274", "packages": [ { "name": "firebase/php-jwt", - "version": "v6.8.0", + "version": "v6.8.1", "source": { "type": "git", "url": "https://github.com/firebase/php-jwt.git", - "reference": "48b0210c51718d682e53210c24d25c5a10a2299b" + "reference": "5dbc8959427416b8ee09a100d7a8588c00fb2e26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/firebase/php-jwt/zipball/48b0210c51718d682e53210c24d25c5a10a2299b", - "reference": "48b0210c51718d682e53210c24d25c5a10a2299b", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/5dbc8959427416b8ee09a100d7a8588c00fb2e26", + "reference": "5dbc8959427416b8ee09a100d7a8588c00fb2e26", "shasum": "" }, "require": { @@ -65,9 +65,9 @@ ], "support": { "issues": "https://github.com/firebase/php-jwt/issues", - "source": "https://github.com/firebase/php-jwt/tree/v6.8.0" + "source": "https://github.com/firebase/php-jwt/tree/v6.8.1" }, - "time": "2023-06-20T16:45:35+00:00" + "time": "2023-07-14T18:33:00+00:00" }, { "name": "google/apiclient", @@ -140,16 +140,16 @@ }, { "name": "google/apiclient-services", - "version": "v0.308.0", + "version": "v0.312.0", "source": { "type": "git", "url": "https://github.com/googleapis/google-api-php-client-services.git", - "reference": "85cf00383e6bf6eca131bd3261b7859ea418a578" + "reference": "45d47fed73b28254c511882bc743b1690a99558d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/85cf00383e6bf6eca131bd3261b7859ea418a578", - "reference": "85cf00383e6bf6eca131bd3261b7859ea418a578", + "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/45d47fed73b28254c511882bc743b1690a99558d", + "reference": "45d47fed73b28254c511882bc743b1690a99558d", "shasum": "" }, "require": { @@ -178,9 +178,9 @@ ], "support": { "issues": "https://github.com/googleapis/google-api-php-client-services/issues", - "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.308.0" + "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.312.0" }, - "time": "2023-07-09T01:06:13+00:00" + "time": "2023-08-14T00:56:12+00:00" }, { "name": "google/auth", @@ -368,16 +368,16 @@ }, { "name": "guzzlehttp/promises", - "version": "2.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "3a494dc7dc1d7d12e511890177ae2d0e6c107da6" + "reference": "111166291a0f8130081195ac4556a5587d7f1b5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/3a494dc7dc1d7d12e511890177ae2d0e6c107da6", - "reference": "3a494dc7dc1d7d12e511890177ae2d0e6c107da6", + "url": "https://api.github.com/repos/guzzle/promises/zipball/111166291a0f8130081195ac4556a5587d7f1b5d", + "reference": "111166291a0f8130081195ac4556a5587d7f1b5d", "shasum": "" }, "require": { @@ -431,7 +431,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.0.0" + "source": "https://github.com/guzzle/promises/tree/2.0.1" }, "funding": [ { @@ -447,20 +447,20 @@ "type": "tidelift" } ], - "time": "2023-05-21T13:50:22+00:00" + "time": "2023-08-03T15:11:55+00:00" }, { "name": "guzzlehttp/psr7", - "version": "2.5.0", + "version": "2.6.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "b635f279edd83fc275f822a1188157ffea568ff6" + "reference": "8bd7c33a0734ae1c5d074360512beb716bef3f77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/b635f279edd83fc275f822a1188157ffea568ff6", - "reference": "b635f279edd83fc275f822a1188157ffea568ff6", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/8bd7c33a0734ae1c5d074360512beb716bef3f77", + "reference": "8bd7c33a0734ae1c5d074360512beb716bef3f77", "shasum": "" }, "require": { @@ -547,7 +547,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.5.0" + "source": "https://github.com/guzzle/psr7/tree/2.6.0" }, "funding": [ { @@ -563,7 +563,7 @@ "type": "tidelift" } ], - "time": "2023-04-17T16:11:26+00:00" + "time": "2023-08-03T15:06:02+00:00" }, { "name": "monolog/monolog", @@ -1397,16 +1397,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.16.0", + "version": "v4.17.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "19526a33fb561ef417e822e85f08a00db4059c17" + "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/19526a33fb561ef417e822e85f08a00db4059c17", - "reference": "19526a33fb561ef417e822e85f08a00db4059c17", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", + "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", "shasum": "" }, "require": { @@ -1447,9 +1447,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.16.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.17.1" }, - "time": "2023-06-25T14:52:30+00:00" + "time": "2023-08-13T19:53:39+00:00" }, { "name": "phar-io/manifest", @@ -1564,16 +1564,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.26", + "version": "9.2.27", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1" + "reference": "b0a88255cb70d52653d80c890bd7f38740ea50d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", - "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/b0a88255cb70d52653d80c890bd7f38740ea50d1", + "reference": "b0a88255cb70d52653d80c890bd7f38740ea50d1", "shasum": "" }, "require": { @@ -1629,7 +1629,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.26" + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.27" }, "funding": [ { @@ -1637,7 +1638,7 @@ "type": "github" } ], - "time": "2023-03-06T12:58:08+00:00" + "time": "2023-07-26T13:44:30+00:00" }, { "name": "phpunit/php-file-iterator", @@ -2489,16 +2490,16 @@ }, { "name": "sebastian/global-state", - "version": "5.0.5", + "version": "5.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" + "reference": "bde739e7565280bda77be70044ac1047bc007e34" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bde739e7565280bda77be70044ac1047bc007e34", + "reference": "bde739e7565280bda77be70044ac1047bc007e34", "shasum": "" }, "require": { @@ -2541,7 +2542,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.6" }, "funding": [ { @@ -2549,7 +2550,7 @@ "type": "github" } ], - "time": "2022-02-14T08:28:10+00:00" + "time": "2023-08-02T09:26:13+00:00" }, { "name": "sebastian/lines-of-code",