Flag of Ukraine
SymfonyCasts stands united with the people of Ukraine
Next Chapter

Challenge #1 of 1


Q: 

What would happen if we did not include ResetDatabase in the following test:

class DragonTreasureResourceTest
{
    use HasBrowser;

    public function testTreasuresReturnCorrectly()
    {
        DragonTreasureFactory::createMany(5);
        $browser->get('/api/treasures')
            ->assertJsonMatches('"hydra:totalItems"', 5);
    }

    public function testTreasuresStartEmpty()
    {
        $browser->get('/api/treasures')
            ->assertJsonMatches('"hydra:totalItems"', 0);
    }
}

userVoice