Pantheon\Terminus\UnitTests\Commands\Backup\RestoreCommandTest::testRestoreBackupWithElementFails PHP Method

testRestoreBackupWithElementFails() public method

Tests the backup:restore command with an element when the backup operation has failed
    public function testRestoreBackupWithElementFails()
    {
        $message = 'Successfully queued restore_site';
        $this->backups->expects($this->once())->method('getFinishedBackups')->with('database')->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.dev', ['element' => 'db']);
        $this->assertNull($out);
    }