Start your All-Access Pass to unlock this challenge
Challenge 1 / 1
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);
}
}
Skip challenges and go to theNext Chapter