本文整理匯總了PHP中Symfony\Bundle\FrameworkBundle\Console\Application::add方法的典型用法代碼示例。如果您正苦於以下問題:PHP Application::add方法的具體用法?PHP Application::add怎麽用?PHP Application::add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Symfony\Bundle\FrameworkBundle\Console\Application
的用法示例。
在下文中一共展示了Application::add方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: iRunSyliusInstallSampleDataCommand
/**
* @Given I run Sylius Install Load Sample Data command
*/
public function iRunSyliusInstallSampleDataCommand()
{
$this->application = new Application($this->kernel);
$this->application->add(new InstallSampleDataCommand());
$this->command = $this->application->find('sylius:install:sample-data');
$this->tester = new CommandTester($this->command);
}
示例2: setUp
protected function setUp()
{
$this->initClient();
$kernel = self::getContainer()->get('kernel');
$this->application = new Application($kernel);
$this->application->add(new CronCommand());
}
示例3: setUp
protected function setUp()
{
parent::setUp();
$this->application = new Application(self::getKernel());
$this->application->add(new LoadDataFixturesDoctrineCommand());
$this->application->add(new CreateSchemaDoctrineCommand());
$this->createDB();
}
示例4: setUp
protected function setUp()
{
$this->initClient();
$this->loadFixtures(['Oro\\Bundle\\CronBundle\\Tests\\Functional\\Command\\DataFixtures\\LoadScheduleData']);
$kernel = self::getContainer()->get('kernel');
$this->application = new Application($kernel);
$this->application->add(new CronCommand());
}
示例5: doSetUp
public function doSetUp()
{
/* @var \Modera\FileRepositoryBundle\Repository\FileRepository $fr */
self::$fileRepository = self::$container->get('modera_file_repository.repository.file_repository');
$repositoryConfig = array('filesystem' => 'dummy_tmp_fs', 'interceptors' => [Interceptor::ID], 'thumbnail_sizes' => array(array('width' => 215, 'height' => 285), array('width' => 32, 'height' => 32)));
self::$fileRepository->createRepository('dummy_repo1', $repositoryConfig, 'Bla bla');
$this->application = new Application(self::$container->get('kernel'));
$this->application->add(new GenerateThumbnailsCommand());
}
示例6: setUp
public function setUp()
{
$this->buildDir = new vfsStreamDirectory('build');
vfsStreamWrapper::register();
vfsStreamWrapper::setRoot($this->buildDir);
$this->filesystem = m::mock('Symfony\\Component\\Filesystem\\Filesystem');
$this->application = new Application($this->getMockKernel());
$this->application->add(new CleanCommand($this->filesystem, $this->buildDir->url()));
}
示例7: setUp
protected function setUp()
{
parent::setUp();
$this->createKernel();
$this->bootKernel();
$this->application = new Application(self::$kernel);
$this->application->add(new SchedulerCommand());
$this->queue = $this->container->get('syrup.queue_factory')->get(KeboolaOrchestratorBundle::SYRUP_COMPONENT_NAME);
}
示例8: setUp
public function setUp()
{
$kernel = \Mockery::mock('Symfony\\Component\\HttpKernel\\Kernel')->shouldIgnoreMissing();
$kernel->shouldReceive('getKernel')->withAnyArgs()->andReturnSelf();
$kernel->shouldReceive('getContainer')->withAnyArgs()->andReturnSelf();
$kernel->shouldReceive('get')->with('transformcore.phe.analytics.extractor')->andReturn($this->mockExtractionService());
$kernel->shouldReceive('get')->withAnyArgs()->andReturnSelf();
$this->instance = new Application($kernel);
$this->instance->add(new DailyDataExtractCommand());
}
示例9: setUp
public function setUp()
{
$kernel = \Mockery::mock('Symfony\\Component\\HttpKernel\\Kernel')->shouldIgnoreMissing();
$kernel->shouldReceive('getKernel')->withAnyArgs()->andReturnSelf();
$kernel->shouldReceive('getContainer')->withAnyArgs()->andReturnSelf();
$kernel->shouldReceive('get')->with('transformcore.phe.hayapi.questionnaire')->andReturn($this->mockQuestionnaireService());
$kernel->shouldReceive('get')->withAnyArgs()->andReturnSelf();
$this->instance = new Application($kernel);
$this->instance->add(new ExpireDeadQuizCommand());
}
示例10: setUp
protected function setUp()
{
parent::setUp();
$this->createKernel();
$this->bootKernel();
$this->application = new Application(self::$kernel);
$this->application->add(new JobCommand());
$this->syrupJobMapper = $this->container->get('syrup.elasticsearch.current_component_job_mapper');
//->get(KeboolaOrchestratorBundle::SYRUP_COMPONENT_NAME);
}
示例11: setUp
protected function setUp()
{
self::bootKernel();
$this->application = new Application(self::$kernel);
// Register doctrine bundles
$this->application->add(new LoadDataFixturesCommand($this->application->getKernel()->getContainer()->get('doctrine'), $this->application->getKernel()->getContainer()->get('hautelook_alice.fixtures.loader'), $this->application->getKernel()->getContainer()->get('hautelook_alice.doctrine.finder')));
$this->doctrineManager = $this->application->getKernel()->getContainer()->get('doctrine')->getManager();
$this->application->setAutoExit(false);
$this->runConsole("doctrine:schema:drop", ["--force" => true]);
$this->runConsole("doctrine:schema:create");
}
示例12: setUp
public function setUp()
{
$kernel = \Mockery::mock('Symfony\\Component\\HttpKernel\\Kernel')->shouldDeferMissing();
$kernel->shouldReceive('getKernel')->withAnyArgs()->andReturnSelf();
$kernel->shouldReceive('getContainer')->withAnyArgs()->andReturnSelf();
$kernel->shouldReceive('get')->withAnyArgs()->andReturnSelf();
$kernel->shouldReceive('saveCounty')->once()->withAnyArgs()->andReturn((new County('Foo', 'Bar'))->setLastUpdated(new \DateTime())->setId(1));
$kernel->shouldReceive('saveCounty')->withAnyArgs()->andReturn((new County('Foo', 'Bar'))->setId(PHP_INT_MAX));
$this->instance = new Application($kernel);
$this->instance->add(new ImportCountiesCommand());
}
示例13: setUp
/**
* SetUp called before each tests, setting up the environment (application, globally used mocks)
*/
public function setUp()
{
$kernel = $this->getMockBuilder('\\Symfony\\Component\\HttpKernel\\Kernel')->disableOriginalConstructor()->getMock();
$this->application = new Application($kernel);
$this->predisClient = $this->getMock('\\Predis\\Client');
$this->phpredisClient = $this->getMockBuilder('\\Snc\\RedisBundle\\Client\\Phpredis\\Client')->disableOriginalConstructor()->getMock();
$this->container = $this->getMock('\\Symfony\\Component\\DependencyInjection\\ContainerInterface');
$command = $this->getCommand();
$this->application->add($command);
$command->setContainer($this->container);
}
示例14: setUp
public function setUp()
{
$kernel = \Mockery::mock('Symfony\\Component\\HttpKernel\\Kernel')->shouldIgnoreMissing();
$kernel->shouldReceive('getKernel')->withAnyArgs()->andReturnSelf();
$kernel->shouldReceive('getContainer')->withAnyArgs()->andReturnSelf();
$kernel->shouldReceive('get')->with('transformcore.phe.exporter.datahashing')->andReturn(\Mockery::mock('TransformCore\\PHE\\ExporterBundle\\Service\\DataObfuscationService')->shouldIgnoreMissing());
$kernel->shouldReceive('get')->with('transformcore.phe.hayapi.questionnaire')->andReturn($this->mockQuestionnaireService());
$kernel->shouldReceive('get')->with('logger')->andReturn(\Mockery::mock('Psr\\Log\\LoggerInterface')->shouldIgnoreMissing());
$this->instance = new Application($kernel);
$this->instance->add(new PIDDataObfuscationCommand());
}
示例15: setUp
public function setUp()
{
$kernel = \Mockery::mock('Symfony\\Component\\HttpKernel\\Kernel')->shouldIgnoreMissing();
$kernel->shouldReceive('getKernel')->withAnyArgs()->andReturnSelf();
$kernel->shouldReceive('getContainer')->withAnyArgs()->andReturnSelf();
$kernel->shouldReceive('get')->with('transformcore.phe.exporter.upload')->andReturn($this->mockUploadService());
$kernel->shouldReceive('get')->with('export_path')->andReturn('exports');
$kernel->shouldReceive('get')->withAnyArgs()->andReturnSelf();
$this->instance = new Application($kernel);
$this->instance->add(new FileUploadCommand());
}