getContainer()->get(OpenMeteoService::class); $fromDate = new \DateTime(); $toDate = \DateTime::createFromInterface($fromDate)->add(new \DateInterval('P1D')); $weather = $openMeteoApi->fetchWeather( $this->geoPointPrague(), WeatherInterval::DAILY, $fromDate, $toDate, ); $this->assertCount(2, $weather); $this->assertEquals($fromDate->format('Y-m-d'), $weather[0]->date->format('Y-m-d')); $this->assertEquals($toDate->format('Y-m-d'), $weather[1]->date->format('Y-m-d')); } private function geoPointPrague(): GEOPoint { return new GEOPoint( 50.073658, 14.418540 ); } }