diff --git a/tests/lib/Base/Exception/ContentFieldValidationExceptionTest.php b/tests/lib/Base/Exception/ContentFieldValidationExceptionTest.php new file mode 100644 index 0000000000..e5ea72f6e5 --- /dev/null +++ b/tests/lib/Base/Exception/ContentFieldValidationExceptionTest.php @@ -0,0 +1,72 @@ + [ + 'eng-GB' => [ + new ValidationError('error 1'), new ValidationError('error 2'), + ], + 'pol-PL' => [ + new ValidationError('error 1'), new ValidationError('error 2'), + ], + ], + 456 => [ + 'pol-PL' => [ + new ValidationError('error 3'), new ValidationError('error 4'), + ], + 'eng-GB' => [ + new ValidationError('error 3'), new ValidationError('error 4'), + ], + ], + ]; + + $exception = new ContentFieldValidationException($errors); + + self::assertSame($errors, $exception->getFieldErrors()); + + return $exception; + } + + /** + * @depends testGetFieldErrors + */ + public function testCreateNewWithMultiline(ContentFieldValidationException $exception): void + { + $newException = ContentFieldValidationException::createNewWithMultiline( + $exception->getFieldErrors(), + 'My Content' + ); + + $expectedExceptionMessage = <<getMessage()); + } +}