Skip to content

Commit 68f1e90

Browse files
committed
testCreateContent: Changed expected message
1 parent a788be6 commit 68f1e90

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/lib/Base/Exceptions/ContentFieldValidationException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ public static function createNewWithMultiline(array $errors, ?string $contentNam
5959
$exception = new self($errors);
6060
$exception->contentName = $contentName;
6161

62-
$exception->setMessageTemplate('Content%contentName%fields did not validate: %errors%');
62+
$exception->setMessageTemplate('Content "%contentName%" fields did not validate: %errors%');
6363
$exception->setParameters([
6464
'%errors%' => $exception->generateValidationErrorsMessages(),
65-
'%contentName%' => $exception->contentName !== null ? ' "' . $exception->contentName . '" ' : ' ',
65+
'%contentName%' => $exception->contentName !== null ? $exception->contentName : '',
6666
]);
6767
$exception->message = $exception->getBaseTranslation();
6868

tests/lib/Repository/Service/Mock/ContentTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2503,7 +2503,7 @@ public function providerForTestCreateContentThrowsContentFieldValidationExceptio
25032503
public function testCreateContentThrowsContentFieldValidationException($mainLanguageCode, $structFields): void
25042504
{
25052505
$this->expectException(ContentFieldValidationException::class);
2506-
$this->expectExceptionMessage('Content fields did not validate');
2506+
$this->expectExceptionMessage('Content "" fields did not validate');
25072507

25082508
$fieldDefinitions = $this->fixturesForTestCreateContentNonRedundantFieldSetComplex();
25092509
list($contentCreateStruct, $allFieldErrors) =

0 commit comments

Comments
 (0)