From 304cc09d10ec42dd552fe6bcacbe343aa82e20db Mon Sep 17 00:00:00 2001 From: Lui Lui <40736418+lui01212@users.noreply.github.com> Date: Sun, 4 Oct 2026 10:11:35 +0700 Subject: [PATCH] test(client): cover autocomplete without a segment Add empty and non-empty suggestions without a segment to the unreadable response cases (T-4). Both must raise unexpected_response, as issue #5 asks. Signed-off-by: Lui Lui <40736418+lui01212@users.noreply.github.com> --- tests/Unit/Client/AutocompleteTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/Unit/Client/AutocompleteTest.php b/tests/Unit/Client/AutocompleteTest.php index fe35b75..841a53a 100644 --- a/tests/Unit/Client/AutocompleteTest.php +++ b/tests/Unit/Client/AutocompleteTest.php @@ -128,6 +128,8 @@ public static function unreadableBodies(): array 'a segment that is not one of the five' => [['segment' => 'zone', 'suggestions' => []]], 'a segment that is a number' => [['segment' => 3, 'suggestions' => []]], 'no suggestions field' => [['segment' => 'state']], + 'no segment field' => [['suggestions' => []]], + 'no segment field with suggestions' => [['suggestions' => [['code' => 'FC']]]], 'suggestions as an object' => [['segment' => 'state', 'suggestions' => ['a' => 1]]], 'a code that is a number' => [['segment' => 'lga', 'suggestions' => [['code' => 1]]]], 'a suggestion with no code' => [