public function testRestoreBackupWithFileFails()
{
$this->environment->id = 'env_id';
$test_filename = 'test.tar.gz';
$message = 'Successfully queued restore_site';
$this->backups->expects($this->once())->method('getBackupByFileName')->with($test_filename)->willReturn($this->backup);
$this->backup->expects($this->once())->method('restore')->willReturn($this->workflow);
$this->workflow->expects($this->once())->method('wait')->with();
$this->workflow->expects($this->once())->method('isSuccessful')->with()->willReturn(false);
$this->logger->expects($this->never())->method('log');
$this->workflow->expects($this->once())->method('getMessage')->with()->willReturn($message);
$this->setExpectedException(TerminusException::class);
$out = $this->command->restoreBackup("mysite.{$this->environment->id}", ['file' => $test_filename]);
$this->assertNull($out);
}