]> git.agnieray.net Git - galette.git/commitdiff
Do not retrieve current version update script
authorJohan Cwiklinski <johan@x-tnd.be>
Fri, 7 May 2021 04:55:12 +0000 (06:55 +0200)
committerJohan Cwiklinski <johan@x-tnd.be>
Sat, 8 May 2021 09:28:19 +0000 (11:28 +0200)
galette/lib/Galette/Core/Install.php
tests/Galette/Core/tests/units/Install.php

index 22e8778aa302a281f377c13641795056432fff03..ed72a524c0b07cb18051f7636d08100a99a34194 100644 (file)
@@ -590,7 +590,7 @@ class Install
                     if ($version === null) {
                         $php_update_scripts[$ver[1]] = $ver[1];
                     } else {
-                        if ($version <= $ver[1]) {
+                        if ($version < $ver[1]) {
                             $php_update_scripts[$ver[1]] = $file;
                         }
                     }
@@ -605,7 +605,7 @@ class Install
                     if ($version === null) {
                         $sql_update_scripts[$ver[1]] = $ver[1];
                     } else {
-                        if ($version <= $ver[1]) {
+                        if ($version < $ver[1]) {
                             $sql_update_scripts[$ver[1]] = $file;
                         }
                     }
index 958d3398ff4e22430f5a3be2f4c9568beb2948f8..c87a52c49fe0fdcb9dc4b0b4ea51c308654b25e6 100644 (file)
@@ -110,7 +110,6 @@ class Install extends atoum
         );
 
         $knowns = array(
-            '0.60'  => 'upgrade-to-0.60-pgsql.sql',
             '0.61'  => 'upgrade-to-0.61-pgsql.sql',
             '0.62'  => 'upgrade-to-0.62-pgsql.sql',
             '0.63'  => 'upgrade-to-0.63-pgsql.sql',
@@ -149,9 +148,10 @@ class Install extends atoum
         );
 
         //without specifying database nor version, we got 10 update scripts total
+        $all_knowns = ['0.60' => 'upgrade-to-0.60-pgsql.sql'] + $knowns;
         $this->array(array_values($update_scripts))
-            ->hasSize(count($knowns))
-            ->isEqualTo(array_keys($knowns));
+            ->hasSize(count($all_knowns))
+            ->isEqualTo(array_keys($all_knowns));
 
         $this->install->setMode(\Galette\Core\Install::UPDATE);
         $errors = array();