/** * @dataProvider dataProviderForTestIsLocationOpen1 */ public function testIsLocationOpen_working_hours_exist($expected, $date) { $location = new Paysera_WalletApi_Entity_Location(); $workingHours1 = new Paysera_WalletApi_Entity_Location_DayWorkingHours(); $workingHours1->setDay(Paysera_WalletApi_Entity_Location_DayWorkingHours::DAY_MONDAY); $workingHours1->setOpeningTime(new Paysera_WalletApi_Entity_Time(9, 0)); $workingHours1->setClosingTime(new Paysera_WalletApi_Entity_Time(18, 0)); $workingHours2 = new Paysera_WalletApi_Entity_Location_DayWorkingHours(); $workingHours2->setDay(Paysera_WalletApi_Entity_Location_DayWorkingHours::DAY_TUESDAY); $workingHours2->setOpeningTime(new Paysera_WalletApi_Entity_Time(9, 0)); $workingHours2->setClosingTime(new Paysera_WalletApi_Entity_Time(18, 0)); $workingHours4 = new Paysera_WalletApi_Entity_Location_DayWorkingHours(); $workingHours4->setDay(Paysera_WalletApi_Entity_Location_DayWorkingHours::DAY_THURSDAY); $workingHours4->setOpeningTime(new Paysera_WalletApi_Entity_Time(9, 0)); $workingHours4->setClosingTime(new Paysera_WalletApi_Entity_Time(18, 0)); $workingHours5 = new Paysera_WalletApi_Entity_Location_DayWorkingHours(); $workingHours5->setDay(Paysera_WalletApi_Entity_Location_DayWorkingHours::DAY_FRIDAY); $workingHours5->setOpeningTime(new Paysera_WalletApi_Entity_Time(22, 0)); $workingHours5->setClosingTime(new Paysera_WalletApi_Entity_Time(3, 0)); $workingHours7 = new Paysera_WalletApi_Entity_Location_DayWorkingHours(); $workingHours7->setDay(Paysera_WalletApi_Entity_Location_DayWorkingHours::DAY_SUNDAY); $workingHours7->setOpeningTime(new Paysera_WalletApi_Entity_Time(0, 0)); $workingHours7->setClosingTime(new Paysera_WalletApi_Entity_Time(0, 0)); $location->setWorkingHours(array($workingHours1, $workingHours2, $workingHours4, $workingHours5, $workingHours7)); $this->assertEquals($expected, $this->service->isLocationOpen($location, $date)); }