Commit 31b0fdf0 authored by Ditty's avatar Ditty

Drop test collections correctly

Drop test collections correctly
parent a73a6670
...@@ -14,7 +14,9 @@ class DatabaseEloquentTimestampsTest extends TestCase ...@@ -14,7 +14,9 @@ class DatabaseEloquentTimestampsTest extends TestCase
*/ */
protected function tearDown(): void protected function tearDown(): void
{ {
User::truncate(); $this->schema()->drop('users');
$this->schema()->drop('users_created_at');
$this->schema()->drop('users_updated_at');
} }
/** /**
...@@ -50,6 +52,26 @@ class DatabaseEloquentTimestampsTest extends TestCase ...@@ -50,6 +52,26 @@ class DatabaseEloquentTimestampsTest extends TestCase
$this->assertEquals($now->toDateTimeString(), $user->updated_at->toDateTimeString()); $this->assertEquals($now->toDateTimeString(), $user->updated_at->toDateTimeString());
} }
/**
* Get a database connection instance.
*
* @return \Illuminate\Database\ConnectionInterface
*/
protected function connection()
{
return Eloquent::getConnectionResolver()->connection();
}
/**
* Get a schema builder instance.
*
* @return \Illuminate\Database\Schema\Builder
*/
protected function schema()
{
return $this->connection()->getSchemaBuilder();
}
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment