public function testCanCreateGroupGrantee() { $grantee = new Grantee(Group::ALL_USERS); $this->assertEquals(Group::ALL_USERS, $grantee->getId()); $this->assertEquals(Group::ALL_USERS, $grantee->getGroupUri()); $this->assertNull($grantee->getDisplayName()); $this->assertFalse($grantee->isCanonicalUser()); $this->assertFalse($grantee->isAmazonCustomerByEmail()); $this->assertTrue($grantee->isGroup()); $this->assertEquals(GranteeType::GROUP, $grantee->getType()); }
/** * Set the owner of the ACP policy * * @param Grantee $owner ACP policy owner * * @return $this * * @throws InvalidArgumentException if the grantee does not have an ID set */ public function setOwner(Grantee $owner) { if (!$owner->isCanonicalUser()) { throw new InvalidArgumentException('The owner must have an ID set.'); } $this->owner = $owner; return $this; }