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


PHP DialogHelper::expects方法代码示例

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


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

示例1: testExecute

 public function testExecute()
 {
     $this->dialog->expects($this->at(0))->method('askAndValidate')->will($this->returnValue('test@example.com'));
     $this->dialog->expects($this->at(1))->method('ask')->will($this->returnValue('A name'));
     $this->dialog->expects($this->at(2))->method('askHiddenResponse')->will($this->returnValue('foobar123'));
     $commandTester = $this->getCommandTester();
     $commandTester->execute([]);
     $this->assertEquals('User account created!' . PHP_EOL, $commandTester->getDisplay());
 }
开发者ID:stefanius,项目名称:phpci-box,代码行数:9,代码来源:CreateAdminCommandTest.php

示例2: 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->dialogHelper->expects($this->any())->method('askConfirmation')->will($this->returnValue($confirmation));
     $this->output->expects($countWriteln)->method('writeln');
     $this->gearmanDescriber->expects($countDescriber)->method('describeWorker');
     $this->gearmanClient->expects($countClient)->method('getWorker')->will($this->returnValue(array()));
     $this->gearmanExecute->expects($countExecute)->method('executeWorker');
     $this->command->setGearmanClient($this->gearmanClient)->setGearmanDescriber($this->gearmanDescriber)->setGearmanExecute($this->gearmanExecute)->setKernel($this->kernel)->run($this->input, $this->output);
 }
开发者ID:MLKiiwy,项目名称:GearmanBundle,代码行数:15,代码来源:GearmanWorkerExecuteCommandTest.php

示例3:

 /**
  * @test
  */
 function it_can_ask_a_question_and_return_the_result()
 {
     $this->dialogHelper->expects($this->once())->method('askConfirmation')->with($this->identicalTo($this->output), 'Are you sure?', true)->willReturn(true);
     $result = $this->prompter->askConfirmation('Are you sure?');
     $this->assertEquals(true, $result);
 }
开发者ID:qasem2rubik,项目名称:laravel,代码行数:9,代码来源:DialogTest.php

示例4: addFinishingExpects

 /**
  * Ads answers to the last questions
  *
  * @param DialogHelper $dialog
  * @param int          $startAt at what position do we expect the first question
  */
 protected function addFinishingExpects(DialogHelper $dialog, &$startAt)
 {
     //Do you want to install the QA tools for Javascript? [Y/n]
     $dialog->expects($this->at($startAt++))->method('askConfirmation')->with($this->anything(), $this->equalTo("\nDo you want to install the QA tools for Javascript?"))->will($this->returnValue(true));
     $dialog->expects($this->at($startAt++))->method('askConfirmation')->with($this->anything(), $this->equalTo('Do you want to enable JSHint?'))->will($this->returnValue(false));
     $dialog->expects($this->at($startAt++))->method('askConfirmation')->with($this->anything(), $this->equalTo("\nDo you want to install the Behat framework?"))->will($this->returnValue(true));
     $dialog->expects($this->at($startAt++))->method('askAndValidate')->with($this->anything(), $this->equalTo("What is base url of your application? [http://www.ibuildings.nl] "))->will($this->returnValue('http://test'));
     $dialog->expects($this->at($startAt++))->method('askAndValidate')->with($this->anything(), $this->equalTo("What is base url of the ci environment? [http://ci.test] "))->will($this->returnValue('http://ci.test'));
     $dialog->expects($this->at($startAt++))->method('askAndValidate')->with($this->anything(), $this->equalTo("What is base url of the dev environment? [http://dev.test] "))->will($this->returnValue('http://dev.test'));
     $dialog->expects($this->at($startAt++))->method('askConfirmation')->with($this->anything(), $this->equalTo("\nDo you want to enable the git pre-commit hook? It will run the QA tools on every commit"))->will($this->returnValue(true));
 }
开发者ID:thangnvaltplus,项目名称:qa-tools-1,代码行数:17,代码来源:InstallCommandTest.php


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