/** * @ControllerManaged * * @param string $oldUserName * @param string $newUserName */ protected function updateHostUserName($oldUserName, $newUserName) { $this->configService->setHostUserName(trim($newUserName)); if (!$this->backupService->isHostUserNameValid()) { throw new \OCA\EasyBackup\EasyBackupException('Hostname is not valid'); } $this->backupService->updateBackupCommand(); $preconditionsHtml = $this->renderPreconditionsHtml(); return array('newUserName' => trim($newUserName), 'preconditionsHtml' => $preconditionsHtml); }
public function testIsHostNameValidNegative2() { $this->configServiceMock->expects($this->once())->method('getHostUserName')->will($this->returnValue('')); $this->assertFalse($this->cut->isHostUserNameValid()); }