title: TearDown database after a phpUnitTest on a WebTestCase using DataFixtures
body: <p>I have the following phpUnit functional Test:</p>
  
  <pre><code>namespace Tests\AppBundle\Controller;
  
  /**
  * @testtype Functional
  */
  class DefaultControllerTest extends BasicHttpController
  {
  
      /**
      * {@inheritdoc}
      */
      public function setUp()
      {
          $client = static::createClient();
          $container = $client-&gt;getContainer();
          $doctrine = $container-&gt;get('doctrine');
          $entityManager = $doctrine-&gt;getManager();
  
          $fixture = new YourFixture();
          $fixture-&gt;load($entityManager);
      }
  
      /**
      * {@inheritdoc}
      */
      public function tearDown()
      {
          //Database is being destroyed here....
      }
  
      public function testIndex()
      {
          $client = static::createClient();
  
          $crawler = $client-&gt;request('GET', '/');
          $response=$client-&gt;getResponse();
          $this-&gt;assertEquals(302, $response-&gt;getStatusCode());
          $this-&gt;assertEquals('/login',$response-&gt;headers-&gt;get('Location'));
  
          //@todo Create Dummy Users
          $this-&gt;checkPanelAfterSucessfullLogin($crawler); //How I can create some user?
      }
  }
  </code></pre>
  
  <p>As you can see I load the following Fixture:</p>
  
  <pre><code>namespace AppBundle\DataFixtures\Test;
  
  use Doctrine\Common\DataFixtures\AbstractFixture;
  use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
  use Symfony\Component\DependencyInjection\ContainerAwareInterface;
  use Symfony\Component\DependencyInjection\ContainerInterface;
  use Doctrine\Common\Persistence\ObjectManager;
  
  class DummyUserFixtures extends AbstractFixture implements OrderedFixtureInterface, ContainerAwareInterface
  {
  
    /**
    * @var ContainerInterface
    */
    private $container=null;
  
    /**
    * Generic function that creates a user with provided information.
    * @param $name {String} The user's name
    * @param $surname {String} The user's surname
    * @param $username {String} The user's username
    * @param $password {String} The user's password
    * @param $email {String} The user's recovery email
    * @param $role {String} The user's system role
    * @param $phone {String | null} The user's phone number
    * @param $organization {String|null} The user's organization
    * @param $occupation {String|null} The user's occupation
    *
    * @return AppBundle\Entity\User
    */
    private function createUser($name,$surname,$username,$password,$email,$role,$phone=null,$organization=null,$occupation=null)
    {
      $fosUserManager=$this-&gt;container-&gt;get('fos_user.user_manager');
        /**
        * @var AppBundle\Entity\User
        */
        $user=$fosUserManager-&gt;createUser();
        $user-&gt;setUsername($username);
        $user-&gt;setEmail($email);
        $user-&gt;setPlainPassword($password);
        $user-&gt;setEnabled(true);
        $user-&gt;setRoles(array($role));
  
        $user-&gt;setName($name);
        $user-&gt;setSurname($surname);
  
        if($phone){
          $user-&gt;setPhone($phone);
        }
  
        if($organization){
          $user-&gt;setOrganization($organization);
        }
  
        if($occupation){
          $user-&gt;serOccupation($occupation);
        }
  
        $fosUserManager-&gt;updateUser($user, true);
  
        return $user;
    }
  
    public function setContainer(ContainerInterface $container = null)
    {
      $this-&gt;container = $container;
    }
  
    /**
    * {@inheritDoc}
    */
    public function load(ObjectManager $manager)
    {
      $this-&gt;createUser('John','Doe','jdoe','simplepasswd','jdoe@example.com','ROLE_USER','+3021456742324','Acme Products','Soft Engineer');
      $this-&gt;createUser('Jackie','Chan','jchan','thesimplepasswd','jackiechan@example.com','ROLE_ADMIN','+302141232324','Holywood','Actor');
      $this-&gt;createUser('Chuck','Norris','chuck_norris','unhackablepasswd','chucknorris@example.com','ROLE_SUPERADMIN',null,'Universe','Master');
    }
  
  }
  </code></pre>
  
  <p>But I want to be able after my database changes happen to be able to tear down completely the database and recreate it for the next test. Do you have ant idea how to colpletely tear down the database?</p>