當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Application::add方法代碼示例

本文整理匯總了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);
 }
開發者ID:sylius,項目名稱:sylius,代碼行數:10,代碼來源:InstallerContext.php

示例2: setUp

 protected function setUp()
 {
     $this->initClient();
     $kernel = self::getContainer()->get('kernel');
     $this->application = new Application($kernel);
     $this->application->add(new CronCommand());
 }
開發者ID:ramunasd,項目名稱:platform,代碼行數:7,代碼來源:CronCommandTest.php

示例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();
 }
開發者ID:przemekkot,項目名稱:Quiz-App-Symfony-Kata,代碼行數:8,代碼來源:DoctrineFixtureTest.php

示例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());
 }
開發者ID:startupz,項目名稱:platform-1,代碼行數:8,代碼來源:CronCommandTest.php

示例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());
 }
開發者ID:modera,項目名稱:foundation,代碼行數:9,代碼來源:GenerateThumbnailsCommandTest.php

示例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()));
 }
開發者ID:braincrafted,項目名稱:static-site-bundle,代碼行數:9,代碼來源:CleanCommandTest.php

示例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);
 }
開發者ID:keboola,項目名稱:orchestrator-bundle,代碼行數:9,代碼來源:SchedulerCommandTest.php

示例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());
 }
開發者ID:TransformCore,項目名稱:HayPersistenceApi,代碼行數:10,代碼來源:DailyDataExtractCommandTest.php

示例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());
 }
開發者ID:TransformCore,項目名稱:HayPersistenceApi,代碼行數:10,代碼來源:ExpireDeadQuizCommandTest.php

示例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);
 }
開發者ID:keboola,項目名稱:orchestrator-bundle,代碼行數:10,代碼來源:JobCommandTest.php

示例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");
 }
開發者ID:Vowow,項目名稱:AliceBundle,代碼行數:11,代碼來源:DoctrineFixtureTest.php

示例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());
 }
開發者ID:TransformCore,項目名稱:HayPersistenceApi,代碼行數:11,代碼來源:ImportCountiesCommandTest.php

示例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);
 }
開發者ID:headzoo,項目名稱:redis-bundle,代碼行數:14,代碼來源:CommandTestCase.php

示例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());
 }
開發者ID:TransformCore,項目名稱:HayPersistenceApi,代碼行數:11,代碼來源:PIDDataObfuscationCommandTest.php

示例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());
 }
開發者ID:TransformCore,項目名稱:HayPersistenceApi,代碼行數:11,代碼來源:FileUploadCommandTest.php


注:本文中的Symfony\Bundle\FrameworkBundle\Console\Application::add方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。