public function testSaveSpousesRelationship() { $repository = $this->getRepository(); $husband = new Persona(Persona::GENDER_MALE); $wife = new Persona(Persona::GENDER_FEMALE); $husband->addSpouse($wife); $repository->save($husband); $this->assertTableHasData('spouse_relationship', ['husband_id' => $husband->getId(), 'wife_id' => $wife->getId()]); }
public function testSpouseReflectionRelationshit() { $husband = new Persona(Persona::GENDER_MALE); $wife = new Persona(Persona::GENDER_FEMALE); $husband->addSpouse($wife); $this->assertContains($husband, $wife->getSpouses()); }