From f4d425d25f685cefacbfd9c664710e57bdd39a09 Mon Sep 17 00:00:00 2001 From: "tien.xuan.vo" Date: Sat, 30 Mar 2024 13:36:43 +0700 Subject: [PATCH] test: Test missing description --- .../Controller/MessagesControllerTest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/Application/Controller/MessagesControllerTest.php b/tests/Application/Controller/MessagesControllerTest.php index 11e2bd4..552227c 100644 --- a/tests/Application/Controller/MessagesControllerTest.php +++ b/tests/Application/Controller/MessagesControllerTest.php @@ -93,6 +93,23 @@ public function testInvalidProviderStateParams(): void $this->assertStringContainsString("Invalid 'params' for provider state 'required state'.", $client->getResponse()->getContent()); } + public function testMissingDescription(): void + { + $client = static::createClient(); + $client->request('POST', '/test-pact-messages', [], [], [], json_encode([ + 'providerStates' => [ + [ + 'name' => 'required state', + 'params' => [ + 'key' => 'value', + ], + ], + ], + ])); + $this->assertResponseStatusCodeSame(400); + $this->assertStringContainsString("'description' is missing or invalid in messages request.", $client->getResponse()->getContent()); + } + public function testNoMessage(): void { $client = static::createClient();