Skip to content
Permalink
Browse files

Add integration tests for --version and --help.

Refs #8894
  • Loading branch information...
markstory committed May 27, 2016
1 parent 466a027 commit d35a88cb595768d8b3bc0a1f86d21407e10017d6
Showing with 40 additions and 0 deletions.
  1. +40 −0 tests/TestCase/Console/ShellDispatcherTest.php
@@ -341,4 +341,44 @@ public function testShiftArgs()
$this->assertNull($this->dispatcher->shiftArgs());
$this->assertSame([], $this->dispatcher->args);
}
/**
* Test how `bin/cake --help` works.
*
* @return void
*/
public function testHelpOption()
{
$mockShell = $this->getMock('Cake\Shell\CommandListShell', ['main', 'initialize', 'startup']);
$mockShell->expects($this->once())
->method('main');
$dispatcher = $this->getMock('Cake\Console\ShellDispatcher', ['findShell', '_stop']);
$dispatcher->expects($this->once())
->method('findShell')
->with('command_list')
->will($this->returnValue($mockShell));
$dispatcher->args = ['--help'];
$dispatcher->dispatch();
}
/**
* Test how `bin/cake --version` works.
*
* @return void
*/
public function testVersionOption()
{
$mockShell = $this->getMock('Cake\Shell\CommandListShell', ['main', 'initialize', 'startup']);
$mockShell->expects($this->once())
->method('main');
$dispatcher = $this->getMock('Cake\Console\ShellDispatcher', ['findShell', '_stop']);
$dispatcher->expects($this->once())
->method('findShell')
->with('command_list')
->will($this->returnValue($mockShell));
$dispatcher->args = ['--version'];
$dispatcher->dispatch();
}
}

0 comments on commit d35a88c

Please sign in to comment.
You can’t perform that action at this time.