Merge pull request #580 from jonnybarnes/fix-tests

Fix tests
This commit is contained in:
Jonny Barnes 2022-12-02 18:46:53 +00:00 committed by GitHub
commit 7c7e0a0981
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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