Permalink
Browse files

Fixed broken test

  • Loading branch information...
REBELinBLUE committed May 15, 2017
1 parent 7bca368 commit b4065293bd395f40606f312196d366775d6a9d34
Showing with 9 additions and 6 deletions.
  1. +1 −1 phpunit.xml.dist
  2. +8 −5 tests/Unit/Console/Commands/ResetAppTest.php
View
@@ -37,7 +37,7 @@
</blacklist>
</filter>
<![CDATA[
- <!-- Some options which are useful in development but not on the CI, rename the CDATA to use -->
+ <!-- Some options which are useful in development but not on the CI, remove the CDATA to use -->
<logging>
<log type="coverage-text" target="php://stdout" lowUpperBound="50" highLowerBound="80" />
</logging>
@@ -7,6 +7,7 @@
use Illuminate\Foundation\Application;
use Mockery as m;
use REBELinBLUE\Deployer\Console\Commands\ResetApp;
+use REBELinBLUE\Deployer\Console\Commands\UpdateApp;
use REBELinBLUE\Deployer\Events\RestartSocketServer;
use REBELinBLUE\Deployer\Services\Filesystem\Filesystem;
use REBELinBLUE\Deployer\Tests\TestCase;
@@ -73,12 +74,15 @@ public function testHandle()
$command = m::mock(Command::class);
$command->shouldReceive('run');
- $migrate = m::mock(MigrateCommand::class);
- $migrate->shouldReceive('run')->once()->with(m::on(function (ArrayInput $arg) {
- $this->assertTrue($arg->getParameterOption('--force'));
+ $update = m::mock(UpdateApp::class);
+ $update->shouldReceive('run')->once()->with(m::on(function (ArrayInput $arg) {
+ $this->assertTrue($arg->getParameterOption('--no-backup'));
return true;
}), m::any());
+
+
+ $migrate = m::mock(MigrateCommand::class);
$migrate->shouldReceive('run')->once()->with(m::on(function (ArrayInput $arg) {
$this->assertTrue($arg->getParameterOption('--seed'));
$this->assertTrue($arg->getParameterOption('--force'));
@@ -89,8 +93,7 @@ public function testHandle()
$this->laravel->shouldReceive('environment')->with('local')->andReturn(true);
$this->console->shouldReceive('find')->with('down')->andReturn($command);
- $this->console->shouldReceive('find')->with('migrate')->andReturn($migrate);
- $this->console->shouldReceive('find')->with('app:update')->andReturn($command);
+ $this->console->shouldReceive('find')->with('app:update')->andReturn($update);
$this->console->shouldReceive('find')->with('migrate:fresh')->andReturn($migrate);
$this->console->shouldReceive('find')->with('queue:flush')->andReturn($command);
$this->console->shouldReceive('find')->with('queue:restart')->andReturn($command);

0 comments on commit b406529

Please sign in to comment.