File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,9 @@ class DatabaseEloquentTimestampsTest extends TestCase
1414 */
1515 protected function tearDown (): void
1616 {
17- User::truncate ();
17+ $ this ->schema ()->drop ('users ' );
18+ $ this ->schema ()->drop ('users_created_at ' );
19+ $ this ->schema ()->drop ('users_updated_at ' );
1820 }
1921
2022 /**
@@ -50,6 +52,26 @@ public function testUserWithUpdatedAt()
5052
5153 $ this ->assertEquals ($ now ->toDateTimeString (), $ user ->updated_at ->toDateTimeString ());
5254 }
55+
56+ /**
57+ * Get a database connection instance.
58+ *
59+ * @return \Illuminate\Database\ConnectionInterface
60+ */
61+ protected function connection ()
62+ {
63+ return Eloquent::getConnectionResolver ()->connection ();
64+ }
65+
66+ /**
67+ * Get a schema builder instance.
68+ *
69+ * @return \Illuminate\Database\Schema\Builder
70+ */
71+ protected function schema ()
72+ {
73+ return $ this ->connection ()->getSchemaBuilder ();
74+ }
5375}
5476
5577/**
You can’t perform that action at this time.
0 commit comments