public function testGetToday()
 {
     $cityWoeid = $this->getMock('\\Th3Mouk\\YahooWeatherBundle\\Entity\\City');
     $cityWoeid->expects($this->any())->method('getWoeid')->will($this->returnValue(12726473));
     $forecastRepository = $this->getMockBuilder('\\Doctrine\\ORM\\EntityRepository')->setMethods(array('findOneBy'))->disableOriginalConstructor()->getMock();
     $forecastRepository->expects($this->any())->method('findOneBy')->will($this->returnValue(null));
     $entityManager = $this->getMockBuilder('\\Doctrine\\ORM\\EntityManager')->setMethods(array('getRepository', 'persist', 'flush'))->disableOriginalConstructor()->getMock();
     $entityManager->expects($this->any())->method('getRepository')->will($this->returnValue($forecastRepository));
     $entityManager->expects($this->any())->method('persist')->will($this->returnValue(null));
     $entityManager->expects($this->any())->method('flush')->will($this->returnValue(null));
     $historyManager = new HistoryManager($this->api, $entityManager);
     $today = $historyManager->getToday($cityWoeid);
     $date = new \DateTime();
     $this->assertNotNull($today);
     $this->assertInstanceOf('Th3Mouk\\YahooWeatherBundle\\Entity\\Forecast', $today);
     $this->assertTrue(is_int(intval($today->getLow())));
     $this->assertTrue(is_int(intval($today->getHigh())));
     $this->assertTrue(is_int(intval($today->getCode())));
     $this->assertSame($date->format('Y-m-d'), $today->getDate()->format('Y-m-d'));
 }
 public function getToday(City $city, $unit = 'c')
 {
     return $this->history_manager->getToday($city, $unit);
 }