File tree 1 file changed +23
-1
lines changed
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
14
14
*/
15
15
protected function tearDown (): void
16
16
{
17
- User::truncate ();
17
+ $ this ->schema ()->drop ('users ' );
18
+ $ this ->schema ()->drop ('users_created_at ' );
19
+ $ this ->schema ()->drop ('users_updated_at ' );
18
20
}
19
21
20
22
/**
@@ -50,6 +52,26 @@ public function testUserWithUpdatedAt()
50
52
51
53
$ this ->assertEquals ($ now ->toDateTimeString (), $ user ->updated_at ->toDateTimeString ());
52
54
}
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
+ }
53
75
}
54
76
55
77
/**
You can’t perform that action at this time.
0 commit comments