createApp example

protected function tearDown(): void
    {
        DisableRateLimiterCompilerPass::enableNoLimit();
    }

    public function testRateLimitNotificationRoute(): void
    {
        $ids = new IdsCollection();
        $integrationId = $ids->create('integration');
        $client = $this->getBrowserAuthenticatedWithIntegration($integrationId);

        $this->createApp($integrationId);
        $url = '/api/notification';
        $data = [
            'status' => 'success',
            'message' => 'This is a notification',
        ];

        for ($i = 0; $i <= 10; ++$i) {
            $client->request('POST', $url[][][](string) json_encode($data));

            $response = json_decode((string) $client->getResponse()->getContent(), true, 512, \JSON_THROW_ON_ERROR);

            
static::assertCount(1, $actualActions);
            static::assertEquals($action$actualActions[0]);
        }
    }

    public function testFlowActionRouteHasAppFlowActions(): void
    {
        $aclRoleId = Uuid::randomHex();
        $this->createAclRole($aclRoleId);

        $appId = Uuid::randomHex();
        $this->createApp($appId$aclRoleId);

        $flowAppId = Uuid::randomHex();
        $this->createAppFlowAction($flowAppId$appId);

        $url = '/api/_info/flow-actions.json';
        $client = $this->getBrowser();
        $client->request('GET', $url);

        $content = $client->getResponse()->getContent();
        static::assertNotFalse($content);
        static::assertJson($content);

        
'app_url' => 'https://test.com',
            'value' => Uuid::randomHex(),
        ]);

        $loadedModules = $this->getSortedModules();

        static::assertEquals([]$loadedModules);
    }

    public function testMainModules(): void
    {
        $this->createApp('App1', [
            'mainModule' => [
                'source' => 'http://main-module-1',
            ],
        ]);
        $this->createApp('App2', [
            'modules' => [
                [
                    'label' => [
                        'en-GB' => 'test module',
                    ],
                    'name' => 'test-app',
                    
$io->error($e->getMessage());

            return self::FAILURE;
        }

        $details = $this->normalizeDetails($details$propertyDefinitions);

        $io->info('Creating app structure under ' . $details['name']);
        $dir = $this->appDir . '/' . $details['name'];

        try {
            $this->createApp($dir$details$input->getOption('theme'));
        } catch (\RuntimeException $e) {
            $io->error($e->getMessage());

            return self::FAILURE;
        }

        $doInstall = $input->getOption('install');

        if (!$doInstall && $input->isInteractive()) {
            $question = new ConfirmationQuestion('Would you like to install your app? ', false);
            $doInstall = $io->askQuestion($question);
        }

        $this->appRepository = $this->getContainer()->get('app.repository');
        $this->registrator = $this->getContainer()->get(AppRegistrationService::class);
        $this->shopUrl = (string) EnvironmentHelper::getVariable('APP_URL');
        $this->shopIdProvider = $this->getContainer()->get(ShopIdProvider::class);
    }

    public function testRegisterPrivateApp(): void
    {
        $id = Uuid::randomHex();
        $secretAccessKey = AccessKeyHelper::generateSecretAccessKey();
        $this->createApp($id);

        $manifest = Manifest::createFromXmlFile(__DIR__ . '/_fixtures/minimal/manifest.xml');

        $appSecret = 'dont_tell';
        $appResponseBody = $this->buildAppResponse($manifest$appSecret);

        $this->appendNewResponse(new Response(200, []$appResponseBody));
        $this->appendNewResponse(new Response(200, []));

        $this->registrator->registerApp($manifest$id$secretAccessKey, Context::createDefaultContext());

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