Exemplo n.º 1
0
 public function testGetAttributeInfoApi()
 {
     $attrs = $this->faker->word;
     $this->api->getAttributeInfo($attrs, [EntryType::ACCOUNT(), EntryType::ACL_TARGET()]);
     $client = $this->api->getClient();
     $req = $client->lastRequest();
     $xml = '<?xml version="1.0"?>' . "\n" . '<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:urn="urn:zimbra" xmlns:urn1="urn:zimbraAdmin">' . '<env:Body>' . '<urn1:GetAttributeInfoRequest attrs="' . $attrs . '" entryTypes="account,aclTarget" />' . '</env:Body>' . '</env:Envelope>';
     $this->assertXmlStringEqualsXmlString($xml, (string) $req);
 }
Exemplo n.º 2
0
 public function testEntryType()
 {
     $values = array('account', 'alias', 'distributionList', 'cos', 'globalConfig', 'domain', 'server', 'mimeEntry', 'zimletEntry', 'calendarResource', 'identity', 'dataSource', 'pop3DataSource', 'imapDataSource', 'rssDataSource', 'liveDataSource', 'galDataSource', 'signature', 'xmppComponent', 'aclTarget');
     foreach ($values as $value) {
         $this->assertTrue(\Zimbra\Enum\EntryType::has($value));
     }
 }
Exemplo n.º 3
0
 public function testGetAttributeInfo()
 {
     $attrs = self::randomName();
     $req = new \Zimbra\Admin\Request\GetAttributeInfo($attrs, [EntryType::ACCOUNT(), EntryType::ACL_TARGET()]);
     $this->assertInstanceOf('Zimbra\\Admin\\Request\\Base', $req);
     $this->assertSame($attrs, $req->getAttrs());
     $this->assertSame('account,aclTarget', $req->getEntryTypes());
     $req->setAttrs($attrs)->addEntryType(EntryType::ALIAS());
     $this->assertSame($attrs, $req->getAttrs());
     $this->assertSame('account,aclTarget,alias', $req->getEntryTypes());
     $xml = '<?xml version="1.0"?>' . "\n" . '<GetAttributeInfoRequest attrs="' . $attrs . '" entryTypes="account,aclTarget,alias" />';
     $this->assertXmlStringEqualsXmlString($xml, (string) $req);
     $array = ['GetAttributeInfoRequest' => ['_jsns' => 'urn:zimbraAdmin', 'attrs' => $attrs, 'entryTypes' => 'account,aclTarget,alias']];
     $this->assertEquals($array, $req->toArray());
 }