From 47e847d100e138b9582a66d60f7a2bedb89594d6 Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Fri, 2 Dec 2022 18:37:50 +0000 Subject: [PATCH] Fix tests --- tests/Unit/ArticlesTest.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/Unit/ArticlesTest.php b/tests/Unit/ArticlesTest.php index b8eba302..3229985a 100644 --- a/tests/Unit/ArticlesTest.php +++ b/tests/Unit/ArticlesTest.php @@ -79,9 +79,17 @@ class ArticlesTest extends TestCase $emptyScope = Article::date()->get(); $this->assertCount(2, $emptyScope); + } - // Check the December case - $article = Article::factory()->create([ + /** @test */ + public function dateScopeReturnsExpectedArticlesForDecember(): void + { + Article::factory()->create([ + 'created_at' => Carbon::now()->setMonth(11)->toDateTimeString(), + 'updated_at' => Carbon::now()->setMonth(11)->toDateTimeString(), + ]); + + Article::factory()->create([ 'created_at' => Carbon::now()->setMonth(12)->toDateTimeString(), 'updated_at' => Carbon::now()->setMonth(12)->toDateTimeString(), ]);