/**
  * @expectedException \LogicException
  */
 public function testOverwritePersonDifferentIdThrowsException()
 {
     $donor = new Donor();
     $donor->setId(1);
     $donor->setFirstName('Test');
     $this->phoneNumber->setPerson($donor);
     $this->assertEquals($donor, $this->phoneNumber->getPerson());
     $secondDonor = new Donor();
     $secondDonor->setId(2);
     $this->phoneNumber->setPerson($secondDonor);
 }
コード例 #2
0
 public function testAddPerson()
 {
     $donor = new Donor();
     $donor->setId('1');
     $this->epa->addPerson($donor);
     $this->assertEquals($donor, $this->epa->getDonor());
     $attorney = new Attorney();
     $attorney->setId('1');
     $this->epa->addPerson($attorney);
     $this->assertEquals($attorney, $this->epa->getAttorneys()[0]);
     $personNotifyDonor = new PersonNotifyDonor();
     $personNotifyDonor->setId('1');
     $this->epa->addPerson($personNotifyDonor);
     $this->assertEquals($personNotifyDonor, $this->epa->getPersonNotifyDonor());
     $notifiedRelative = new NotifiedRelative();
     $notifiedRelative->setId('1');
     $this->epa->addPerson($notifiedRelative);
     $this->assertEquals($notifiedRelative, $this->epa->getNotifiedRelatives()[0]);
     $notifiedAttorney = new NotifiedAttorney();
     $notifiedAttorney->setId('1');
     $this->epa->addPerson($notifiedAttorney);
     $this->assertEquals($notifiedAttorney, $this->epa->getNotifiedAttorneys()[0]);
     $correspondent = new Correspondent();
     $correspondent->setId('1');
     $this->epa->addPerson($correspondent);
     $this->assertEquals($correspondent, $this->epa->getCorrespondent());
     $person = $this->getMockForAbstractClass('Opg\\Core\\Model\\Entity\\CaseActor\\Person');
     $person->setId('1');
     try {
         $this->epa->addPerson($person);
     } catch (\Exception $e) {
         $this->assertTrue($e instanceof \LogicException);
         $this->assertFalse($e instanceof UnusedException);
     }
 }
コード例 #3
0
 public function testToString()
 {
     $expected = "Test *1*2*3*Test Town*Test County*SW3 4HG*Test Country";
     $donor = new Donor();
     $donor->setId(1);
     $donor->setFirstName('Test');
     $this->address->setPerson($donor);
     $this->assertEquals($donor, $this->address->getPerson());
     $this->address->setAddressLines(array(1, 2, 3))->setTown('Test Town')->setCounty('Test County')->setPostcode('SW3 4HG')->setCountry('Test Country');
     $result = $this->address->toString('*', Address::INCLUDE_PERSON, 0b111);
     $this->assertEquals($expected, trim($result));
 }