title: Laravel PhpUnit No such table
body: <p>I had try lot of things but i am stuck on this problem.
  I try to make test on my application (working with Laravel5.3).
  My DB for developement is Mysql , but i want test with the sqlite"memory" database.</p>
  
  <p>Each time i try to launch a test i have this error:
  General error: 1 no such table: groupe_user</p>
  
  <p>Its seem to don't migrate tables in the sqlite database.
  I don't see what i am doing wrong.</p>
  
  <p>I put here my testCase file and the migrations if someone can help me , it would be great.</p>
  
  <p>The TestCase.php :</p>
  
  <pre><code>&lt;?php
  
  abstract class TestCase extends Illuminate\Foundation\Testing\TestCase
  {
  /**
   * The base URL to use while testing the application.
   *
   * @var string
   */
  protected $baseUrl = 'http://localhost';
  
  /**
   * Creates the application.
   *
   * @return \Illuminate\Foundation\Application
   */
  public function createApplication()
  {
        $unitTesting = true;
        $testEnvironment = 'testing';
  
      $app = require __DIR__.'/../bootstrap/app.php';
  
      $app-&gt;make(Illuminate\Contracts\Console\Kernel::class)-&gt;bootstrap();
  
      return $app;
  }
  
  public function setUp()
  {
       parent::setUp();
       $this-&gt;createApplication();
       $this-&gt;prepareForTests();
  }
  
   private function prepareForTests()
   {
       Artisan::call('migrate');
       Artisan::call('db:seed');
   }
  
   public function tearDown()
   {
   parent::tearDown();
    }
  </code></pre>
  
  <p>}</p>
  
  <p>And the migration file with that pivot Table :</p>
  
  <pre><code>class CreateGroupesTable extends Migration
  {
  
  /**
   * Run the migrations.
   *
   * @return void
   */
  public function up()
  {
      Schema::create('groupes', function (Blueprint $table) {
          $table-&gt;increments('id');
          $table-&gt;string('name', 100);
          $table-&gt;timestamps();
      });
  
  //Création de la table pivot groupe_user avec les cléfs étrangères
  Schema::create('groupe_user', function (Blueprint $table) {
      $table-&gt;increments('id');
      $table-&gt;integer('user_id')-&gt;unsigned()-&gt;index()-&gt;nullable();
      $table-&gt;integer('groupe_id')-&gt;unsigned()-&gt;index()-&gt;nullable();
      $table-&gt;foreign('user_id')-&gt;references('id')-&gt;on('users');
      $table-&gt;foreign('groupe_id')-&gt;references('id')-&gt;on('groupes');
      $table-&gt;timestamps();
  });
  }
  
  /**
   * Reverse the migrations.
   *
   * @return void
   */
  public function down()
  {
      Schema::drop('groupes');
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Thanks for watching.</p>
  
  <p>EDIT:
  The begining of my AuthTest.php</p>
  
  <pre><code>&lt;?php
  
  use Illuminate\Foundation\Testing\WithoutMiddleware;
  use Illuminate\Foundation\Testing\DatabaseMigrations;
  use Illuminate\Foundation\Testing\DatabaseTransactions;
  use App\User;
  
  class AuthTest extends TestCase
  {
  use DatabaseMigrations;
  
  public function testAuthLogin()
  {
      $user = factory(App\User::class)-&gt;create();
  
  //Test du login
      $this-&gt;visit('/login')
         -&gt;see('Se Connecter')
         -&gt;type('lorem@gmail.com', 'email')
         -&gt;type('lorem85', 'password')
         -&gt;press('Se connecter');
  }
  </code></pre>