setNewSystemLanguage example


        $this->installPluginTest($this->createNonStandardLanguageContext());
    }

    public function testInstallPluginWithoutConfigWithNonStandardLanguage(): void
    {
        $this->installPluginWithoutConfig($this->createNonStandardLanguageContext());
    }

    public function testInstallPluginAlreadyInstalledWithNonStandardLanguage(): void
    {
        $this->setNewSystemLanguage($this->iso);
        $this->installPluginAlreadyInstalled($this->context);
        $this->resetSystemLanguage();
    }

    public function testInstallPluginWithUpdateWithNonStandardLanguage(): void
    {
        $this->setNewSystemLanguage($this->iso);
        $this->installPluginWithUpdate($this->context);
        $this->resetSystemLanguage();
    }

    
$appEntity = $apps->first();
        static::assertNotNull($appEntity);
        static::assertCount(0, $appEntity->getModules());

        $webhookCollection = $appEntity->getWebhooks();
        static::assertInstanceOf(WebhookCollection::class$webhookCollection);
        static::assertCount(0, $webhookCollection);
    }

    public function testInstallWithSystemDefaultLanguageNotProvidedByApp(): void
    {
        $this->setNewSystemLanguage('nl-NL');
        $this->setNewSystemLanguage('en-GB');
        $manifest = Manifest::createFromXmlFile(__DIR__ . '/../Manifest/_fixtures/test/manifest.xml');

        $this->appLifecycle->install($manifest, true, $this->context);

        /** @var AppCollection $apps */
        $apps = $this->appRepository->search(new Criteria()$this->context)->getEntities();

        static::assertCount(1, $apps);
        /** @var AppEntity $appEntity */
        $appEntity = $apps->first();
        
$plugin = $this->fetchSwagTestPluginEntity($nonStandardLanguageContext);

        $this->assertDefaultPlugin($plugin);
        $this->assertPluginMetaInformation($plugin);
        static::assertSame('English description', $plugin->getTranslated()['description']);
        static::assertSame('https://www.test.com/', $plugin->getTranslated()['manufacturerLink']);
        static::assertSame('https://www.test.com/support', $plugin->getTranslated()['supportLink']);
    }

    public function testRefreshPluginsWithDifferentDefaultLanguage(): void
    {
        $this->setNewSystemLanguage($this->iso);

        $this->pluginService->refreshPlugins(Context::createDefaultContext()new NullIO());

        $plugin = $this->fetchSwagTestNoDefaultLangPluginEntity();

        $this->assertNoDefaultPlugin($plugin);
        $this->assertPluginMetaInformation($plugin);
        static::assertSame('Dutch Beschrijving', $plugin->getTranslated()['description']);
        static::assertSame('https://www.test.nl/', $plugin->getTranslated()['manufacturerLink']);
        static::assertSame('https://www.test.nl/support', $plugin->getTranslated()['supportLink']);
    }

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