/** @test */ public function it_should_return_streets_which_are_maintained_tomorrow() { $tomorrow = Carbon::now()->addDay()->toDateString(); $maintainedStreets = factory(App\Street::class, 10)->create(['next_maintenance' => $tomorrow, 'info' => 'Test info' . str_random('3')]); $notMaintainedStreets = factory(App\Street::class, 10)->create(); $foundMaintainedStreets = Street::maintainedTomorrow()->get(); $this->assertEquals($maintainedStreets->count(), $foundMaintainedStreets->count()); $this->assertEquals($foundMaintainedStreets->pluck('id'), $maintainedStreets->pluck('id')); $this->assertNotEquals($foundMaintainedStreets->pluck('id'), $notMaintainedStreets->pluck('id')); }