Laravel phpunit tests will not migrate properly
<p>I have 2 tables, <code>badges</code> and <code>counselors</code>. All of my tests were green. I added a third table, a pivot table, named <code>badge_counselor</code>. Here is the migration: </p>

<pre><code>use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateBadgeCounselorTable extends Migration {

  /**
   * Run the migrations.
   *
   * @return void
   */

  public function up()
  {
    Schema::create('badge_counselor', function (Blueprint $table) {
        $table-&gt;increments('id');
        $table-&gt;integer('badge_id')-&gt;unsigned();
        $table-&gt;integer('counselor_id')-&gt;unsigned();
        $table-&gt;foreign('badge_id')-&gt;references('id')-&gt;on('badges')-&gt;onDelete('cascade');
        $table-&gt;foreign('counselor_id')-&gt;references('id')-&gt;on('counselors')-&gt;onDelete('cascade');
    });
  }

  /**
   * Reverse the migrations.
   *
   * @return void
   */
  public function down()
  {
      Schema::dropIfExists('badge_counselor');
  }
}
</code></pre>

<p>When i run <code>php artisan migrate</code> / <code>php artisan migrate:refresh</code> / <code>php artisan migrate:rollback</code>, everything works fine. Howevever, when i run my unit tests, ALL of them fail. And each one returns the error message: </p>

<pre><code>Illuminate\Database\QueryException: SQLSTATE[HY000]: General error: 1 table "badge_counselor" already exists (SQL: create table "badge_counselor" ("id" integer not null primary key autoincrement, "badge_id" integer not null, "counselor_id" integer not null, foreign key("badge_id") references "badges"("id") on delete cascade, foreign key("counselor_id") references "counselors"("id") on delete cascade))
</code></pre>

<p>or simply:</p>

<pre><code>PDOException: SQLSTATE[HY000]: General error: 1 table "badge_counselor" already exists
</code></pre>

<p>Judging by the error message a assume that the table is not being dropped correctly, but when i run the <code>migrate</code> commands from the terminal they are perfect. I have tried dropping the <code>migrations</code> table, all the tables, and even the entire database and creating it again and nothing seems to work.</p>

<p>Thanks.</p>