Esempio n. 1
0
 public function testInviteComponentCommon()
 {
     $subject = InviteChange::SUBJECT();
     $location = InviteChange::LOCATION();
     $time = InviteChange::TIME();
     $comp = new \Zimbra\Mail\Struct\InviteComponentCommon('method', 10, true, 10, 'name', 'loc', 10, '20120315T18302305Z', true, FreeBusyStatus::F(), FreeBusyStatus::F(), Transparency::O(), true, 'x_uid', 'uid', 10, 10, 'calItemId', 'apptId', 'ciFolder', InviteStatus::COMP(), InviteClass::PUB(), 'url', true, 'ridZ', true, true, true, array($subject, $location));
     $this->assertSame('method', $comp->method());
     $this->assertSame(10, $comp->compNum());
     $this->assertTrue($comp->rsvp());
     $this->assertSame(10, $comp->priority());
     $this->assertSame('name', $comp->name());
     $this->assertSame('loc', $comp->loc());
     $this->assertSame(10, $comp->percentComplete());
     $this->assertSame('20120315T18302305Z', $comp->completed());
     $this->assertTrue($comp->noBlob());
     $this->assertTrue($comp->fba()->is('F'));
     $this->assertTrue($comp->fb()->is('F'));
     $this->assertTrue($comp->transp()->is('O'));
     $this->assertTrue($comp->isOrg());
     $this->assertSame('x_uid', $comp->x_uid());
     $this->assertSame('uid', $comp->uid());
     $this->assertSame(10, $comp->seq());
     $this->assertSame(10, $comp->d());
     $this->assertSame('calItemId', $comp->calItemId());
     $this->assertSame('apptId', $comp->apptId());
     $this->assertSame('ciFolder', $comp->ciFolder());
     $this->assertTrue($comp->status()->is('COMP'));
     $this->assertTrue($comp->class_()->is('PUB'));
     $this->assertSame('url', $comp->url());
     $this->assertTrue($comp->ex());
     $this->assertSame('ridZ', $comp->ridZ());
     $this->assertTrue($comp->allDay());
     $this->assertTrue($comp->draft());
     $this->assertTrue($comp->neverSent());
     $this->assertSame('subject,location', $comp->changes());
     $comp->method('method')->compNum(10)->rsvp(true)->priority(10)->name('name')->loc('loc')->percentComplete(10)->completed('20120315T18302305Z')->noBlob(true)->fba(FreeBusyStatus::F())->fb(FreeBusyStatus::F())->transp(Transparency::O())->isOrg(true)->x_uid('x_uid')->uid('uid')->seq(10)->d(10)->calItemId('calItemId')->apptId('apptId')->ciFolder('ciFolder')->status(InviteStatus::COMP())->class_(InviteClass::PUB())->url('url')->ex(true)->ridZ('ridZ')->allDay(true)->draft(true)->neverSent(true)->addChange($time);
     $this->assertSame('method', $comp->method());
     $this->assertSame(10, $comp->compNum());
     $this->assertTrue($comp->rsvp());
     $this->assertSame(10, $comp->priority());
     $this->assertSame('name', $comp->name());
     $this->assertSame('loc', $comp->loc());
     $this->assertSame(10, $comp->percentComplete());
     $this->assertSame('20120315T18302305Z', $comp->completed());
     $this->assertTrue($comp->noBlob());
     $this->assertTrue($comp->fba()->is('F'));
     $this->assertTrue($comp->fb()->is('F'));
     $this->assertTrue($comp->transp()->is('O'));
     $this->assertTrue($comp->isOrg());
     $this->assertSame('x_uid', $comp->x_uid());
     $this->assertSame('uid', $comp->uid());
     $this->assertSame(10, $comp->seq());
     $this->assertSame(10, $comp->d());
     $this->assertSame('calItemId', $comp->calItemId());
     $this->assertSame('apptId', $comp->apptId());
     $this->assertSame('ciFolder', $comp->ciFolder());
     $this->assertTrue($comp->status()->is('COMP'));
     $this->assertTrue($comp->class_()->is('PUB'));
     $this->assertSame('url', $comp->url());
     $this->assertTrue($comp->ex());
     $this->assertSame('ridZ', $comp->ridZ());
     $this->assertTrue($comp->allDay());
     $this->assertTrue($comp->draft());
     $this->assertTrue($comp->neverSent());
     $this->assertSame('subject,location,time', $comp->changes());
     $xml = '<?xml version="1.0"?>' . "\n" . '<comp' . ' method="method"' . ' compNum="10"' . ' rsvp="true"' . ' priority="10"' . ' name="name"' . ' loc="loc"' . ' percentComplete="10"' . ' completed="20120315T18302305Z"' . ' noBlob="true"' . ' fba="F"' . ' fb="F"' . ' transp="O"' . ' isOrg="true"' . ' x_uid="x_uid"' . ' uid="uid"' . ' seq="10"' . ' d="10"' . ' calItemId="calItemId"' . ' apptId="apptId"' . ' ciFolder="ciFolder"' . ' status="COMP"' . ' class="PUB"' . ' url="url"' . ' ex="true"' . ' ridZ="ridZ"' . ' allDay="true"' . ' draft="true"' . ' neverSent="true"' . ' changes="subject,location,time"' . ' />';
     $this->assertXmlStringEqualsXmlString($xml, (string) $comp);
     $array = array('comp' => array('method' => 'method', 'compNum' => 10, 'rsvp' => true, 'priority' => 10, 'name' => 'name', 'loc' => 'loc', 'percentComplete' => 10, 'completed' => '20120315T18302305Z', 'noBlob' => true, 'fba' => 'F', 'fb' => 'F', 'transp' => 'O', 'isOrg' => true, 'x_uid' => 'x_uid', 'uid' => 'uid', 'seq' => 10, 'd' => 10, 'calItemId' => 'calItemId', 'apptId' => 'apptId', 'ciFolder' => 'ciFolder', 'status' => 'COMP', 'class' => 'PUB', 'url' => 'url', 'ex' => true, 'ridZ' => 'ridZ', 'allDay' => true, 'draft' => true, 'neverSent' => true, 'changes' => 'subject,location,time'));
     $this->assertEquals($array, $comp->toArray());
 }