当前位置: 首页>>代码示例>>PHP>>正文


PHP Application::find方法代码示例

本文整理汇总了PHP中Symfony\Bundle\FrameworkBundle\Console\Application::find方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::find方法的具体用法?PHP Application::find怎么用?PHP Application::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Symfony\Bundle\FrameworkBundle\Console\Application的用法示例。


在下文中一共展示了Application::find方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testExecute

 public function testExecute()
 {
     $expected = '/^.+ [a-z0-9]+@local.+api-key: [a-f0-9]+ secret: [a-f0-9]+$/';
     $commandTester = new CommandTester($this->instance->find('hayapi:create-user'));
     $commandTester->execute(array('username' => $this->userIdentifier, 'email' => $this->userIdentifier, 'password' => $this->userIdentifier), array('interactive'));
     $this->assertRegExp($expected, $commandTester->getDisplay());
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:7,代码来源:CreateUserCommandTest.php

示例2: testCompile

 public function testCompile()
 {
     $command = $this->application->find('help');
     $commandTester = new CommandTester($command);
     $commandTester->execute([], ['interactive' => false]);
     $this->assertTrue(true);
 }
开发者ID:aitboudad,项目名称:LoopBackApiBundle,代码行数:7,代码来源:SymfonyAppTest.php

示例3: testExecute

 public function testExecute()
 {
     $expected = '/^Hashing pid data/';
     $commandTester = new CommandTester($this->instance->find('haytool:pid-obfuscation'));
     $commandTester->execute(array());
     $this->assertRegExp($expected, $commandTester->getDisplay());
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:7,代码来源:PIDDataObfuscationCommandTest.php

示例4: testExecute

 public function testExecute()
 {
     $expected = 'Connection opened to foo:22/path/';
     $commandTester = new CommandTester($this->instance->find('haytool:file-upload'));
     $commandTester->execute(array());
     $this->assertStringStartsWith($expected, $commandTester->getDisplay());
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:7,代码来源:FileUploadCommandTest.php

示例5: testFixturesRegistering

 /**
  * @dataProvider loadCommandProvider
  *
  * @param array  $inputs
  * @param string $expected
  */
 public function testFixturesRegistering(array $inputs, $expected)
 {
     $command = $this->application->find('hautelook_alice:fixtures:load');
     $commandTester = new CommandTester($command);
     $commandTester->execute($inputs, ['interactive' => false]);
     $this->assertEquals(trim($expected, ' '), trim($commandTester->getDisplay(), ' '));
 }
开发者ID:Vowow,项目名称:AliceBundle,代码行数:13,代码来源:DoctrineFixtureTest.php

示例6: 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

示例7: testExecuteWithNoResults

 public function testExecuteWithNoResults()
 {
     $expected = 'No analytics results found for the period, have you completed the rollup?';
     $commandTester = new CommandTester($this->instance->find('analytics:daily-rollup'));
     $commandTester->execute(array());
     $display = $commandTester->getDisplay();
     $this->assertContains($expected, $display);
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:8,代码来源:DailyAnalyticRollupCommandTest.php

示例8: testSkipAllJob

 public function testSkipAllJob()
 {
     $this->mockCronHelper();
     $command = $this->application->find('oro:cron');
     $commandTester = new CommandTester($command);
     $commandTester->execute(array('command' => $command->getName(), '--skipCheckDaemon' => true));
     $result = $this->runCommand(CronCommand::COMMAND_NAME, []);
     $this->assertNotEmpty($result);
     $this->checkMessage('AllJobSkip', $result);
 }
开发者ID:startupz,项目名称:platform-1,代码行数:10,代码来源:CronCommandTest.php

示例9: commandExists

 /**
  * Indicates if a command exists
  *
  * @param string $command A command name (i.e.: cache:clear)
  * @return bool
  */
 public function commandExists($command)
 {
     try {
         $this->_app->find($command);
         $exists = true;
     } catch (InvalidArgumentException $e) {
         $exists = false;
     }
     return $exists;
 }
开发者ID:viscat,项目名称:PCCronManagerBundle,代码行数:16,代码来源:CommandValidator.php

示例10: testExecuteWeekly

 public function testExecuteWeekly()
 {
     $expected = '/^(\\w+\\s){5}\\d{4}-\\d{2}-\\d{2}T(00:){2}00\\+0{4}\\s\\w+\\s\\d{4}-\\d{2}-\\d{2}T23:59:59\\+0{4}/';
     $commandTester = new CommandTester($this->instance->find('analytics:prepare'));
     $commandTester->execute(array('--period' => PrepareAnalyticsCommand::OUTPUT_WEEKLY));
     $display = $commandTester->getDisplay();
     $this->assertRegExp($expected, $display);
     $this->assertContains(PrepareAnalyticsCommand::OUTPUT_WEEKLY, $display);
     $this->assertContains('Extracted information on 0 quiz starts', $display);
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:10,代码来源:PrepareAnalyticsCommandTest.php

示例11: testExecute

 public function testExecute()
 {
     $expectedUpdate = 'Updated county Bar with id 1';
     $expectedCreate = 'Created county Bar with id ' . PHP_INT_MAX;
     $path = 'phpunit.xml';
     $commandTester = new CommandTester($this->instance->find('haytool:lha-counties'));
     $commandTester->execute(array('path' => $path, 'includeFirstLine' => true));
     $this->assertStringStartsWith($expectedUpdate, $commandTester->getDisplay());
     $commandTester->execute(array('path' => $path, 'includeFirstLine' => true));
     $this->assertStringStartsWith($expectedCreate, $commandTester->getDisplay());
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:11,代码来源:ImportCountiesCommandTest.php

示例12: testExecute

 public function testExecute()
 {
     $expectedUpdate = 'Updated Authority for Bar with id 1';
     $expectedCreate = 'Created Authority for Bar with id ' . PHP_INT_MAX;
     $path = 'src/TransformCore/PHE/LocalHealthAuthorityBundle/Tests/Data/import.csv';
     $commandTester = new CommandTester($this->instance->find('haytool:lha-authority'));
     $commandTester->execute(array('path' => $path));
     $this->assertStringStartsWith($expectedUpdate, $commandTester->getDisplay());
     $commandTester->execute(array('path' => $path));
     $this->assertStringStartsWith($expectedCreate, $commandTester->getDisplay());
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:11,代码来源:ImportAuthorityCommandTest.php

示例13: testExecute

 public function testExecute()
 {
     $supervisor = $this->getMockBuilder('Supervisor\\Supervisor')->disableOriginalConstructor()->getMock();
     $supervisor->expects($this->any())->method('checkConnection')->willReturn(true);
     $supervisor->expects($this->any())->method('getName')->willReturn('niceNameFoo');
     $this->supervisorManager->expects($this->any())->method('getSupervisors')->willReturn(array($supervisor));
     $this->application->add(new SupervisorListCommand());
     $command = $this->application->find('abc:supervisor:list');
     $commandTester = new CommandTester($command);
     $commandTester->execute(array('command' => $command->getName()));
     $this->assertRegExp('/Instance: niceNameFoo/', $commandTester->getDisplay());
 }
开发者ID:aboutcoders,项目名称:supervisor-command-bundle,代码行数:12,代码来源:SupervisorListCommandTest.php

示例14: testExecute

 public function testExecute()
 {
     $application = new Application($this->kernel);
     $application->add(new QueueCreateCommand());
     $command = $application->find('jobqueue:create');
     $commandTester = new CommandTester($command);
     $commandTester->execute(array('command' => $command->getName(), 'queue-name' => 'my:queue1', '--timeout' => 10), array('interactive' => false));
     $application->add(new QueueDeleteCommand());
     $command = $application->find('jobqueue:delete');
     $commandTester = new CommandTester($command);
     $commandTester->execute(array('command' => $command->getName(), 'queue-name' => 'my:queue1'), array('interactive' => false));
     $this->assertRegExp('/Queue "my:queue1" deleted/', $commandTester->getDisplay(), 'Deleted queue');
 }
开发者ID:shinmen,项目名称:HeriJobQueueBundle,代码行数:13,代码来源:QueueDeleteCommandTest.php

示例15: testExecute

 /**
  * Test execute with all the options
  *
  * @group command
  */
 public function testExecute()
 {
     static::$application->add(new ImportTranslationsCommand());
     $command = static::$application->find("lexik:translations:import");
     $command->setContainer(static::$kernel->getContainer());
     $commandTester = new CommandTester($command);
     $commandTester->execute(array('command' => $command->getName(), 'bundle' => 'LexikTranslationBundle', '--cache-clear' => true, '--force' => true, '--locales' => array('en', 'fr')));
     $resultLines = explode("\n", $commandTester->getDisplay());
     $this->assertEquals('# LexikTranslationBundle:', $resultLines[0]);
     $this->assertLanguageDumped($resultLines[1]);
     $this->assertLanguageDumped($resultLines[2]);
     $this->assertEquals('Removing translations cache files ...', $resultLines[3]);
 }
开发者ID:sfmmo,项目名称:LexikTranslationBundle,代码行数:18,代码来源:ImportTranslationsCommandTest.php


注:本文中的Symfony\Bundle\FrameworkBundle\Console\Application::find方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。