public function test_isEnabled_shouldReturnFalse_IfCannotBeEnabled()
 {
     $this->assertTrue($this->updateCommunication->isEnabled());
     Config::getInstance()->General['enable_update_communication'] = 0;
     $this->assertFalse($this->updateCommunication->isEnabled());
 }
Beispiel #2
0
 private function handleGeneralSettingsAdmin($view)
 {
     // Whether to display or not the general settings (cron, beta, smtp)
     $view->isGeneralSettingsAdminEnabled = self::isGeneralSettingsAdminEnabled();
     if ($view->isGeneralSettingsAdminEnabled) {
         $this->displayWarningIfConfigFileNotWritable();
     }
     $enableBrowserTriggerArchiving = Rules::isBrowserTriggerEnabled();
     $todayArchiveTimeToLive = Rules::getTodayArchiveTimeToLive();
     $showWarningCron = false;
     if (!$enableBrowserTriggerArchiving && $todayArchiveTimeToLive < 3600) {
         $showWarningCron = true;
     }
     $view->showWarningCron = $showWarningCron;
     $view->todayArchiveTimeToLive = $todayArchiveTimeToLive;
     $view->enableBrowserTriggerArchiving = $enableBrowserTriggerArchiving;
     $view->enableBetaReleaseCheck = Config::getInstance()->Debug['allow_upgrades_to_beta'];
     $view->mail = Config::getInstance()->mail;
     $pluginUpdateCommunication = new UpdateCommunication();
     $view->canUpdateCommunication = $pluginUpdateCommunication->canBeEnabled();
     $view->enableSendPluginUpdateCommunication = $pluginUpdateCommunication->isEnabled();
 }
Beispiel #3
0
 private function handleGeneralSettingsAdmin($view)
 {
     // Whether to display or not the general settings (cron, beta, smtp)
     $view->isGeneralSettingsAdminEnabled = self::isGeneralSettingsAdminEnabled();
     if ($view->isGeneralSettingsAdminEnabled) {
         $this->displayWarningIfConfigFileNotWritable();
     }
     $enableBrowserTriggerArchiving = Rules::isBrowserTriggerEnabled();
     $todayArchiveTimeToLive = Rules::getTodayArchiveTimeToLive();
     $showWarningCron = false;
     if (!$enableBrowserTriggerArchiving && $todayArchiveTimeToLive < 3600) {
         $showWarningCron = true;
     }
     $view->showWarningCron = $showWarningCron;
     $view->todayArchiveTimeToLive = $todayArchiveTimeToLive;
     $view->todayArchiveTimeToLiveDefault = Rules::getTodayArchiveTimeToLiveDefault();
     $view->enableBrowserTriggerArchiving = $enableBrowserTriggerArchiving;
     $releaseChannels = $this->makeReleaseChannels();
     $activeChannelId = $releaseChannels->getActiveReleaseChannel()->getId();
     $allChannels = array();
     foreach ($releaseChannels->getAllReleaseChannels() as $channel) {
         $allChannels[] = array('id' => $channel->getId(), 'name' => $channel->getName(), 'description' => $channel->getDescription(), 'active' => $channel->getId() === $activeChannelId);
     }
     $view->releaseChannels = $allChannels;
     $view->mail = Config::getInstance()->mail;
     $pluginUpdateCommunication = new UpdateCommunication();
     $view->canUpdateCommunication = $pluginUpdateCommunication->canBeEnabled();
     $view->enableSendPluginUpdateCommunication = $pluginUpdateCommunication->isEnabled();
 }