-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
37 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ class MembersTest extends TestCase | |
// GroupsTest and MembersTest need to share same DB, also | ||
// They are very dependent on order run. | ||
// groups.insert, groups.listGroups, members.insert, members.listMembers | ||
public $dataFile = DATAFILE5; | ||
public string $dataFile = DATAFILE5; | ||
|
||
public function testInsert() | ||
{ | ||
|
@@ -26,15 +26,32 @@ public function testInsert() | |
try { | ||
$addedMember = $mockGoogleServiceDirectory->members->insert($groupEmailAddress, $member); | ||
} catch (Exception $exception) { | ||
$this->assertFalse( | ||
true, | ||
self::fail( | ||
sprintf( | ||
'Was expecting the members.insert method to function, but got: %s', | ||
$exception->getMessage() | ||
) | ||
); | ||
} | ||
$this->assertTrue($addedMember instanceof GoogleDirectory_Member); | ||
self::assertTrue($addedMember instanceof GoogleDirectory_Member); | ||
} | ||
|
||
public function testHasMember() | ||
{ | ||
$groupEmailAddress = '[email protected]'; | ||
$mockGoogleServiceDirectory = new GoogleMock_Directory('anyclient', $this->dataFile); | ||
try { | ||
$result = $mockGoogleServiceDirectory->members->hasMember( | ||
$groupEmailAddress, | ||
'[email protected]' | ||
); | ||
$hasMember = $result['isMember'] ?? false; | ||
} catch (Exception $exception) { | ||
self::fail( | ||
$exception->getMessage() | ||
); | ||
} | ||
self::assertTrue($hasMember); | ||
} | ||
|
||
public function testListMembers() | ||
|
@@ -45,15 +62,14 @@ public function testListMembers() | |
try { | ||
$members = $mockGoogleServiceDirectory->members->listMembers($groupEmailAddress); | ||
} catch (Exception $exception) { | ||
$this->assertFalse( | ||
true, | ||
self::fail( | ||
sprintf( | ||
'Was expecting the members.list method to function, but got: %s', | ||
$exception->getMessage() | ||
) | ||
); | ||
} | ||
$this->assertNotEmpty( | ||
self::assertNotEmpty( | ||
$members, | ||
'Was expecting the members.list method to have at least one member.' | ||
); | ||
|