Skip to content

Commit f1fe98d

Browse files
committed
Pages API: Added extra test to cover type mismatch scenario
Related to #6136
1 parent c70b299 commit f1fe98d

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

tests/Api/PagesApiTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,19 @@ public function test_read_endpoint_returns_not_found()
200200
$this->assertSame(404, $resp->json('error')['code']);
201201
}
202202

203+
public function test_read_with_invalid_id_returns_not_found()
204+
{
205+
$this->actingAsApiEditor();
206+
$resp = $this->getJson($this->baseEndpoint . '/invalid-id');
207+
$resp->assertNotFound();
208+
$resp->assertJsonStructure([
209+
'error' => [
210+
'code',
211+
'message',
212+
],
213+
]);
214+
}
215+
203216
public function test_read_endpoint_includes_page_comments_tree_structure()
204217
{
205218
$this->actingAsApiEditor();

0 commit comments

Comments
 (0)