예제 #1
0
 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;
 }