Skip to content
Extraits de code Groupes Projets
Valider 473b288a rédigé par Thomas Steur's avatar Thomas Steur
Parcourir les fichiers

fix test, the testcase was in the wrong test file

parent 0eb9d127
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -58,10 +58,6 @@ class UpdateCommunication
{
$latestVersion = $this->getLatestVersion();
if (!$this->isVersionLike($latestVersion)) {
return;
}
$host = SettingsPiwik::getPiwikUrl();
$subject = Piwik::translate('CoreUpdater_NotificationSubjectAvailableCoreUpdate', $latestVersion);
......@@ -109,7 +105,18 @@ class UpdateCommunication
{
UpdateCheck::check();
return UpdateCheck::isNewestVersionAvailable();
$hasUpdate = UpdateCheck::isNewestVersionAvailable();
if (!$hasUpdate) {
return false;
}
$latestVersion = self::getLatestVersion();
if (!$this->isVersionLike($latestVersion)) {
return false;
}
return $hasUpdate;
}
private function hasNotificationAlreadyReceived()
......
......@@ -92,7 +92,6 @@ class Plugins_CorePluginsAdmin_UpdateCommunicationTest extends DatabaseTestCase
return array(
array('33.0.0', '33.0.0', $this->never(), '33.0.0'), // shouldNotSend_IfAlreadyNotified
array('31.0.0', '33.0.0', $this->never(), '33.0.0'), // shouldNotSend_IfAlreadyNotifiedAboutLaterRelease
array('3333.3333.3333-beta10', '31.0.0', $this->never(), '31.0.0'), // shouldNotSend_IfLatestVersionIsNotVersionLike,
array('33.0.0', false, $this->once(), '33.0.0'), // shouldSend_IfUpdateAvailableAndNeverSentAnyBefore
array('33.0.0', '31.0.0', $this->once(), '33.0.0'), // shouldSend_IfUpdateAvailable,
);
......
......@@ -58,6 +58,7 @@ class Plugins_CoreUpdater_UpdateCommunicationTest extends DatabaseTestCase
array(Version::VERSION, false, $this->never(), false), // shouldNotSend_IfNoUpdateAvailable
array('33.0.0', '33.0.0', $this->never(), '33.0.0'), // shouldNotSend_IfAlreadyNotified
array('31.0.0', '33.0.0', $this->never(), '33.0.0'), // shouldNotSend_IfAlreadyNotifiedAboutLaterRelease
array('3333.3333.3333-beta10', '31.0.0', $this->never(), '31.0.0'), // shouldNotSend_IfLatestVersionIsNotVersionLike,
array('33.0.0', false, $this->once(), '33.0.0'), // shouldSend_IfUpdateAvailableAndNeverSentAnyBefore
array('33.0.0', '31.0.0', $this->once(), '33.0.0'), // shouldSend_IfUpdateAvailable
);
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter