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


PHP InputInterface::expects方法代碼示例

本文整理匯總了PHP中Symfony\Component\Console\Input\InputInterface::expects方法的典型用法代碼示例。如果您正苦於以下問題:PHP InputInterface::expects方法的具體用法?PHP InputInterface::expects怎麽用?PHP InputInterface::expects使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Symfony\Component\Console\Input\InputInterface的用法示例。


在下文中一共展示了InputInterface::expects方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: ConfigurationHelper

 public function testConfigurationHelperWithoutConfigurationFromSetterAndWithoutOverrideFromCommandLineAndWithoutConfigInPath()
 {
     $this->input->expects($this->any())->method('getOption')->with('configuration')->will($this->returnValue(null));
     $configurationHelper = new ConfigurationHelper($this->connection, null);
     $migrationConfig = $configurationHelper->getMigrationConfig($this->input, $this->getOutputWriter());
     $this->assertInstanceOf('Doctrine\\DBAL\\Migrations\\Configuration\\Configuration', $migrationConfig);
     $this->assertStringMatchesFormat("", $this->getOutputStreamContent($this->output));
 }
開發者ID:rvdbogerd,項目名稱:migrations,代碼行數:8,代碼來源:ConfigurationHelperTest.php

示例2: prepareOptions

 protected function prepareOptions($publish = '', $config = '')
 {
     $this->inputMock->expects($this->any())->method('getOption')->will($this->returnCallback(function ($arg) use($publish, $config) {
         switch ($arg) {
             case 'publishPath':
                 return $publish;
             case 'configPath':
                 return $config;
         }
     }));
 }
開發者ID:dubpub,項目名稱:publisher,代碼行數:11,代碼來源:PublishFilterTest.php

示例3: setupEnvironment

 /**
  * @param string $cwd Current working directory
  * @param string $inputGet User specified path
  * @param bool $inputHas
  */
 protected function setupEnvironment($cwd, $inputGet, $inputHas = true)
 {
     $getcwd = $this->getFunctionMock('\\Phlib\\ConsoleConfiguration\\Helper', 'getcwd');
     $getcwd->expects($this->any())->will($this->returnValue($cwd));
     $this->input->expects($this->any())->method('hasOption')->will($this->returnValue($inputHas));
     $this->input->expects($this->any())->method('getOption')->will($this->returnValue($inputGet));
 }
開發者ID:phlib,項目名稱:console-configuration,代碼行數:12,代碼來源:ConfigurationHelperTest.php

示例4: setUp

 /**
  * Sets up the fixture, for example, open a network connection.
  * This method is called before a test is executed.
  *
  */
 protected function setUp()
 {
     parent::setUp();
     $this->prepareFolder();
     $this->inputMock = $this->getMock(InputInterface::class);
     $this->inputMock->expects($this->any())->method('isInteractive')->will($this->returnValue(true));
     $this->outputMock = $this->getMock(OutputInterface::class);
     $this->publisherScanner = new PublisherScanner();
     $this->publisherScanner->registerTypeHandler('php', \Dubpub\Publisher\Handlers\PHPHandler::class);
     $this->publisherScanner->registerTypeHandler('json', \Dubpub\Publisher\Handlers\JSONHandler::class);
     $this->publisherScanner->registerTypeHandler('ini', \Dubpub\Publisher\Handlers\INIHandler::class);
     $yamlHandler = new \Dubpub\Publisher\Handlers\YAMLHandler(new \Symfony\Component\Yaml\Parser(), new \Symfony\Component\Yaml\Dumper());
     $this->publisherScanner->registerTypeHandler('yml', $yamlHandler);
     $this->publisherScanner->registerTypeHandler('yaml', $yamlHandler);
     $this->testInstance = $this->getCommand($this->publisherScanner);
 }
開發者ID:dubpub,項目名稱:publisher,代碼行數:21,代碼來源:HelperTest.php

示例5: testQuietness

 /**
  * Test quietness
  *
  * @dataProvider dataQuietness
  */
 public function testQuietness($quiet, $noInteraction, $confirmation, $countWriteln, $countDescriber, $countClient, $countExecute)
 {
     $this->input->expects($this->any())->method('getOption')->will($this->returnValueMap(array(array('quiet', $quiet), array('no-interaction', $noInteraction))));
     $this->questionHelper->expects($this->any())->method('ask')->will($this->returnValue($confirmation));
     $this->output->expects($countWriteln)->method('writeln');
     $this->gearmanDescriber->expects($countDescriber)->method('describeJob')->will($this->returnValue('olakase'));
     $this->gearmanClient->expects($countClient)->method('getJob')->will($this->returnValue(array()));
     $this->gearmanExecute->expects($countExecute)->method('executeJob');
     $this->command->setGearmanClient($this->gearmanClient)->setGearmanDescriber($this->gearmanDescriber)->setGearmanExecute($this->gearmanExecute)->setKernel($this->kernel)->run($this->input, $this->output);
 }
開發者ID:WayOfBrave,項目名稱:GearmanBundle,代碼行數:15,代碼來源:GearmanJobExecuteCommandTest.php

示例6: prepareInput

 protected function prepareInput($badInput = false)
 {
     $this->inputMock->expects($this->any())->method('getArgument')->will($this->returnCallback(function () {
         switch ($agr = func_get_arg(0)) {
             case 'package':
             case 'group':
                 return '*';
             default:
                 var_dump($agr) || die;
         }
     }));
     $this->inputMock->expects($this->any())->method('getOption')->will($this->returnCallback(function () use($badInput) {
         switch ($agr = func_get_arg(0)) {
             case 'configPath':
             case 'publishPath':
                 return $badInput ? uniqid() : getcwd();
             default:
                 var_dump($agr) || die;
         }
     }));
 }
開發者ID:dubpub,項目名稱:publisher,代碼行數:21,代碼來源:PublishModelTest.php

示例7: testQuietness

 /**
  * Test quietness
  *
  * @dataProvider dataQuietness
  */
 public function testQuietness($quiet, $countWriteln)
 {
     $this->input->expects($this->any())->method('getOption')->will($this->returnValueMap(array(array('quiet', $quiet))));
     $this->output->expects($countWriteln)->method('writeln');
     $this->command->setGearmanClient($this->gearmanClient)->setKernel($this->kernel)->run($this->input, $this->output);
 }
開發者ID:MLKiiwy,項目名稱:GearmanBundle,代碼行數:11,代碼來源:GearmanWorkerListCommandTest.php

示例8: testRunNonQuiet

 /**
  * Test run without quietness
  */
 public function testRunNonQuiet()
 {
     $this->input->expects($this->any())->method('getOption')->will($this->returnValueMap(array(array('quiet', false))));
     $this->output->expects($this->any())->method('writeln');
     $this->command->run($this->input, $this->output);
 }
開發者ID:MLKiiwy,項目名稱:GearmanBundle,代碼行數:9,代碼來源:GearmanCacheWarmupCommandTest.php


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