Bonjour,

J'ai fait une correction qui plantait l'installation (erreur SQL).
J'en ai profité pour mettre à jour les tests unitaires

Cordialement,
--
David DURIEUX
Index: install/mysql/glpi-0.85-empty.sql
===================================================================
--- install/mysql/glpi-0.85-empty.sql	(revision 21066)
+++ install/mysql/glpi-0.85-empty.sql	(working copy)
@@ -5924,8 +5924,8 @@
   `duedatecritical_unit` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
   `display_options` text COLLATE utf8_unicode_ci,
   `is_deleted_ldap` tinyint(1) NOT NULL DEFAULT '0',
-  `pdffont` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT NULL,
-  `picture` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'NULL',
+  `pdffont` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
+  `picture` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
   `begin_date` datetime DEFAULT NULL,
   `end_date` datetime DEFAULT NULL,
   PRIMARY KEY (`id`),
Index: tools/phpunit/Install/AllTests.php
===================================================================
--- tools/phpunit/Install/AllTests.php	(revision 21066)
+++ tools/phpunit/Install/AllTests.php	(working copy)
@@ -36,6 +36,7 @@
 include("../../install/update_083_0831.php");
 include("../../install/update_0831_0833.php");
 include("../../install/update_0831_084.php");
+include("../../install/update_084_085.php");
 
 function displayMigrationMessage ($id, $msg="") {
    // display nothing
@@ -104,7 +105,7 @@
       $this->assertTrue($res, "Fail: SQL Error during install");
 
       // update default language
-      $query = "UPDATE `glpi_configs`
+      $query = "UPDATE `glpi_config`
                 SET `language` = 'fr_FR'";
       $this->assertTrue($DB->query($query), "Fail: can't set default language");
       $query = "UPDATE `glpi_users`
@@ -200,6 +201,16 @@
                     `language` = 'fr_FR',
                     `founded_new_version` = ''";
       $this->assertTrue($DB->query($query), "Fail: can't set version");
+      
+      // Update to 0.85
+      $res = update084to085(false);
+      $this->assertTrue($res, "Fail: SQL Error during upgrade");
+
+      $query = "UPDATE `glpi_configs`
+                SET `value` = '0.85'
+                WHERE `context`='context'
+                  AND `name`='version'";
+      $this->assertTrue($DB->query($query), "Fail: can't set version");
    }
 
 
@@ -208,14 +219,16 @@
       
       $DB->connect();
 
-      // Install a fresh 0.84 DB
+      // Install a fresh 0.85 DB
       $DB  = new DB();
-      $res = $DB->runFile(GLPI_ROOT ."/install/mysql/glpi-0.84-empty.sql");
+      $res = $DB->runFile(GLPI_ROOT ."/install/mysql/glpi-0.85-empty.sql");
       $this->assertTrue($res, "Fail: SQL Error during install");
 
       // update default language
       $query = "UPDATE `glpi_configs`
-                SET `language` = 'fr_FR'";
+                SET `value` = 'fr_FR'
+                WHERE `context`='context'
+                  AND `name`='language'";
       $this->assertTrue($DB->query($query), "Fail: can't set default language");
       $query = "UPDATE `glpi_users`
                 SET `language` = 'fr_FR'";
_______________________________________________
Glpi-dev mailing list
Glpi-dev@gna.org
https://mail.gna.org/listinfo/glpi-dev

Reply via email to