title: How to load datafixtures hautelook alice in phpunit symfony?
body: <p>I try to add this code in my DefaultControllerTest</p>
  
  <pre><code>$load = new Loader();
  $load-&gt;load('src/AppBundle/DataFixtures/ORM/product.yml');
  </code></pre>
  
  <p>and here is the complete code of my controller</p>
  
  <pre><code>&lt;?php
  
  namespace Tests\AppBundle\Controller;
  
  use Nelmio\Alice\Fixtures\Loader;
  use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
  
  class DefaultControllerTest extends WebTestCase
  {
      public function testIndex()
      {
          $load = new Loader();
          $load-&gt;load('src/AppBundle/DataFixtures/ORM/product.yml');
          $client = static::createClient();
  
          $crawler = $client-&gt;request('GET', '/');
  
          $this-&gt;assertEquals(200, $client-&gt;getResponse()-&gt;getStatusCode());
          $this-&gt;assertContains('Welcome to Symfony', $crawler-&gt;filter('#container h1')-&gt;text());
      }
  }
  </code></pre>
  
  <p>If I run phpunit. It works and no errors found. It successfully tested but the problem here the product.yml doesn't insert any data in my database. But If I run this command  <strong>bin/console hautelook_alice:doctrine:fixtures:load --append</strong>. This will works. It insert the data. How can I load the datafixture before I test the controller? I try to research more about it. but I have no clue on how to add it now. </p>