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();