Skip to content

Commit 215f344

Browse files
committed
wip
1 parent 5061be9 commit 215f344

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

database/factories/ArticleFactory.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff 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
}

tests/Feature/AdminTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@
151151
});
152152

153153
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']);
157157

158158
$this->loginAsAdmin();
159159

0 commit comments

Comments
 (0)