File tree Expand file tree Collapse file tree 2 files changed +9
-13
lines changed Expand file tree Collapse file tree 2 files changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -24,19 +24,15 @@ public function definition(): array
24
24
25
25
public function approved (): self
26
26
{
27
- return $ this ->state (function (): array {
28
- return [
29
- 'approved_at ' => $ this ->faker ->dateTimeBetween ('-1 year ' , 'now ' ),
30
- ];
31
- });
27
+ return $ this ->state (fn () => [
28
+ 'approved_at ' => $ this ->faker ->dateTimeBetween ('-1 year ' , 'now ' ),
29
+ ]);
32
30
}
33
31
34
32
public function unapproved (): self
35
33
{
36
- return $ this ->state (function (): array {
37
- return [
38
- 'approved_at ' => null ,
39
- ];
40
- });
34
+ return $ this ->state (fn () => [
35
+ 'approved_at ' => null ,
36
+ ]);
41
37
}
42
38
}
Original file line number Diff line number Diff line change 151
151
});
152
152
153
153
test ('admins can list submitted articles ' , function () {
154
- $ submittedArticle = Article::factory ()->create (['submitted_at ' => now ()]);
155
- $ draftArticle = Article::factory ()->create ();
156
- $ liveArticle = Article::factory ()->create (['submitted_at ' => now (), 'approved_at ' => now ()]);
154
+ $ submittedArticle = Article::factory ()->create (['submitted_at ' => now (), ' title ' => ' My submitted article ' ]);
155
+ $ draftArticle = Article::factory ()->create ([ ' title ' => ' My draft article ' ] );
156
+ $ liveArticle = Article::factory ()->create (['submitted_at ' => now (), 'approved_at ' => now (), ' title ' => ' My live article ' ]);
157
157
158
158
$ this ->loginAsAdmin ();
159
159
You can’t perform that action at this time.
0 commit comments