From 0bec49c89eb76af55614bac0294db719acc23840 Mon Sep 17 00:00:00 2001 From: Jim Seconde Date: Tue, 2 Jul 2024 14:38:12 +0100 Subject: [PATCH] Add a basic test for the validation client due to codecov --- test/Client/Exception/Validation.php | 35 ++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 test/Client/Exception/Validation.php diff --git a/test/Client/Exception/Validation.php b/test/Client/Exception/Validation.php new file mode 100644 index 00000000..4fafd8dc --- /dev/null +++ b/test/Client/Exception/Validation.php @@ -0,0 +1,35 @@ + 'Error message 1', + 'field2' => 'Error message 2' + ]; + + $exception = new Validation($message, $code, $previous, $errors); + + // Assert the exception message + $this->assertEquals($message, $exception->getMessage()); + + // Assert the exception code + $this->assertEquals($code, $exception->getCode()); + + // Assert the previous exception + $this->assertSame($previous, $exception->getPrevious()); + + // Assert the validation errors + $this->assertEquals($errors, $exception->getValidationErrors()); + } +}