コード例 #1
0
ファイル: AclTest.php プロジェクト: pfeyssaguet/guzzle-aws
 /**
  * @covers Guzzle\Aws\S3\Model\Acl::__construct
  */
 public function testCanBuildFromExisting()
 {
     $xml = new \SimpleXMLElement('<AccessControlPolicy><Owner><ID>test_id</ID><DisplayName>Bob</DisplayName></Owner><AccessControlList><Grant><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group"><URI>http://acs.amazonaws.com/groups/global/AuthenticatedUsers</URI></Grantee><Permission>FULL_CONTROL</Permission></Grant></AccessControlList></AccessControlPolicy>');
     $acl = new Acl($xml);
     $this->assertEquals('Bob', $acl->getOwnerDisplayName());
     $this->assertEquals('test_id', $acl->getOwnerId());
     $this->assertTrue($acl->getGrantList()->hasGrant('Group', \Guzzle\Aws\S3\S3Client::GRANT_AUTH, \Guzzle\Aws\S3\S3Client::GRANT_FULL_CONTROL));
 }