title: Laravel create database when testing
body: <p>I am trying to run my unit test and create a database during setup. For some reason I am getting the error <code>Unknown database 'coretest'</code>. If I create the database though manually and run the test then I get <code>Can't create database 'coretest'; database exists</code>.</p>
  
  <p>The drop database statement works just now the create database.</p>
  
  <p>Here is my setUP and tearDown methods:</p>
  
  <pre><code>class TestCase extends Illuminate\Foundation\Testing\TestCase {
      /**
       * Default preparation for each test
       */
  
      public function setUp() {
          parent::setUp();
  
          DB::statement('create database coretest;');
          Artisan::call('migrate');
          $this-&gt;seed();
          Mail::pretend(true);
      }
  
      public function tearDown() {
          parent::tearDown();
          DB::statement('drop database coretest;');
      }
  }
  </code></pre>