[ "status" => true ] ]; $response = $this->graphQlMutation($query, [], '', []); $this->assertEquals($expected, $response, "Contact Us form can not be send"); } /** * Failed send contact us form - missing email */ public function testContactUsBadEmail() { $query = <<expectException(ResponseContainsErrorsException::class); $this->expectExceptionMessage( 'GraphQL response contains errors: The email address is invalid. Verify the email address and try again.' ); $this->graphQlMutation($query, [], '', []); } /** * Failed send contact us form - missing name */ public function testContactUsMissingName() { $query = <<expectException(ResponseContainsErrorsException::class); $this->expectExceptionMessage( 'GraphQL response contains errors: Field ContactUsInput.name of required type String! was not provided.' ); $this->graphQlMutation($query, [], '', []); } /** * Failed send contact us form - missing name */ public function testContactUsMissingComment() { $query = <<expectException(ResponseContainsErrorsException::class); $this->expectExceptionMessage( 'GraphQL response contains errors: Field ContactUsInput.comment of required type String! was not provided.' ); $this->graphQlMutation($query, [], '', []); } /** * Failed send contact us form - missing name */ #[ Config("contact/contact/enabled", "0") ] public function testContactUsDisabled() { $query = <<expectException(ResponseContainsErrorsException::class); $this->expectExceptionMessage('GraphQL response contains errors: The contact form is unavailable.'); $this->graphQlMutation($query, [], '', []); } }