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
2424
2525 public function approved (): self
2626 {
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+ ]);
3230 }
3331
3432 public function unapproved (): self
3533 {
36- return $ this ->state (function (): array {
37- return [
38- 'approved_at ' => null ,
39- ];
40- });
34+ return $ this ->state (fn () => [
35+ 'approved_at ' => null ,
36+ ]);
4137 }
4238}
Original file line number Diff line number Diff line change 151151});
152152
153153test ('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 ' ]);
157157
158158 $ this ->loginAsAdmin ();
159159
You can’t perform that action at this time.
0 commit comments