Skip to content

Commit

Permalink
fix ListCommandTest
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianheuer committed Jul 15, 2016
1 parent 28bb356 commit 7433452
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/commands/list/ListCommand.php
Expand Up @@ -22,7 +22,8 @@ class ListCommand implements Cli\Command {

/**
* @param SourcesList $sourcesList
* @param Cli\Output $output
* @param SourcesList $localSources
* @param Cli\Output $output
*/
public function __construct(SourcesList $sourcesList, SourcesList $localSources, Cli\Output $output) {
$this->sourcesList = $sourcesList;
Expand Down
14 changes: 11 additions & 3 deletions tests/unit/commands/list/ListCommandTest.php
Expand Up @@ -10,24 +10,32 @@ class ListCommandTest extends \PHPUnit_Framework_TestCase {

public function testWritesExpectedAliasesToOutput() {
$sourcesList = $this->getSourcesListMock();
$localSources = $this->getSourcesListMock();
$output = $this->getOutputMock();

$localSources->method('getAliases')
->willReturn(['phpdox']);

$sourcesList->method('getAliases')
->willReturn(['phpunit', 'phpab', 'phploc']);

$output->expects($this->at(1))
->method('writeText')
->with($this->stringContains('phpdox'));

$output->expects($this->at(3))
->method('writeText')
->with($this->stringContains('phpunit'));

$output->expects($this->at(2))
$output->expects($this->at(4))
->method('writeText')
->with($this->stringContains('phpab'));

$output->expects($this->at(3))
$output->expects($this->at(5))
->method('writeText')
->with($this->stringContains('phploc'));

$command = new ListCommand($sourcesList, $output);
$command = new ListCommand($sourcesList, $localSources, $output);
$command->execute();
}

Expand Down

0 comments on commit 7433452

Please sign in to comment.