當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。