diff options
author | Oliver Schramm <oliver.schramm97@gmail.com> | 2016-08-11 18:11:39 +0200 |
---|---|---|
committer | Oliver Schramm <oliver.schramm97@gmail.com> | 2016-08-11 18:11:39 +0200 |
commit | c12d67cd900514f9752d7bb73928870dbab0a0ce (patch) | |
tree | fdcf8cd60956270135a1624a7582b56381fa5b10 /tests/dbal | |
parent | 52afa74f4e6080952a72b6f40f15e6ce0a547b49 (diff) | |
download | forums-c12d67cd900514f9752d7bb73928870dbab0a0ce.tar forums-c12d67cd900514f9752d7bb73928870dbab0a0ce.tar.gz forums-c12d67cd900514f9752d7bb73928870dbab0a0ce.tar.bz2 forums-c12d67cd900514f9752d7bb73928870dbab0a0ce.tar.xz forums-c12d67cd900514f9752d7bb73928870dbab0a0ce.zip |
[ticket/14742] Add test for (not) reverting if
PHPBB3-14742
Diffstat (limited to 'tests/dbal')
-rw-r--r-- | tests/dbal/migration/if.php | 4 | ||||
-rw-r--r-- | tests/dbal/migrator_test.php | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/tests/dbal/migration/if.php b/tests/dbal/migration/if.php index 98a66526ed..481250ea77 100644 --- a/tests/dbal/migration/if.php +++ b/tests/dbal/migration/if.php @@ -36,13 +36,13 @@ class phpbb_dbal_migration_if extends \phpbb\db\migration\migration { global $migrator_test_if_true_failed; - $migrator_test_if_true_failed = false; + $migrator_test_if_true_failed = !$migrator_test_if_true_failed; } function test_false() { global $migrator_test_if_false_failed; - $migrator_test_if_false_failed = true; + $migrator_test_if_false_failed = !$migrator_test_if_false_failed; } } diff --git a/tests/dbal/migrator_test.php b/tests/dbal/migrator_test.php index 4c4306888c..798200eef1 100644 --- a/tests/dbal/migrator_test.php +++ b/tests/dbal/migrator_test.php @@ -156,6 +156,14 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case $this->assertFalse($migrator_test_if_true_failed, 'True test failed'); $this->assertFalse($migrator_test_if_false_failed, 'False test failed'); + + while ($this->migrator->migration_state('phpbb_dbal_migration_if') !== false) + { + $this->migrator->revert('phpbb_dbal_migration_if'); + } + + $this->assertFalse($migrator_test_if_true_failed, 'True test after revert failed'); + $this->assertFalse($migrator_test_if_false_failed, 'False test after revert failed'); } public function test_recall() |