コード例 #1
0
ファイル: LogClearTest.php プロジェクト: aaleksu/bolt_cm
 public function testRun()
 {
     $app = $this->getApp();
     $command = new LogClear($app);
     $dialog = new DialogHelper();
     $dialog->setInputStream($this->getInputStream("Yes\n"));
     $command->setHelperSet(new HelperSet(array($dialog)));
     $tester = new CommandTester($command);
     $tester->execute(array());
     $result = $tester->getDisplay();
     $this->assertRegexp('/System & change logs cleared/', $result);
 }
コード例 #2
0
ファイル: LogClearTest.php プロジェクト: bolt/bolt
 public function testRun()
 {
     $app = $this->getApp();
     $command = new LogClear($app);
     $tester = new CommandTester($command);
     $helper = $this->getMockBuilder(QuestionHelper::class)->setMethods(['ask'])->getMock();
     $helper->expects($this->once())->method('ask')->will($this->returnValue(true));
     $set = new HelperSet(['question' => $helper]);
     $command->setHelperSet($set);
     $tester->execute([]);
     $result = $tester->getDisplay();
     $this->assertRegExp('/System & change logs cleared/', $result);
 }