public function testReadHolidayByDate() { $matchedHoliday = $this->holidayDao->readHolidayByDate('2010-05-27'); $this->assertTrue($matchedHoliday instanceof Holiday); $this->assertEquals(1, $matchedHoliday->getId()); $sriLanka = new OperationalCountry(); $sriLanka->setId(1); $sriLanka->setCountryCode('LK'); $matchedHoliday = $this->holidayDao->readHolidayByDate('2010-05-28', $sriLanka); $this->assertTrue($matchedHoliday instanceof Holiday); $this->assertEquals(2, $matchedHoliday->getId()); }
/** * @covers OperationalCountryService::getLocationsMappedToOperationalCountry */ public function testGetLocationsMappedToOperationalCountry_Success() { $locationList = array(); $locationList[] = new Location(); $locationList[] = new Location(); $locationList[] = new Location(); $sriLanka = new Country(); $sriLanka->setName('Sri Lanka'); $operationalCountry = new OperationalCountry(); $operationalCountry->setId(1); $operationalCountry->setCountry($sriLanka); $operationalCountry->setCountryCode('LK'); $operationalCountryDaoMock = $this->getMock('OperationalCountryDao', array('getLocationsMappedToOperationalCountry')); $operationalCountryDaoMock->expects($this->once())->method('getLocationsMappedToOperationalCountry')->will($this->returnValue($locationList)); $result = $this->service->setOperationalCountryDao($operationalCountryDaoMock); $result = $this->service->getLocationsMappedToOperationalCountry($operationalCountry); $this->assertEquals($locationList, $result); }