create(); $this->assertEquals(link_to_route('users.show', $user->nickname, [$user->id]), $user->profileLink()); } /** @test */ public function user_can_have_marriages() { $husband = factory(User::class)->states('male')->create(); $wife = factory(User::class)->states('female')->create(); $husband->addWife($wife); $this->assertCount(1, $husband->wifes); $this->assertCount(1, $wife->husbands); $this->assertCount(1, $husband->marriages); } /** @test */ public function user_have_father_link_method() { $father = factory(User::class)->create(); $user = factory(User::class)->create(['father_id' => $father->id]); $this->assertEquals($father->profileLink(), $user->fatherLink()); } /** @test */ public function user_have_mother_link_method() { $mother = factory(User::class)->create(); $user = factory(User::class)->create(['mother_id' => $mother->id]); $this->assertEquals($mother->profileLink(), $user->motherLink()); } }