/** * @return TemplateResponse */ public function displayPanel() { $lastUpdateCheck = $this->dateTimeFormatter->formatDateTime($this->config->getAppValue('core', 'lastupdatedat')); $channels = ['daily', 'beta', 'stable', 'production']; $currentChannel = \OCP\Util::getChannel(); // Remove the currently used channel from the channels list if (($key = array_search($currentChannel, $channels)) !== false) { unset($channels[$key]); } $updateState = $this->updateChecker->getUpdateState(); $params = ['isNewVersionAvailable' => $updateState === [] ? false : true, 'lastChecked' => $lastUpdateCheck, 'currentChannel' => $currentChannel, 'channels' => $channels, 'newVersionString' => $updateState === [] ? '' : $updateState['updateVersion']]; return new TemplateResponse($this->appName, 'admin', $params, ''); }
public function testGetUpdateStateWithoutUpdate() { $this->updater->expects($this->once())->method('check')->willReturn([]); $expected = []; $this->assertSame($expected, $this->updateChecker->getUpdateState()); }