object = new ReportHelper($query); } /** * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. */ public function tearDown() { parent::tearDown(); } public function testListOfMonths() { // start of year up until now $date = new Carbon('2015-01-01'); $now = new Carbon; $diff = $now->diffInMonths($date) + 1; // the month itself. $result = $this->object->listOfMonths($date); $this->assertCount($diff, $result[2015]); } }