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(), ]);