Skip to content
Snippets Groups Projects
Commit 9a5868a0 authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

rel #10430 : add sql patch test

parent fbe1bca6
Branches
Tags
7 merge requests!1553Master,!1502Master,!1501Stable,!1312Master,!1311Dev#10430 pick day agenda,!1290Dev#10430 pick day agenda,!1262Dev#10430 pick day agenda
......@@ -77,11 +77,26 @@ abstract class UpgradeDBTestCase extends PHPUnit_Framework_TestCase {
return $result;
}
protected function assertColumn($table, $column, $message='') {
try {
$this->query(sprintf('select `%s` from `%s` limit 1',
$column, $table));
} catch (Exception $e) {
$message = $message
? $message
: sprintf('Failed asserting that "%s" table CONTAINS a "%s" column.',
$table, $column);
$this->fail($message);
}
}
}
class UpgradeDB_263_Test extends UpgradeDBTestCase {
Class UpgradeDB_263_Test extends UpgradeDBTestCase {
public function prepare() {
$this->query('delete from permission where code="CATEGORY"');
}
......@@ -197,3 +212,19 @@ class UpgradeDB_278_Test extends UpgradeDBTestCase {
$this->assertContains("12:Cd-Script\r\n", $this->query('select liste from variables where clef = "comm_sigb";')->fetch()['liste']);
}
}
class UpgradeDB_279_Test extends UpgradeDBTestCase {
public function prepare() {
try {
$this->query('alter table `cms_article` drop `pick_day`');
} catch(Exception $e) {}
}
/** @test */
public function pickDayColumnShouldBeAdded() {
$this->assertColumn('cms_article', 'pick_day');
}
}
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment