diff --git a/zmsapi/src/Zmsapi/AvailabilityUpdate.php b/zmsapi/src/Zmsapi/AvailabilityUpdate.php index 20842db21..ad41218b8 100644 --- a/zmsapi/src/Zmsapi/AvailabilityUpdate.php +++ b/zmsapi/src/Zmsapi/AvailabilityUpdate.php @@ -1,7 +1,7 @@ createExample(); - + $currentTimestamp = time(); $input['startDate'] = $currentTimestamp + (2 * 24 * 60 * 60); // 2 days in the future $input['endDate'] = $currentTimestamp + (5 * 24 * 60 * 60); // 5 days in the future @@ -21,11 +21,22 @@ public function testRendering() $input['endTime'] = "17:00:00"; $input['scope'] = ["id" => 312]; $input['kind'] = "default"; - + + // Add day off data (this is the new part) + $input['dayoff'] = [ + "sunday" => "0", + "monday" => "0", + "tuesday" => "0", + "wednesday" => "0", + "thursday" => "0", + "friday" => "0", + "saturday" => "0" + ]; + $entity = (new Query())->writeEntity($input); error_log(json_encode($entity)); $this->setWorkstation(); - + $response = $this->render([ "id" => $entity->getId() ], [ @@ -39,18 +50,25 @@ public function testRendering() "startTime" => "09:00:00", "endTime" => "17:00:00", "kind" => "default", - "scope" => [ - "id" => 312 + "scope" => ["id" => 312], + "dayoff" => [ + "sunday" => "0", + "monday" => "0", + "tuesday" => "0", + "wednesday" => "0", + "thursday" => "0", + "friday" => "0", + "saturday" => "0" ] ] ], 'selectedDate' => date('Y-m-d') ]) ], []); - + $this->assertStringContainsString('availability.json', (string)$response->getBody()); $this->assertTrue(200 == $response->getStatusCode()); - } + } public function testEmpty()