BaseApplication example

$filename = tempnam(sys_get_temp_dir().'/yml-lint-test', 'sf-');
        file_put_contents($filename$content);

        $this->files[] = $filename;

        return $filename;
    }

    private function createCommandTester($application = null): CommandTester
    {
        if (!$application) {
            $application = new BaseApplication();
            $application->add(new YamlLintCommand());
        }

        $command = $application->find('lint:yaml');

        if ($application) {
            $command->setApplication($application);
        }

        return new CommandTester($command);
    }

    
'filename' => '@AppBundle/Resources'],
            ['verbosity' => OutputInterface::VERBOSITY_VERBOSE, 'decorated' => false]
        );

        $tester->assertCommandIsSuccessful('Returns 0 in case of success');
        $this->assertStringContainsString('[OK] All 0 XLIFF files contain valid syntax', trim($tester->getDisplay()));
    }

    private function createCommandTester($application = null): CommandTester
    {
        if (!$application) {
            $application = new BaseApplication();
            $application->add(new XliffLintCommand());
        }

        $command = $application->find('lint:xliff');

        if ($application) {
            $command->setApplication($application);
        }

        return new CommandTester($command);
    }

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