コード例 #1
0
ファイル: GranteeTest.php プロジェクト: njbhatt18/Amazon_API
 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());
 }
コード例 #2
0
ファイル: Acp.php プロジェクト: loulancn/core
 /**
  * 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;
 }