App\Services\Deployment\StorageDeployCommander::rollback PHP Method

rollback() public method

Give the command to rollback
public rollback ( mixed $deployment ) : boolean
$deployment mixed
return boolean
    public function rollback($deployment)
    {
        if (!Storage::put('rollback.json', $deployment)) {
            return false;
        } else {
            return true;
        }
    }

Usage Example

 public function test_Should_ReturnFalse_When_RollbackCommandFails()
 {
     Storage::shouldReceive('put')->once()->andReturn(0);
     $deployCommander = new StorageDeployCommander();
     $result = $deployCommander->rollback(new App\Models\Deployment());
     $this->assertFalse($result, 'Expected rollback command to fail.');
 }
StorageDeployCommander