public function testGetSetIncomingDocuments() { $correspondence = new IncomingDocument(); $correspondence->setId(1); $this->documents = null; $this->assertNull($this->documents); $this->addDocument($correspondence); $this->assertEquals($this->documents, $this->getIncomingDocuments()); }
public function testSetGetDocuments() { $caseItemMock = $this->getMockedClass(); $documentCollection = new ArrayCollection(); for ($i = 0; $i < 10; $i++) { $document = new IncomingDocument(); $document->setId($i); $documentCollection->add($document); } $caseItemMock->setIncomingDocuments($documentCollection); $expected = 10; $array = $caseItemMock->getIncomingDocuments()->toArray(); $this->assertEquals($expected, count($array)); for ($i = 0; $i < 10; $i++) { $document = $array[$i]; $this->assertEquals($i, $document->getId()); } }
/** * @group array-recursive */ public function testArrayRecursive() { $epa = new Epa(); $epa->setDonor(new Donor()); $epa->addAttorney(new Attorney()); $epa->addNotifiedRelative(new NotifiedRelative()); $epa->addNotifiedAttorney(new NotifiedAttorney()); $epa->addDocument($doc = new IncomingDocument()); $doc->addPage(new Page()); $this->assertEquals(array('caseType' => 'EPA', 'notifiedRelatives' => array(), 'notifiedAttorneys' => array(), 'epaDonorSignatureDate' => null, 'donorHasOtherEpas' => false, 'otherEpaInfo' => null, 'donor' => array('id' => null, 'uId' => null, 'normalizedUid' => null, 'documents' => array(), 'notes' => array(), 'tasks' => array(), 'inputFilter' => null, 'errorMessages' => array(), 'warnings' => array()), 'correspondent' => null, 'applicants' => array(), 'attorneys' => array(), 'notifiedPersons' => array(), 'usesNotifiedPersons' => false, 'noNoticeGiven' => false, 'notifiedPersonPermissionBy' => 1, 'certificateProviders' => array(), 'paymentByDebitCreditCard' => 0, 'paymentByCheque' => 0, 'wouldLikeToApplyForFeeRemission' => 0, 'haveAppliedForFeeRemission' => 0, 'caseAttorneySingular' => false, 'caseAttorneyJointlyAndSeverally' => false, 'caseAttorneyJointly' => false, 'caseAttorneyJointlyAndJointlyAndSeverally' => false, 'cardPaymentContact' => null, 'howAttorneysAct' => null, 'howReplacementAttorneysAct' => null, 'attorneyActDecisions' => null, 'replacementAttorneyActDecisions' => null, 'replacementOrder' => null, 'additionalInfo' => null, 'paymentId' => null, 'paymentAmount' => null, 'paymentDate' => null, 'paymentRemission' => 0, 'paymentExemption' => 0, 'attorneyPartyDeclaration' => 1, 'attorneyApplicationAssertion' => 1, 'attorneyMentalActPermission' => 1, 'attorneyDeclarationSignatureDate' => null, 'attorneyDeclarationSignatoryFullName' => null, 'correspondentComplianceAssertion' => 1, 'notificationDate' => null, 'dispatchDate' => null, 'noticeGivenDate' => null, 'applicantType' => null, 'cancellationDate' => null, 'id' => null, 'oldCaseId' => null, 'applicationType' => 0, 'title' => null, 'caseSubtype' => null, 'dueDate' => null, 'registrationDate' => null, 'closedDate' => null, 'status' => null, 'tasks' => array(), 'notes' => array(), 'documents' => array(), 'caseItems' => array(), 'taskStatus' => array(), 'ragRating' => null, 'ragTotal' => null, 'rejectedDate' => null, 'scheduledJobs' => array(), 'uId' => null, 'normalizedUid' => null, 'inputFilter' => null, 'errorMessages' => array(), 'assignee' => null, 'epaDonorNoticeGivenDate' => null, 'personNotifyDonor' => null, 'hasRelativeToNotice' => null, 'areAllAttorneysApplyingToRegister' => null, 'payments' => array(), 'applicantsDeclaration' => 1, 'applicantsDeclarationSignatureDate' => null, 'caseAttorneyActionAdditionalInfo' => false, 'applicationHasRestrictions' => false, 'applicationHasGuidance' => false, 'applicationHasCharges' => false, 'certificateProviderSignatureDate' => null, 'attorneyStatementDate' => null, 'signingOnBehalfDate' => null, 'signingOnBehalfFullName' => null, 'attorneyDeclarationSignatureWitness' => false, 'additionalInfoDonorSignature' => false, 'additionalInfoDonorSignatureDate' => null, 'anyOtherInfo' => false, 'warnings' => null, 'attorneyDeclarationSignature' => false, 'certificateProviderSignature' => false, 'repeatApplication' => false, 'repeatApplicationReference' => null), $epa->toArrayRecursive()); }
public function testGetSetFriendlyDescription() { $expected = 'Test Document'; $this->assertEmpty($this->document->getFriendlyDescription()); $this->assertEquals($expected, $this->document->setFriendlyDescription($expected)->getFriendlyDescription()); }