Skip to content

Commit

Permalink
Add testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
reithor committed Nov 18, 2024
1 parent 02200e6 commit 8f93363
Showing 1 changed file with 32 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/
namespace Ibexa\Tests\Integration\Core\Repository;

use Ibexa\Contracts\Core\Repository\Values\Content\Content;
use Ibexa\Contracts\Core\Test\Repository\SetupFactory\Legacy as LegacySetupFactory;

/**
Expand All @@ -15,7 +16,7 @@
* @group integration
* @group language
*/
class LanguageServiceMaximumSupportedLanguagesTest extends BaseTest
class LanguageServiceMaximumSupportedLanguagesTest extends BaseContentServiceTest
{
/** @var \Ibexa\Contracts\Core\Repository\LanguageService */
private $languageService;
Expand Down Expand Up @@ -89,6 +90,36 @@ public function testCreateMaximumLanguageLimit()

$this->languageService->createLanguage($languageCreate);
}

/**
* Test creating a draft having max number of languages.
*
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException
*/
public function testCreateContentHavingMaximumLanguageCount()
{
$repository = $this->getRepository();
$contentService = $repository->getContentService();

$nameFieldValue = [];
foreach ($this->languageService->loadLanguages() as $key => $language) {
$nameFieldValue[$language->languageCode] = 'Name ' . $language->languageCode;
}
$draft = $this->createMultilingualContentDraft(
'folder',
2,
'eng-US',
[
'name' => $nameFieldValue,
]
);

$contentService->deleteContent($draft->contentInfo);
$this->assertInstanceOf(
Content::class,
$draft
);
}
}

class_alias(LanguageServiceMaximumSupportedLanguagesTest::class, 'eZ\Publish\API\Repository\Tests\LanguageServiceMaximumSupportedLanguagesTest');

0 comments on commit 8f93363

Please sign in to comment.