コード例 #1
0
ファイル: ShellTest.php プロジェクト: okite11/frames21
 public function testRunShowModeHelp()
 {
     $mode = $this->getMock('\\Migration\\Mode\\Data', [], [], '', false);
     $mode->expects($this->any())->method('getUsageHelp')->willReturn('mode help');
     $this->modeFactory->expects($this->once())->method('create')->with('data')->willReturn($mode);
     $this->shell->setRawArgs(['data', 'help']);
     ob_start();
     $result = $this->shell->run();
     $output = ob_get_contents();
     ob_end_clean();
     $this->assertSame($this->shell, $result);
     $this->assertContains('Usage:', $output);
     $this->assertContains('mode help', $output);
 }
コード例 #2
0
ファイル: Shell.php プロジェクト: okite11/frames21
 /**
  * @param string $modeName
  * @return Mode\ModeInterface
  * @throws Exception
  */
 protected function createMode($modeName)
 {
     return $this->modeFactory->create($modeName);
 }