aboutsummaryrefslogtreecommitdiffstats
path: root/tests/dbal/migrator_test.php
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2014-02-03 15:06:43 -0600
committerNathan Guse <nathaniel.guse@gmail.com>2014-02-03 15:07:57 -0600
commit2c878ead311b8b71cabb4070ce848d5b84470ce8 (patch)
tree0e8e642b9e1973226b729a340aee930816f3fc10 /tests/dbal/migrator_test.php
parent2cc6d03cca3f79125574e0cf938fa9edfab3a7b2 (diff)
downloadforums-2c878ead311b8b71cabb4070ce848d5b84470ce8.tar
forums-2c878ead311b8b71cabb4070ce848d5b84470ce8.tar.gz
forums-2c878ead311b8b71cabb4070ce848d5b84470ce8.tar.bz2
forums-2c878ead311b8b71cabb4070ce848d5b84470ce8.tar.xz
forums-2c878ead311b8b71cabb4070ce848d5b84470ce8.zip
[ticket/11880] Break up schema changes in the migrator
PHPBB3-11880
Diffstat (limited to 'tests/dbal/migrator_test.php')
-rw-r--r--tests/dbal/migrator_test.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/dbal/migrator_test.php b/tests/dbal/migrator_test.php
index c6b4c289d3..9a6f33523c 100644
--- a/tests/dbal/migrator_test.php
+++ b/tests/dbal/migrator_test.php
@@ -16,6 +16,7 @@ require_once dirname(__FILE__) . '/migration/revert.php';
require_once dirname(__FILE__) . '/migration/revert_with_dependency.php';
require_once dirname(__FILE__) . '/migration/fail.php';
require_once dirname(__FILE__) . '/migration/installed.php';
+require_once dirname(__FILE__) . '/migration/schema.php';
class phpbb_dbal_migrator_test extends phpbb_database_test_case
{
@@ -267,4 +268,23 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
$this->fail('Installed test failed');
}
}
+
+ public function test_schema()
+ {
+ $this->migrator->set_migrations(array('phpbb_dbal_migration_schema'));
+
+ while (!$this->migrator->finished())
+ {
+ $this->migrator->update();
+ }
+
+ $this->assertTrue($this->db_tools->sql_column_exists('phpbb_config', 'test_column1'));
+
+ while ($this->migrator->migration_state('phpbb_dbal_migration_schema'))
+ {
+ $this->migrator->revert('phpbb_dbal_migration_schema');
+ }
+
+ $this->assertFalse($this->db_tools->sql_column_exists('phpbb_config', 'test_column1'));
+ }
}