/** * @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); }
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)); }