Rephrasing test.

Posted 7 months ago by xtremer360

Any suggestions on how to improve on the naming of the variables in this test or maybe I need to re-write the assertion. Problem is a championship consists of a wrestler and a title. The records in the database of a wrestler holding a title are referred to as a championship. But I'd like to figure out what I can do so that it makes more sense that the champion loses the title. A champion is a wrestler who holds the title. So a wrestler is a wrestler unless he has a title then he's a champion but the record of a wrestler and title is a championship. Hopefully, that makes sense.

/** @test */
    public function a_champion_can_lose_a_title()
    {
        $championship = factory(Championship::class)->create();

        $championship->loseTitle(Carbon::now());

        $this->assertNotNull($championship->fresh()->lost_on);
    }

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.