API Platform 3 Part 2: Security for your Treasures
JSON Test Assertions & Seeding the Database
  Start your All-Access Pass to unlock this challenge
Buy Access Login

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

Turn Challenges Off?

All further challenges will be skipped automatically.
You can re-enable challenges at any time on this page or from your account page.