Start your All-Access Pass to unlock this challenge
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);
}
}