public function testExecute($moduleName, $all, array $contains, array $notContains)
{
$application = $this->getApplication();
$application->add(new FromCommand());
$command = $this->getApplication()->find('dev:module:dependencies:from');
$commandTester = new CommandTester($command);
$input = array('command' => $command->getName(), 'moduleName' => $moduleName);
switch ($all) {
case 2:
$input['-a'] = true;
break;
case 1:
$input['--all'] = true;
break;
default:
break;
}
$commandTester->execute($input);
foreach ($contains as $expectation) {
$this->assertContains($expectation, $commandTester->getDisplay());
}
foreach ($notContains as $expectation) {
$this->assertNotContains($expectation, $commandTester->getDisplay());
}
}