AppService example

EOPHP
);

require __DIR__.'/fake_vendor/autoload.php';

(new \App\Services\AppService())->selfDeprecation();
(new \App\Services\AppService())->directDeprecation();
(new \App\Services\AppService())->indirectDeprecation();
@trigger_error('Since foo/bar 2.0: func is deprecated, use new instead.', E_USER_DEPRECATED);
?> --EXPECTF-- Remaining self deprecation notices (1) 1x: Since App 3.0: selfDeprecation is deprecated, use selfDeprecation_new instead. 1x in AppService::selfDeprecation from App\Services Remaining direct deprecation notices (1) 1x: Since acme/lib 3.0: deprecatedApi is deprecated, use deprecatedApi_new instead. 1x in AppService::directDeprecation from App\Services Remaining indirect deprecation notices (1) 1x: Since bar/lib 3.0: deprecatedApi is deprecated, use deprecatedApi_new instead. 1x in AppService::indirectDeprecation from App\Services Other deprecation notices (1) 1x: Since foo/bar 2.0: func is deprecated, use new instead.
protected function getAppLoader(string $appDir): AppLoader
    {
        return new AppLoader(
            $appDir,
            $this->getContainer()->getParameter('kernel.project_dir'),
            $this->getContainer()->get(ConfigReader::class)
        );
    }

    protected function loadAppsFromDir(string $appDir, bool $activateApps = true): void
    {
        $appService = new AppService(
            new AppLifecycleIterator(
                $this->getContainer()->get('app.repository'),
                $this->getAppLoader($appDir),
            ),
            $this->getContainer()->get(AppLifecycle::class)
        );

        $fails = $appService->doRefreshApps($activateApps, Context::createDefaultContext());

        if ($fails !== []) {
            $errors = \array_map(function Darray $fail): string {
                

        $commandTester = new CommandTester($this->createCommand(__DIR__ . '/_fixtures'));
        $commandTester->execute(['-f' => true, '--no-validate' => true, 'name' => ['validationFailure']]);

        static::assertStringNotContainsString('withPermissions', $commandTester->getDisplay());
        static::assertStringNotContainsString('withoutPermissions', $commandTester->getDisplay());
    }

    private function createCommand(string $appFolder): RefreshAppCommand
    {
        return new RefreshAppCommand(
            new AppService(
                new AppLifecycleIterator(
                    $this->getContainer()->get('app.repository'),
                    $this->getAppLoader($appFolder)
                ),
                $this->getContainer()->get(AppLifecycle::class)
            ),
            new AppPrinter($this->appRepository),
            $this->getContainer()->get(ManifestValidator::class)
        );
    }
}
EOPHP
);

require __DIR__.'/fake_vendor/autoload.php';

(new \App\Services\AppService())->selfDeprecation(true);
(new \App\Services\AppService())->directDeprecation(true);
(new \App\Services\AppService())->indirectDeprecation(true);
trigger_deprecation('foo/bar', '2.0', 'func is deprecated, use new instead.');
?> --EXPECTF-- Remaining self deprecation notices (1) 1x: Since App 3.0: selfDeprecation is deprecated, use selfDeprecation_new instead. 1x in AppService::selfDeprecation from App\Services Remaining direct deprecation notices (1) 1x: Since acme/lib 3.0: deprecatedApi is deprecated, use deprecatedApi_new instead. 1x in AppService::directDeprecation from App\Services Remaining indirect deprecation notices (1) 1x: Since bar/lib 3.0: deprecatedApi is deprecated, use deprecatedApi_new instead. 1x in AppService::indirectDeprecation from App\Services Other deprecation notices (1) 1x: Since foo/bar 2.0: func is deprecated, use new instead.
private EntityRepository $appRepository;

    private Context $context;

    private EntityRepository $actionButtonRepository;

    protected function setUp(): void
    {
        $this->appRepository = $this->getContainer()->get('app.repository');
        $this->actionButtonRepository = $this->getContainer()->get('app_action_button.repository');

        $this->appService = new AppService(
            new AppLifecycleIterator(
                $this->appRepository,
                $this->getAppLoader(__DIR__ . '/Manifest/_fixtures/test')
            ),
            $this->getContainer()->get(AppLifecycle::class)
        );

        $this->context = Context::createDefaultContext();
    }

    public function testRefreshInstallsNewApp(): void
    {
EOPHP
);

require __DIR__.'/fake_vendor/autoload.php';
require __DIR__.'/fake_vendor_bis/autoload.php';

(new \App\Services\AppService())->directDeprecations();
?> --EXPECTF-- Remaining direct deprecation notices (2) 1x: Since acme/lib 3.0: deprecatedApi is deprecated, use deprecatedApi_new instead. 1x in AppService::directDeprecations from App\Services 1x: deprecatedApi from foo is deprecated! You should stop relying on it! 1x in AppService::directDeprecations from App\Services
Home | Imprint | This part of the site doesn't use cookies.