@@ -13,7 +13,7 @@ class ObservedModelTests extends TestCase
13
13
public function it_works_perfectly_on_creating_a_new_post ()
14
14
{
15
15
$ this ->impersonateUser ();
16
- $ post = factory ( Post::class )->create ();
16
+ $ post = Post::factory ( )->create ();
17
17
18
18
$ this ->assertFalse ($ post ->isDirty ('created_by ' ));
19
19
$ this ->assertFalse ($ post ->isDirty ('updated_by ' ));
@@ -25,7 +25,7 @@ public function it_works_perfectly_on_creating_a_new_post()
25
25
public function it_works_perfectly_on_updating_existing_post ()
26
26
{
27
27
$ this ->impersonateUser ();
28
- $ post = factory ( Post::class )->create ();
28
+ $ post = Post::factory ( )->create ();
29
29
30
30
$ this ->impersonateOtherUser ();
31
31
$ post ->setAttribute ('title ' , 'Another Title ' );
@@ -41,7 +41,7 @@ public function it_works_perfectly_on_updating_existing_post()
41
41
public function it_works_perfectly_on_deleting_post1 ()
42
42
{
43
43
$ this ->impersonateUser ();
44
- $ post = factory ( Post::class )->create ();
44
+ $ post = Post::factory ( )->create ();
45
45
46
46
$ post ->delete ();
47
47
$ deletedPost = Post::onlyTrashed ()->where ('id ' , $ post ->getKey ())->first ();
@@ -53,7 +53,7 @@ public function it_works_perfectly_on_deleting_post1()
53
53
public function it_works_perfectly_on_deleting_post2 ()
54
54
{
55
55
$ this ->impersonateUser ();
56
- $ post = factory ( Post::class )->create ();
56
+ $ post = Post::factory ( )->create ();
57
57
58
58
$ this ->impersonateOtherUser ();
59
59
$ post ->delete ();
@@ -67,7 +67,7 @@ public function it_works_perfectly_on_deleting_post2()
67
67
public function it_works_perfectly_on_restoring_deleted_post ()
68
68
{
69
69
$ this ->impersonateUser ();
70
- $ post = factory ( Post::class )->create ();
70
+ $ post = Post::factory ( )->create ();
71
71
72
72
$ this ->impersonateOtherUser ();
73
73
$ post ->delete ();
@@ -81,7 +81,7 @@ public function it_works_perfectly_on_restoring_deleted_post()
81
81
public function it_works_perfectly_on_creating_a_new_comment ()
82
82
{
83
83
$ this ->impersonateUser ();
84
- $ comment = factory ( Comment::class )->create ([
84
+ $ comment = Comment::factory ( )->create ([
85
85
'post_id ' => 100
86
86
]);
87
87
@@ -95,8 +95,8 @@ public function it_works_perfectly_on_creating_a_new_comment()
95
95
public function it_works_perfectly_on_updating_existing_comment ()
96
96
{
97
97
$ this ->impersonateUser ();
98
- $ post = factory ( Post::class )->create ();
99
- $ comment = factory ( Comment::class )->create ([
98
+ $ post = Post::factory ( )->create ();
99
+ $ comment = Comment::factory ( )->create ([
100
100
'post_id ' => $ post ->getKey ()
101
101
]);
102
102
@@ -119,7 +119,7 @@ public function it_works_perfectly_on_updating_existing_comment()
119
119
public function it_works_perfectly_on_deleting_comment1 ()
120
120
{
121
121
$ this ->impersonateUser ();
122
- $ comment = factory ( Comment::class )->create ([
122
+ $ comment = Comment::factory ( )->create ([
123
123
'post_id ' => 100
124
124
]);
125
125
@@ -133,7 +133,7 @@ public function it_works_perfectly_on_deleting_comment1()
133
133
public function it_works_perfectly_on_deleting_comment2 ()
134
134
{
135
135
$ this ->impersonateUser ();
136
- $ comment = factory ( Comment::class )->create ([
136
+ $ comment = Comment::factory ( )->create ([
137
137
'post_id ' => 100
138
138
]);
139
139
@@ -149,7 +149,7 @@ public function it_works_perfectly_on_deleting_comment2()
149
149
public function it_works_perfectly_on_restoring_deleted_comment ()
150
150
{
151
151
$ this ->impersonateUser ();
152
- $ comment = factory ( Comment::class )->create ([
152
+ $ comment = Comment::factory ( )->create ([
153
153
'post_id ' => 100
154
154
]);
155
155
@@ -188,7 +188,7 @@ public function it_works_perfectly_on_creating_a_new_user2()
188
188
public function it_works_perfectly_on_updating_existing_user ()
189
189
{
190
190
$ this ->impersonateUser ();
191
- $ user = factory ( User::class )->create ();
191
+ $ user = User::factory ( )->create ();
192
192
193
193
$ this ->impersonateOtherUser ();
194
194
$ user ->setAttribute ('email ' , 'another@email.com ' );
@@ -204,7 +204,7 @@ public function it_works_perfectly_on_updating_existing_user()
204
204
public function it_works_perfectly_on_deleting_user1 ()
205
205
{
206
206
$ this ->impersonateUser ();
207
- $ user = factory ( User::class )->create ();
207
+ $ user = User::factory ( )->create ();
208
208
209
209
$ user ->delete ();
210
210
$ deletedUser = User::onlyTrashed ()->where ('id ' , $ user ->getKey ())->first ();
@@ -216,7 +216,7 @@ public function it_works_perfectly_on_deleting_user1()
216
216
public function it_works_perfectly_on_deleting_user2 ()
217
217
{
218
218
$ this ->impersonateUser ();
219
- $ user = factory ( User::class )->create ();
219
+ $ user = User::factory ( )->create ();
220
220
221
221
$ this ->impersonateOtherUser ();
222
222
$ user ->delete ();
@@ -230,7 +230,7 @@ public function it_works_perfectly_on_deleting_user2()
230
230
public function it_works_perfectly_on_restoring_deleted_user ()
231
231
{
232
232
$ this ->impersonateUser ();
233
- $ user = factory ( User::class )->create ();
233
+ $ user = User::factory ( )->create ();
234
234
235
235
$ this ->impersonateOtherUser ();
236
236
$ user ->delete ();
@@ -243,7 +243,7 @@ public function it_works_perfectly_on_restoring_deleted_user()
243
243
/** @test */
244
244
public function it_will_set_null_creator_and_null_updater_on_unauthenticated_user ()
245
245
{
246
- $ post = factory ( Post::class )->create ();
246
+ $ post = Post::factory ( )->create ();
247
247
248
248
$ this ->assertNull ($ post ->getAttribute ('created_by ' ));
249
249
$ this ->assertNull ($ post ->getAttribute ('updated_by ' ));
@@ -254,7 +254,7 @@ public function it_wont_cause_any_error_when_deleting_model_without_soft_deletes
254
254
{
255
255
$ this ->impersonateAdmin ();
256
256
257
- $ news = factory ( News::class )->create ();
257
+ $ news = News::factory ( )->create ();
258
258
$ news ->delete ();
259
259
$ news ->fresh ();
260
260
0 commit comments