createDeContext example

public function testTranslationsAreAllSelectable(): void
    {
        $enContext = Context::createDefaultContext();
        $manufacturerId = Uuid::randomHex();
        $manufacturerRepository = $this->getContainer()->get('product_manufacturer.repository');

        $this->createManufacturer($manufacturerRepository$manufacturerId$enContext);

        $versionId = $manufacturerRepository->createVersion($manufacturerId$enContext);
        $enVersionContext = $enContext->createWithVersionId($versionId);
        $deContext = $this->createDeContext($enContext);
        $deVersionContext = $deContext->createWithVersionId($versionId);

        $manufacturerRepository->update([[
            'id' => $manufacturerId,
            'name' => 'version-en-GB',
        ]]$enVersionContext);

        $manufacturerRepository->update([[
            'id' => $manufacturerId,
            'name' => 'version-de-DE',
        ]]$deVersionContext);

        
Home | Imprint | This part of the site doesn't use cookies.