public function testCheckActionWithError() { $this->directoryList->expects($this->once())->method('getPath')->willReturn(__DIR__); $this->filesystem->expects($this->once())->method('validateAvailableDiscSpace')->will($this->throwException(new \Exception("Test error message"))); $jsonModel = $this->controller->checkAction(); $this->assertInstanceOf('Zend\\View\\Model\\JsonModel', $jsonModel); $variables = $jsonModel->getVariables(); $this->assertArrayHasKey('responseType', $variables); $this->assertEquals(ResponseTypeInterface::RESPONSE_TYPE_ERROR, $variables['responseType']); $this->assertArrayHasKey('error', $variables); $this->assertEquals("Test error message", $variables['error']); }
private function setupCodeBackupRollback() { $this->filesystem->expects($this->once())->method('addIgnorePaths'); $this->filesystem->expects($this->once())->method('setBackupsDir'); $this->filesystem->expects($this->once())->method('setBackupExtension'); $this->filesystem->expects($this->once())->method('setTime'); $this->filesystem->expects($this->once())->method('getBackupFilename')->willReturn('RollbackFile_A.tgz'); $this->filesystem->expects($this->atLeastOnce())->method('getBackupPath')->willReturn('pathToFile/12345_filesystem_code.tgz'); $this->log->expects($this->once())->method('logSuccess'); }