Rephrasing test.

Posted 3 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.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.