Ejemplo n.º 1
0
 public function testDisplayPanelWithoutUpdate()
 {
     $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]);
     }
     $this->config->expects($this->exactly(2))->method('getAppValue')->willReturnMap([['core', 'lastupdatedat', '', '12345'], ['updatenotification', 'notify_groups', '["admin"]', '["admin"]']]);
     $this->dateTimeFormatter->expects($this->once())->method('formatDateTime')->with('12345')->willReturn('LastCheckedReturnValue');
     $this->updateChecker->expects($this->once())->method('getUpdateState')->willReturn([]);
     $params = ['isNewVersionAvailable' => false, 'lastChecked' => 'LastCheckedReturnValue', 'currentChannel' => \OCP\Util::getChannel(), 'channels' => $channels, 'newVersionString' => '', 'notify_groups' => 'admin'];
     $expected = new TemplateResponse('updatenotification', 'admin', $params, '');
     $this->assertEquals($expected, $this->adminController->displayPanel());
 }
Ejemplo n.º 2
0
 public function testDisplayPanel()
 {
     $expected = new TemplateResponse('updatenotification', 'admin', [], '');
     $this->assertEquals($expected, $this->adminController->displayPanel());
 }