Example #1
0
 public function testCancelTaskApi()
 {
     $id = $this->faker->uuid;
     $stdoff = mt_rand(1, 10);
     $dayoff = mt_rand(1, 10);
     $timezone = new CalTZInfo($id, $stdoff, $dayoff);
     $range = $this->faker->word;
     $date = $this->faker->iso8601;
     $tz = $this->faker->word;
     $inst = new InstanceRecurIdInfo($range, $date, $tz);
     $content = $this->faker->word;
     $fr = $this->faker->word;
     $aid = $this->faker->uuid;
     $origid = $this->faker->uuid;
     $idnt = $this->faker->word;
     $su = $this->faker->word;
     $irt = $this->faker->word;
     $l = $this->faker->word;
     $f = $this->faker->word;
     $m = new Msg($content, NULL, NULL, NULL, $fr, $aid, $origid, ReplyType::REPLIED(), $idnt, $su, $irt, $l, $f);
     $comp = mt_rand(1, 10);
     $ms = mt_rand(1, 10);
     $rev = mt_rand(1, 10);
     $this->api->cancelTask($inst, $timezone, $m, $id, $comp, $ms, $rev);
     $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:zimbraMail">' . '<env:Body>' . '<urn1:CancelTaskRequest id="' . $id . '" comp="' . $comp . '" ms="' . $ms . '" rev="' . $rev . '">' . '<urn1:inst range="' . $range . '" d="' . $date . '" tz="' . $tz . '" />' . '<urn1:tz id="' . $id . '" stdoff="' . $stdoff . '" dayoff="' . $dayoff . '" />' . '<urn1:m aid="' . $aid . '" origid="' . $origid . '" rt="' . ReplyType::REPLIED() . '" idnt="' . $idnt . '" su="' . $su . '" irt="' . $irt . '" l="' . $l . '" f="' . $f . '">' . '<urn1:content>' . $content . '</urn1:content>' . '<urn1:fr>' . $fr . '</urn1:fr>' . '</urn1:m>' . '</urn1:CancelTaskRequest>' . '</env:Body>' . '</env:Envelope>';
     $this->assertXmlStringEqualsXmlString($xml, (string) $req);
 }
 public function testForwardAppointmentApi()
 {
     $date = $this->faker->iso8601;
     $tz = $this->faker->word;
     $utc = mt_rand(0, 24);
     $exceptId = new DtTimeInfo($date, $tz, $utc);
     $id = $this->faker->uuid;
     $stdoff = mt_rand(1, 10);
     $dayoff = mt_rand(1, 10);
     $timezone = new CalTZInfo($id, $stdoff, $dayoff);
     $content = $this->faker->word;
     $fr = $this->faker->word;
     $aid = $this->faker->uuid;
     $origid = $this->faker->uuid;
     $idnt = $this->faker->word;
     $su = $this->faker->word;
     $irt = $this->faker->word;
     $l = $this->faker->word;
     $f = $this->faker->word;
     $m = new Msg($content, NULL, NULL, NULL, $fr, $aid, $origid, ReplyType::REPLIED(), $idnt, $su, $irt, $l, $f);
     $this->api->forwardAppointment($id, $exceptId, $timezone, $m);
     $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:zimbraMail">' . '<env:Body>' . '<urn1:ForwardAppointmentRequest id="' . $id . '">' . '<urn1:exceptId d="' . $date . '" tz="' . $tz . '" u="' . $utc . '" />' . '<urn1:tz id="' . $id . '" stdoff="' . $stdoff . '" dayoff="' . $dayoff . '" />' . '<urn1:m aid="' . $aid . '" origid="' . $origid . '" rt="' . ReplyType::REPLIED() . '" idnt="' . $idnt . '" su="' . $su . '" irt="' . $irt . '" l="' . $l . '" f="' . $f . '">' . '<urn1:content>' . $content . '</urn1:content>' . '<urn1:fr>' . $fr . '</urn1:fr>' . '</urn1:m>' . '</urn1:ForwardAppointmentRequest>' . '</env:Body>' . '</env:Envelope>';
     $this->assertXmlStringEqualsXmlString($xml, (string) $req);
 }
Example #3
0
 public function testMsgToSend()
 {
     $mid = $this->faker->uuid;
     $part = $this->faker->word;
     $id = $this->faker->uuid;
     $path = $this->faker->word;
     $ct = $this->faker->word;
     $content = $this->faker->word;
     $ci = $this->faker->uuid;
     $name = $this->faker->word;
     $value = $this->faker->word;
     $aid = $this->faker->uuid;
     $method = $this->faker->word;
     $address = $this->faker->word;
     $personal = $this->faker->word;
     $stdname = $this->faker->word;
     $dayname = $this->faker->word;
     $fr = $this->faker->word;
     $did = $this->faker->word;
     $origid = $this->faker->uuid;
     $idnt = $this->faker->word;
     $su = $this->faker->word;
     $irt = $this->faker->word;
     $l = $this->faker->word;
     $f = $this->faker->word;
     $compNum = mt_rand(1, 100);
     $ver = mt_rand(1, 100);
     $mon = mt_rand(1, 12);
     $hour = mt_rand(0, 23);
     $min = mt_rand(0, 59);
     $sec = mt_rand(0, 59);
     $stdoff = mt_rand(1, 10);
     $dayoff = mt_rand(1, 10);
     $mp = new \Zimbra\Mail\Struct\MimePartAttachSpec($mid, $part, true);
     $m = new \Zimbra\Mail\Struct\MsgAttachSpec($id, false);
     $cn = new \Zimbra\Mail\Struct\ContactAttachSpec($id, false);
     $doc = new \Zimbra\Mail\Struct\DocAttachSpec($path, $id, $ver, true);
     $info = new \Zimbra\Mail\Struct\MimePartInfo(null, $ct, $content, $ci);
     $standard = new \Zimbra\Struct\TzOnsetInfo($mon, $hour, $min, $sec);
     $daylight = new \Zimbra\Struct\TzOnsetInfo($mon, $hour, $min, $sec);
     $header = new \Zimbra\Mail\Struct\Header($name, $value);
     $attach = new \Zimbra\Mail\Struct\AttachmentsInfo($aid, [$mp, $m, $cn, $doc]);
     $mp = new \Zimbra\Mail\Struct\MimePartInfo($attach, $ct, $content, $ci, [$info]);
     $inv = new \Zimbra\Mail\Struct\InvitationInfo($method, $compNum, true);
     $e = new \Zimbra\Mail\Struct\EmailAddrInfo($address, AddressType::FROM(), $personal);
     $tz = new \Zimbra\Mail\Struct\CalTZInfo($id, $stdoff, $dayoff, $standard, $daylight, $stdname, $dayname);
     $any = $this->getMockForAbstractClass('Zimbra\\Struct\\Base');
     $m = new MsgToSend($content, $mp, $attach, $inv, $fr, $did, false, $aid, $origid, ReplyType::REPLIED(), $idnt, $su, $irt, $l, $f, [$header], [$e], [$tz], [$any]);
     $this->assertInstanceOf('Zimbra\\Mail\\Struct\\Msg', $m);
     $this->assertSame($did, $m->getDraftId());
     $this->assertFalse($m->getSendFromDraft());
     $m->setDraftId($did)->setSendFromDraft(true);
     $this->assertSame($did, $m->getDraftId());
     $this->assertTrue($m->getSendFromDraft());
     $xml = '<?xml version="1.0"?>' . "\n" . '<m did="' . $did . '" sfd="true" aid="' . $aid . '" origid="' . $origid . '" rt="' . ReplyType::REPLIED() . '" idnt="' . $idnt . '" su="' . $su . '" irt="' . $irt . '" l="' . $l . '" f="' . $f . '">' . '<content>' . $content . '</content>' . '<mp ct="' . $ct . '" content="' . $content . '" ci="' . $ci . '">' . '<attach aid="' . $aid . '">' . '<mp optional="true" mid="' . $mid . '" part="' . $part . '" />' . '<m optional="false" id="' . $id . '" />' . '<cn optional="false" id="' . $id . '" />' . '<doc optional="true" path="' . $path . '" id="' . $id . '" ver="' . $ver . '" />' . '</attach>' . '<mp ct="' . $ct . '" content="' . $content . '" ci="' . $ci . '" />' . '</mp>' . '<attach aid="' . $aid . '">' . '<mp optional="true" mid="' . $mid . '" part="' . $part . '" />' . '<m optional="false" id="' . $id . '" />' . '<cn optional="false" id="' . $id . '" />' . '<doc optional="true" path="' . $path . '" id="' . $id . '" ver="' . $ver . '" />' . '</attach>' . '<inv method="' . $method . '" compNum="' . $compNum . '" rsvp="true" />' . '<fr>' . $fr . '</fr>' . '<header name="' . $name . '">' . $value . '</header>' . '<e a="' . $address . '" t="' . AddressType::FROM() . '" p="' . $personal . '" />' . '<tz id="' . $id . '" stdoff="' . $stdoff . '" dayoff="' . $dayoff . '" stdname="' . $stdname . '" dayname="' . $dayname . '">' . '<standard mon="' . $mon . '" hour="' . $hour . '" min="' . $min . '" sec="' . $sec . '" />' . '<daylight mon="' . $mon . '" hour="' . $hour . '" min="' . $min . '" sec="' . $sec . '" />' . '</tz>' . '<any />' . '</m>';
     $this->assertXmlStringEqualsXmlString($xml, (string) $m);
     $array = array('m' => array('did' => $did, 'sfd' => true, 'aid' => $aid, 'origid' => $origid, 'rt' => ReplyType::REPLIED()->value(), 'idnt' => $idnt, 'su' => $su, 'irt' => $irt, 'l' => $l, 'f' => $f, 'content' => $content, 'fr' => $fr, 'header' => array(array('name' => $name, '_content' => $value)), 'mp' => array('ct' => $ct, 'content' => $content, 'ci' => $ci, 'mp' => array(array('ct' => $ct, 'content' => $content, 'ci' => $ci)), 'attach' => array('aid' => $aid, 'mp' => array('mid' => $mid, 'part' => $part, 'optional' => true), 'm' => array('id' => $id, 'optional' => false), 'cn' => array('id' => $id, 'optional' => false), 'doc' => array('path' => $path, 'id' => $id, 'ver' => $ver, 'optional' => true))), 'attach' => array('aid' => $aid, 'mp' => array('mid' => $mid, 'part' => $part, 'optional' => true), 'm' => array('id' => $id, 'optional' => false), 'cn' => array('id' => $id, 'optional' => false), 'doc' => array('path' => $path, 'id' => $id, 'ver' => $ver, 'optional' => true)), 'inv' => array('method' => $method, 'compNum' => $compNum, 'rsvp' => true), 'e' => array(array('a' => $address, 't' => AddressType::FROM()->value(), 'p' => $personal)), 'tz' => array(array('id' => $id, 'stdoff' => $stdoff, 'dayoff' => $dayoff, 'stdname' => $stdname, 'dayname' => $dayname, 'standard' => array('mon' => $mon, 'hour' => $hour, 'min' => $min, 'sec' => $sec), 'daylight' => array('mon' => $mon, 'hour' => $hour, 'min' => $min, 'sec' => $sec))), 'any' => [[]]));
     $this->assertEquals($array, $m->toArray());
 }
 public function testAddAppointmentInviteApi()
 {
     $content = $this->faker->word;
     $fr = $this->faker->word;
     $aid = $this->faker->uuid;
     $origid = $this->faker->uuid;
     $idnt = $this->faker->word;
     $su = $this->faker->word;
     $irt = $this->faker->word;
     $l = $this->faker->word;
     $f = $this->faker->word;
     $m = new Msg($content, NULL, NULL, NULL, $fr, $aid, $origid, ReplyType::REPLIED(), $idnt, $su, $irt, $l, $f);
     $this->api->addAppointmentInvite($m, ParticipationStatus::NEEDS_ACTION());
     $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:zimbraMail">' . '<env:Body>' . '<urn1:AddAppointmentInviteRequest ptst="' . ParticipationStatus::NEEDS_ACTION() . '">' . '<urn1:m aid="' . $aid . '" origid="' . $origid . '" rt="' . ReplyType::REPLIED() . '" idnt="' . $idnt . '" su="' . $su . '" irt="' . $irt . '" l="' . $l . '" f="' . $f . '">' . '<urn1:content>' . $content . '</urn1:content>' . '<urn1:fr>' . $fr . '</urn1:fr>' . '</urn1:m>' . '</urn1:AddAppointmentInviteRequest>' . '</env:Body>' . '</env:Envelope>';
     $this->assertXmlStringEqualsXmlString($xml, (string) $req);
 }
Example #5
0
 public function testCreateTaskApi()
 {
     $max = mt_rand(1, 10);
     $content = $this->faker->word;
     $fr = $this->faker->word;
     $aid = $this->faker->uuid;
     $origid = $this->faker->uuid;
     $idnt = $this->faker->word;
     $su = $this->faker->word;
     $irt = $this->faker->word;
     $l = $this->faker->word;
     $f = $this->faker->word;
     $m = new Msg($content, NULL, NULL, NULL, $fr, $aid, $origid, ReplyType::REPLIED(), $idnt, $su, $irt, $l, $f);
     $this->api->createTask($m, true, $max, true, true, true);
     $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:zimbraMail">' . '<env:Body>' . '<urn1:CreateTaskRequest echo="true" max="' . $max . '" html="true" neuter="true" forcesend="true">' . '<urn1:m aid="' . $aid . '" origid="' . $origid . '" rt="' . ReplyType::REPLIED() . '" idnt="' . $idnt . '" su="' . $su . '" irt="' . $irt . '" l="' . $l . '" f="' . $f . '">' . '<urn1:content>' . $content . '</urn1:content>' . '<urn1:fr>' . $fr . '</urn1:fr>' . '</urn1:m>' . '</urn1:CreateTaskRequest>' . '</env:Body>' . '</env:Envelope>';
     $this->assertXmlStringEqualsXmlString($xml, (string) $req);
 }
Example #6
0
 public function testSendMsgApi()
 {
     $suid = $this->faker->uuid;
     $content = $this->faker->word;
     $fr = $this->faker->word;
     $did = $this->faker->word;
     $aid = $this->faker->uuid;
     $origid = $this->faker->uuid;
     $idnt = $this->faker->word;
     $su = $this->faker->word;
     $irt = $this->faker->word;
     $l = $this->faker->word;
     $f = $this->faker->word;
     $m = new MsgToSend($content, NULL, NULL, NULL, $fr, $did, true, $aid, $origid, ReplyType::REPLIED(), $idnt, $su, $irt, $l, $f);
     $this->api->sendMsg($m, true, true, true, $suid);
     $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:zimbraMail">' . '<env:Body>' . '<urn1:SendMsgRequest needCalendarSentByFixup="true" isCalendarForward="true" noSave="true" suid="' . $suid . '">' . '<urn1:m did="' . $did . '" sfd="true" aid="' . $aid . '" origid="' . $origid . '" rt="' . ReplyType::REPLIED() . '" idnt="' . $idnt . '" su="' . $su . '" irt="' . $irt . '" l="' . $l . '" f="' . $f . '">' . '<urn1:content>' . $content . '</urn1:content>' . '<urn1:fr>' . $fr . '</urn1:fr>' . '</urn1:m>' . '</urn1:SendMsgRequest>' . '</env:Body>' . '</env:Envelope>';
     $this->assertXmlStringEqualsXmlString($xml, (string) $req);
 }
 public function testCalItemRequestBaseRequest()
 {
     $max = mt_rand(1, 10);
     $content = $this->faker->word;
     $fr = $this->faker->word;
     $aid = $this->faker->uuid;
     $origid = $this->faker->uuid;
     $idnt = $this->faker->word;
     $su = $this->faker->word;
     $irt = $this->faker->word;
     $l = $this->faker->word;
     $f = $this->faker->word;
     $m = new Msg($content, NULL, NULL, NULL, $fr, $aid, $origid, ReplyType::REPLIED(), $idnt, $su, $irt, $l, $f);
     $req = $this->getMockForAbstractClass('\\Zimbra\\Mail\\Request\\CalItemRequestBase');
     $req->setMsg($m)->setEcho(true)->setMaxSize($max)->setWantHtml(true)->setNeuter(true)->setForceSend(true);
     $this->assertSame($m, $req->getMsg());
     $this->assertTrue($req->getEcho());
     $this->assertSame($max, $req->getMaxSize());
     $this->assertTrue($req->getWantHtml());
     $this->assertTrue($req->getNeuter());
     $this->assertTrue($req->getForceSend());
 }
 public function testCounterAppointmentApi()
 {
     $id = $this->faker->uuid;
     $comp = mt_rand(1, 10);
     $ms = mt_rand(1, 10);
     $rev = mt_rand(1, 10);
     $content = $this->faker->word;
     $fr = $this->faker->word;
     $aid = $this->faker->uuid;
     $origid = $this->faker->uuid;
     $idnt = $this->faker->word;
     $su = $this->faker->word;
     $irt = $this->faker->word;
     $l = $this->faker->word;
     $f = $this->faker->word;
     $m = new Msg($content, NULL, NULL, NULL, $fr, $aid, $origid, ReplyType::REPLIED(), $idnt, $su, $irt, $l, $f);
     $this->api->counterAppointment($m, $id, $comp, $ms, $rev);
     $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:zimbraMail">' . '<env:Body>' . '<urn1:CounterAppointmentRequest id="' . $id . '" comp="' . $comp . '" ms="' . $ms . '" rev="' . $rev . '">' . '<urn1:m aid="' . $aid . '" origid="' . $origid . '" rt="' . ReplyType::REPLIED() . '" idnt="' . $idnt . '" su="' . $su . '" irt="' . $irt . '" l="' . $l . '" f="' . $f . '">' . '<urn1:content>' . $content . '</urn1:content>' . '<urn1:fr>' . $fr . '</urn1:fr>' . '</urn1:m>' . '</urn1:CounterAppointmentRequest>' . '</env:Body>' . '</env:Envelope>';
     $this->assertXmlStringEqualsXmlString($xml, (string) $req);
 }
Example #9
0
 public function testSetAppointmentApi()
 {
     $content = $this->faker->word;
     $fr = $this->faker->word;
     $aid = $this->faker->uuid;
     $origid = $this->faker->uuid;
     $idnt = $this->faker->word;
     $su = $this->faker->word;
     $irt = $this->faker->word;
     $l = $this->faker->word;
     $f = $this->faker->word;
     $attendee = $this->faker->word;
     $sequence = mt_rand(1, 100);
     $date = mt_rand(1, 100);
     $rangeType = mt_rand(1, 100);
     $recurId = $this->faker->iso8601;
     $sentBy = $this->faker->word;
     $tz = $this->faker->word;
     $ridZ = $this->faker->iso8601;
     $t = $this->faker->word;
     $tn = $this->faker->word;
     $l = $this->faker->word;
     $nextAlarm = mt_rand(1, 10);
     $m = new Msg($content, NULL, NULL, NULL, $fr, $aid, $origid, ReplyType::REPLIED(), $idnt, $su, $irt, $l, $f);
     $default = new SetCalendarItemInfo($m, ParticipationStatus::NEEDS_ACTION());
     $except = new SetCalendarItemInfo();
     $cancel = new SetCalendarItemInfo();
     $reply = new CalReply($attendee, $sequence, $date, $rangeType, $recurId, $sentBy, ParticipationStatus::NEEDS_ACTION(), $tz, $ridZ);
     $replies = new Replies([$reply]);
     $this->api->setAppointment($f, $t, $tn, $l, true, $nextAlarm, $default, [$except], [$cancel], $replies);
     $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:zimbraMail">' . '<env:Body>' . '<urn1:SetAppointmentRequest f="' . $f . '" t="' . $t . '" tn="' . $tn . '" l="' . $l . '" noNextAlarm="true" nextAlarm="' . $nextAlarm . '">' . '<urn1:default ptst="' . ParticipationStatus::NEEDS_ACTION() . '">' . '<urn1:m aid="' . $aid . '" origid="' . $origid . '" rt="' . ReplyType::REPLIED() . '" idnt="' . $idnt . '" su="' . $su . '" irt="' . $irt . '" l="' . $l . '" f="' . $f . '">' . '<urn1:content>' . $content . '</urn1:content>' . '<urn1:fr>' . $fr . '</urn1:fr>' . '</urn1:m>' . '</urn1:default>' . '<urn1:replies>' . '<urn1:reply at="' . $attendee . '" seq="' . $sequence . '" d="' . $date . '" sentBy="' . $sentBy . '" ptst="' . ParticipationStatus::NEEDS_ACTION() . '" rangeType="' . $rangeType . '" recurId="' . $recurId . '" tz="' . $tz . '" ridZ="' . $ridZ . '" />' . '</urn1:replies>' . '<urn1:except />' . '<urn1:cancel />' . '</urn1:SetAppointmentRequest>' . '</env:Body>' . '</env:Envelope>';
     $this->assertXmlStringEqualsXmlString($xml, (string) $req);
 }
Example #10
0
 public function testSaveDraftApi()
 {
     $mid = $this->faker->uuid;
     $part = $this->faker->word;
     $id = $this->faker->uuid;
     $path = $this->faker->word;
     $ct = $this->faker->word;
     $content = $this->faker->word;
     $ci = $this->faker->uuid;
     $name = $this->faker->word;
     $value = $this->faker->word;
     $aid = $this->faker->uuid;
     $method = $this->faker->word;
     $address = $this->faker->word;
     $personal = $this->faker->word;
     $stdname = $this->faker->word;
     $dayname = $this->faker->word;
     $fr = $this->faker->word;
     $did = $this->faker->word;
     $origid = $this->faker->uuid;
     $idnt = $this->faker->word;
     $su = $this->faker->word;
     $irt = $this->faker->word;
     $l = $this->faker->word;
     $f = $this->faker->word;
     $t = $this->faker->word;
     $tn = $this->faker->word;
     $forAcct = $this->faker->word;
     $rgb = $this->faker->hexcolor;
     $msg_id = mt_rand(1, 10);
     $compNum = mt_rand(1, 100);
     $ver = mt_rand(1, 100);
     $mon = mt_rand(1, 12);
     $hour = mt_rand(0, 23);
     $min = mt_rand(0, 59);
     $sec = mt_rand(0, 59);
     $stdoff = mt_rand(1, 10);
     $dayoff = mt_rand(1, 10);
     $color = mt_rand(1, 128);
     $autoSendTime = mt_rand(1, 100);
     $mp = new \Zimbra\Mail\Struct\MimePartAttachSpec($mid, $part, true);
     $m = new \Zimbra\Mail\Struct\MsgAttachSpec($id, false);
     $cn = new \Zimbra\Mail\Struct\ContactAttachSpec($id, false);
     $doc = new \Zimbra\Mail\Struct\DocAttachSpec($path, $id, $ver, true);
     $info = new \Zimbra\Mail\Struct\MimePartInfo(null, $ct, $content, $ci);
     $standard = new \Zimbra\Struct\TzOnsetInfo($mon, $hour, $min, $sec);
     $daylight = new \Zimbra\Struct\TzOnsetInfo($mon, $hour, $min, $sec);
     $header = new \Zimbra\Mail\Struct\Header($name, $value);
     $attach = new \Zimbra\Mail\Struct\AttachmentsInfo($aid, [$mp, $m, $cn, $doc]);
     $mp = new \Zimbra\Mail\Struct\MimePartInfo($attach, $ct, $content, $ci, [$info]);
     $inv = new \Zimbra\Mail\Struct\InvitationInfo($method, $compNum, true);
     $e = new \Zimbra\Mail\Struct\EmailAddrInfo($address, AddressType::FROM(), $personal);
     $tz = new \Zimbra\Mail\Struct\CalTZInfo($id, $stdoff, $dayoff, $standard, $daylight, $stdname, $dayname);
     $any = $this->getMockForAbstractClass('Zimbra\\Struct\\Base');
     $m = new SaveDraftMsg($content, $mp, $attach, $inv, $fr, $msg_id, $forAcct, $t, $tn, $rgb, $color, $autoSendTime, $aid, $origid, ReplyType::REPLIED(), $idnt, $su, $irt, $l, $f, [$header], [$e], [$tz], [$any]);
     $this->api->saveDraft($m);
     $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:zimbraMail">' . '<env:Body>' . '<urn1:SaveDraftRequest>' . '<urn1:m id="' . $msg_id . '" forAcct="' . $forAcct . '" t="' . $t . '" tn="' . $tn . '" rgb="' . $rgb . '" color="' . $color . '" autoSendTime="' . $autoSendTime . '" aid="' . $aid . '" origid="' . $origid . '" rt="' . ReplyType::REPLIED() . '" idnt="' . $idnt . '" su="' . $su . '" irt="' . $irt . '" l="' . $l . '" f="' . $f . '">' . '<urn1:content>' . $content . '</urn1:content>' . '<urn1:mp ct="' . $ct . '" content="' . $content . '" ci="' . $ci . '">' . '<urn1:attach aid="' . $aid . '">' . '<urn1:mp optional="true" mid="' . $mid . '" part="' . $part . '" />' . '<urn1:m optional="false" id="' . $id . '" />' . '<urn1:cn optional="false" id="' . $id . '" />' . '<urn1:doc optional="true" path="' . $path . '" id="' . $id . '" ver="' . $ver . '" />' . '</urn1:attach>' . '<urn1:mp ct="' . $ct . '" content="' . $content . '" ci="' . $ci . '" />' . '</urn1:mp>' . '<urn1:attach aid="' . $aid . '">' . '<urn1:mp optional="true" mid="' . $mid . '" part="' . $part . '" />' . '<urn1:m optional="false" id="' . $id . '" />' . '<urn1:cn optional="false" id="' . $id . '" />' . '<urn1:doc optional="true" path="' . $path . '" id="' . $id . '" ver="' . $ver . '" />' . '</urn1:attach>' . '<urn1:inv method="' . $method . '" compNum="' . $compNum . '" rsvp="true" />' . '<urn1:fr>' . $fr . '</urn1:fr>' . '<urn1:header name="' . $name . '">' . $value . '</urn1:header>' . '<urn1:e a="' . $address . '" t="' . AddressType::FROM() . '" p="' . $personal . '" />' . '<urn1:tz id="' . $id . '" stdoff="' . $stdoff . '" dayoff="' . $dayoff . '" stdname="' . $stdname . '" dayname="' . $dayname . '">' . '<urn1:standard mon="' . $mon . '" hour="' . $hour . '" min="' . $min . '" sec="' . $sec . '" />' . '<urn1:daylight mon="' . $mon . '" hour="' . $hour . '" min="' . $min . '" sec="' . $sec . '" />' . '</urn1:tz>' . '<urn1:any />' . '</urn1:m>' . '</urn1:SaveDraftRequest>' . '</env:Body>' . '</env:Envelope>';
     $this->assertXmlStringEqualsXmlString($xml, (string) $req);
 }