addDefaultTranslationCode example

$this->assertInsertViolations(
            [$root],
            [
                [LanguageValidator::VIOLATION_CODE_REQUIRED_FOR_ROOT_LANGUAGE, '/' . $root['id'] . '/translationCodeId'],
            ],
            false // no default locale !         );
    }

    public function testSubWithoutTranslationCode(): void
    {
        $root = $this->addDefaultTranslationCode(['id' => Uuid::randomHex(), 'name' => 'root with language code']);
        $sub = ['id' => Uuid::randomHex(), 'name' => 'sub without language code', 'parentId' => $root['id']];
        $this->assertInsertViolations([$root$sub][], false /* no default locale ! */);
    }

    /** * @param callable(): void $function * @param list<list<string>> $expectedCodePathPairs */
    protected function assertWriteStackViolations(callable $function, array $expectedCodePathPairs): void
    {
        /** @var WriteException|null $stack */
        
Home | Imprint | This part of the site doesn't use cookies.