Skip to content

Commit d63c79f

Browse files
committed
fixup! fixup! IBX-9446: [BO] Fatal error after non-translatable field added to Content Type - Added testcase
1 parent d69e51a commit d63c79f

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

tests/integration/Core/Persistence/Legacy/FileHandlerTest.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class FileHandlerTest extends RepositoryTestCase
1818
{
1919
public function testUpdateFields(): void
2020
{
21-
$contentService = self::getContentService();
21+
$contentService = self::getContentService();
2222
$contentTypeService = self::getContentTypeService();
2323

2424
// Create new ContentType
@@ -75,7 +75,8 @@ private function createFieldDefinitionStruct(string $identifier, string $name, b
7575
return $fieldDefCreateStruct;
7676
}
7777

78-
private function createTypeCreateStruct(): ContentTypeCreateStruct {
78+
private function createTypeCreateStruct(): ContentTypeCreateStruct
79+
{
7980
$contentTypeService = self::getContentTypeService();
8081
$typeCreateStruct = $contentTypeService->newContentTypeCreateStruct('multi_lang_drafts');
8182
$typeCreateStruct->mainLanguageCode = 'eng-GB';
@@ -84,7 +85,7 @@ private function createTypeCreateStruct(): ContentTypeCreateStruct {
8485
return $typeCreateStruct;
8586
}
8687

87-
protected function createNewContent(string $name, array $languages = ['eng-GB'], int $parentLocationId = 2, ): Content
88+
protected function createNewContent(string $name, array $languages = ['eng-GB'], int $parentLocationId = 2): Content
8889
{
8990
$contentTypeService = self::getContentTypeService();
9091
$contentService = self::getContentService();
@@ -103,7 +104,7 @@ protected function createNewContent(string $name, array $languages = ['eng-GB'],
103104
return $contentService->publishVersion($draft->versionInfo);
104105
}
105106

106-
protected function createUpdateStruct(Content $content, string $translatedName, array $languages )
107+
protected function createUpdateStruct(Content $content, string $translatedName, array $languages)
107108
{
108109
$contentService = self::getContentService();
109110

@@ -121,6 +122,7 @@ protected function createUpdateStruct(Content $content, string $translatedName,
121122

122123
$updateStruct->setField('name', $translatedName, $language);
123124
}
125+
124126
return $updateStruct;
125127
}
126128

@@ -131,6 +133,7 @@ protected function createContentDraft(Content $content, string $languageCode): C
131133

132134
$language = $contentLanguageService->loadLanguage($languageCode);
133135
$draft = $contentService->createContentDraft($content->contentInfo, null, null, $language);
136+
134137
return $draft;
135138
}
136139

@@ -142,7 +145,8 @@ protected function updateContent(Content $draft, ContentUpdateStruct $updateStru
142145
// it will have an additional field (in ger-DE). This does not happen when running the same code in
143146
// a controller inside the application (you then need to replace 'self::get*Service()' with DI).
144147
// It seems like for instance decoration Ibexa\Core\Event\ContentService is not used inside tests, maybe other decorations to?
145-
$updatedDraft = $contentService->updateContent($draft->versionInfo,$updateStruct);
148+
$updatedDraft = $contentService->updateContent($draft->versionInfo, $updateStruct);
149+
146150
return $updatedDraft;
147151
}
148-
}
152+
}

0 commit comments

Comments
 (0)