Skip to content

Commit

Permalink
Add in tests for Directory
Browse files Browse the repository at this point in the history
  • Loading branch information
mtompset committed Jun 19, 2024
1 parent 476dd62 commit 3982e46
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions SilMock/tests/Google/Service/DirectoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

namespace SilMock\tests\Google\Service;

use Google\Client;
use Google\Service\Directory\Alias as Google_Service_Directory_Alias;
use Google\Service\Directory\User as Google_Service_Directory_User;
use PHPUnit\Framework\Assert;
use PHPUnit\Framework\TestCase;
use Google_Service_Directory_Alias;
use Google_Service_Directory_User;
use SilMock\Google\Http\Batch;
use SilMock\Google\Service\Directory;
use SilMock\Google\Service\Directory\ObjectUtils;
use SilMock\DataStore\Sqlite\SqliteUtils;
Expand Down Expand Up @@ -43,6 +46,12 @@ public function getProperties($object, $propKeys = null): array
return $outArray;
}

public function testCreateBatch()
{
$batch = new Batch();
self::assertInstanceOf(Batch::class, $batch);
}

public function testDirectory()
{
$expectedKeys = [
Expand All @@ -54,7 +63,7 @@ public function testDirectory()
];
$errorMessage = " *** Directory was not initialized properly";

$directory = new Directory('whatever', $this->dataFile);
$directory = new Directory('anyclient', $this->dataFile);

$directoryAsJson = json_encode($directory);
$directoryInfo = json_decode($directoryAsJson, true);
Expand All @@ -64,6 +73,13 @@ public function testDirectory()
}
}

public function testGetClient()
{
$dir = new Directory('anyclient', $this->dataFile);
$client = $dir->getClient();
Assert::assertInstanceOf(Client::class, $client);
}

public function testUsersInsert()
{
$newUser = $this->setupSampleUser($this->dataFile);
Expand Down

0 comments on commit 3982e46

Please sign in to comment.