diff --git a/cosmogramme/php/_init.php b/cosmogramme/php/_init.php index 248610c3978799f9677ec08186c6a47c1493e61b..4a8e351d154c8b3df7ba5030cae55a51625567d1 100644 --- a/cosmogramme/php/_init.php +++ b/cosmogramme/php/_init.php @@ -1,7 +1,7 @@ <?php error_reporting(E_ERROR | E_PARSE); -define("PATCH_LEVEL","316"); +define("PATCH_LEVEL","317"); define("APPLI","cosmogramme"); define("COSMOPATH", "/var/www/html/vhosts/opac2/www/htdocs"); diff --git a/cosmogramme/sql/patch/patch_317.php b/cosmogramme/sql/patch/patch_317.php new file mode 100644 index 0000000000000000000000000000000000000000..78f4ae87e8bc061673cf1d80e0109b1668a270aa --- /dev/null +++ b/cosmogramme/sql/patch/patch_317.php @@ -0,0 +1,6 @@ +<?php +try { + $adapter = Zend_Db_Table_Abstract::getDefaultAdapter(); + foreach(['CFG_SITE', 'CFG_ACCUEIL', 'CFG_MODULES', 'CFG_NOTICE'] as $key) + $adapter->query('ALTER TABLE bib_admin_profil MODIFY ' . $key . ' mediumtext NOT NULL'); +} catch(Exception $e) {} diff --git a/tests/db/UpgradeDBTest.php b/tests/db/UpgradeDBTest.php index 1adf3a474075a45ea631151e03e2a7994a739a0e..eb71d72d6784c1eeb8aaac24781ccc8df00a1c43 100644 --- a/tests/db/UpgradeDBTest.php +++ b/tests/db/UpgradeDBTest.php @@ -1221,4 +1221,34 @@ class UpgradeDB_316_Test extends UpgradeDBTestCase { $this->assertField('codif_section','id_section', 'PRI', 'Key'); $this->assertField('codif_section','id_section', 'NO', 'Null'); } +} + + + +class UpgradeDB_317_Test extends UpgradeDBTestCase { + protected $_columns = ['CFG_SITE', 'CFG_ACCUEIL', 'CFG_MODULES', 'CFG_NOTICE']; + + public function prepare() { + try { + foreach($this->_columns as $key) + $this->query("ALTER TABLE bib_admin_profil MODIFY " . $key . " text NOT NULL"); + } catch (Exception $e) { + var_dump($e); + } + } + + + public function datas() { + return array_map(function($item) { return [$item]; }, + $this->_columns); + } + + + /** + * @test + * @dataProvider datas + **/ + public function fieldsShouldBecomeMediumtext($key) { + $this->assertFieldType('bib_admin_profil', $key, 'mediumtext'); + } } \ No newline at end of file