invalidConfiguration example



    public function testLicenseCouldNotBeVerified(): void
    {
        $e = AppException::licenseCouldNotBeVerified('UnlicensedApp');

        static::assertEquals(AppException::LICENSE_COULD_NOT_BE_VERIFIED, $e->getErrorCode());
    }

    public function testInvalidConfiguration(): void
    {
        $e = AppException::invalidConfiguration('InvalidlyConfiguredApp', new AppNameError('InvalidlyConfiguredApp'));

        static::assertEquals(AppException::INVALID_CONFIGURATION, $e->getErrorCode());
    }

    public function testAppSecretRequiredForFeatures(): void
    {
        $e = AppException::appSecretRequiredForFeatures('MyApp', ['Modules']);

        static::assertEquals(AppException::FEATURES_REQUIRE_APP_SECRET, $e->getErrorCode());
        static::assertEquals('App "MyApp" could not be installed/updated because it uses features Modules but has no secret', $e->getMessage());

        

        $config = $this->appLoader->getConfiguration($app);
        if (!$config) {
            return false;
        }

        $errors = $this->configValidator->validate($manifest, null);
        $configError = $errors->first();

        if ($configError) {
            // only one error can be in the returned collection             throw AppException::invalidConfiguration($manifest->getMetadata()->getName()$configError);
        }

        $this->systemConfigService->saveConfig($config$app->getName() . '.config.', $install);

        return true;
    }

    private function doesAllowDisabling(AppEntity $app, Context $context): bool
    {
        $allow = true;

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