Improved error management on install command

This commit is contained in:
Alejandro Celaya
2016-08-18 18:02:24 +02:00
parent f77273ef93
commit 7c42835cc1
3 changed files with 30 additions and 7 deletions

View File

@@ -8,6 +8,7 @@ use Shlinkio\Shlink\CLI\Command\Install\InstallCommand;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Helper\ProcessHelper;
use Symfony\Component\Console\Tester\CommandTester;
use Symfony\Component\Process\Process;
use Zend\Config\Writer\WriterInterface;
class InstallCommandTest extends TestCase
@@ -23,10 +24,12 @@ class InstallCommandTest extends TestCase
public function setUp()
{
$processMock = $this->prophesize(Process::class);
$processMock->isSuccessful()->willReturn(true);
$processHelper = $this->prophesize(ProcessHelper::class);
$processHelper->getName()->willReturn('process');
$processHelper->setHelperSet(Argument::any())->willReturn(null);
$processHelper->run(Argument::cetera())->willReturn(null);
$processHelper->run(Argument::cetera())->willReturn($processMock->reveal());
$app = new Application();
$helperSet = $app->getHelperSet();