Skip to content

Commit

Permalink
chore(ZMS-3235): fix zmsapi unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabinatix97 committed Feb 24, 2025
1 parent 6faa29a commit 8217a4d
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 30 deletions.
20 changes: 16 additions & 4 deletions zmsapi/tests/Zmsapi/AvailabilityAddTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,26 @@ public function testRendering()
"id": 21202,
"description": "Test Öffnungszeit update",
"scope": {
"id": 312
}
"id": 312,
"provider": {
"id": 123456,
"name": "Flughafen Schönefeld, Aufsicht",
"source": "dldb"
},
"shortName": "Zentrale"
},
},
{
"description": "Test Öffnungszeit ohne id",
"scope": {
"id": 141
}
"id": 141,
"provider": {
"id": 123456,
"name": "Flughafen Schönefeld, Aufsicht",
"source": "dldb"
},
"shortName": "Zentrale"
},
}
]'
], []);
Expand Down
26 changes: 19 additions & 7 deletions zmsapi/tests/Zmsapi/AvailabilitySlotsUpdateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@ public function testRendering()
"id": 21202,
"description": "Test Öffnungszeit update",
"scope": {
"id": 312
}
"id": 312,
"provider": {
"id": 123456,
"name": "Flughafen Schönefeld, Aufsicht",
"source": "dldb"
},
"shortName": "Zentrale"
},
}
]'
], []);
Expand Down Expand Up @@ -49,11 +55,17 @@ public function testNotFound()
$this->render([], [
'__body' => '[
{
"id": 99999,
"description": "Test Öffnungszeit not found",
"scope": {
"id": 312
}
"id": 99999,
"description": "Test Öffnungszeit not found",
"scope": {
"id": 312,
"provider": {
"id": 123456,
"name": "Flughafen Schönefeld, Aufsicht",
"source": "dldb"
},
"shortName": "Zentrale"
},
}
]',
'migrationfix' => 0
Expand Down
36 changes: 24 additions & 12 deletions zmsapi/tests/Zmsapi/AvailabilityUpdateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,18 @@ public function testRendering()
$this->setWorkstation();
$response = $this->render(["id"=> $entity->getId()], [
'__body' => '{
"id": '. $entity->getId() .',
"description": "",
"scope": {
"id": 312
}
}'
"id": '. $entity->getId() .',
"description": "",
"scope": {
"id": 312,
"provider": {
"id": 123456,
"name": "Flughafen Schönefeld, Aufsicht",
"source": "dldb"
},
"shortName": "Zentrale"
},
}'
], []);
$this->assertStringContainsString('availability.json', (string)$response->getBody());
$this->assertTrue(200 == $response->getStatusCode());
Expand All @@ -42,12 +48,18 @@ public function testNotFound()
$this->expectExceptionCode(404);
$this->render(["id"=> 1], [
'__body' => '{
"id": 1,
"description": "Test Öffnungszeit not found",
"scope": {
"id": 312
}
}'
"id": 1,
"description": "Test Öffnungszeit not found",
"scope": {
"id": 312,
"provider": {
"id": 123456,
"name": "Flughafen Schönefeld, Aufsicht",
"source": "dldb"
},
"shortName": "Zentrale"
},
}'
], []);
}
}
8 changes: 4 additions & 4 deletions zmsapi/tests/Zmsapi/CounterGhostWorkstationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ public function testRendering()
$workstation->scope['id'] = 146; //ghostworkstation count 3
$response = $this->render([], [
'__body' => '{
"id": "146",
"id": 146,
"shortName": "",
"provider": {
"id": "122217",
"id": 122217,
"displayName": "B\u00fcrgeramt Heerstra\u00dfe",
"$ref": "/provider/122217/"
},
Expand Down Expand Up @@ -65,10 +65,10 @@ public function testNotFound()
$this->expectExceptionCode(404);
$this->render([], [
'__body' => '{
"id": "999",
"id": 999,
"shortName": "",
"provider": {
"id": "122217",
"id": 122217,
"displayName": "B\u00fcrgeramt Heerstra\u00dfe",
"$ref": "/provider/122217/"
}
Expand Down
4 changes: 2 additions & 2 deletions zmsapi/tests/Zmsapi/MailAddTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ public function testUnvalidInput()
"createTimestamp": 1447931596000,
"multipart": [
{
"queueId": "1234",
"queueId": 1234,
"mime": "text/html",
"content": "<h1>Title</h1><p>Message</p>",
"base64": false
},
{
"queueId": "1234",
"queueId": 1234,
"mime": "text/plain",
"content": "Title\nMessage",
"base64": false
Expand Down
2 changes: 1 addition & 1 deletion zmsapi/tests/Zmsapi/fixtures/GetScope_lessData.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"id": 122217,
"source": "dldb",
"$ref": "/provider/122217/",
"displayName":"001"
"displayName": "001"
}
}
9 changes: 9 additions & 0 deletions zmsapi/tests/Zmsapi/fixtures/PostAppointment.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@
},
"availability": {
"id": 0,
"scope": {
"id": 141,
"provider": {
"id": 123456,
"name": "Flughafen Schönefeld, Aufsicht",
"source": "dldb"
},
"shortName": "Zentrale"
},
"weekday": {
"sunday": 0,
"monday": 0,
Expand Down

0 comments on commit 8217a4d

Please sign in to comment.