Fix tests
This commit is contained in:
parent
f060f52520
commit
47e847d100
1 changed files with 10 additions and 2 deletions
|
@ -79,9 +79,17 @@ class ArticlesTest extends TestCase
|
||||||
|
|
||||||
$emptyScope = Article::date()->get();
|
$emptyScope = Article::date()->get();
|
||||||
$this->assertCount(2, $emptyScope);
|
$this->assertCount(2, $emptyScope);
|
||||||
|
}
|
||||||
|
|
||||||
// Check the December case
|
/** @test */
|
||||||
$article = Article::factory()->create([
|
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(),
|
'created_at' => Carbon::now()->setMonth(12)->toDateTimeString(),
|
||||||
'updated_at' => Carbon::now()->setMonth(12)->toDateTimeString(),
|
'updated_at' => Carbon::now()->setMonth(12)->toDateTimeString(),
|
||||||
]);
|
]);
|
||||||
|
|
Loading…
Add table
Reference in a new issue