mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 12:28:52 +00:00
[ticket/14742] Add test for (not) reverting if
PHPBB3-14742
This commit is contained in:
parent
52afa74f4e
commit
c12d67cd90
2 changed files with 10 additions and 2 deletions
|
@ -36,13 +36,13 @@ class phpbb_dbal_migration_if extends \phpbb\db\migration\migration
|
||||||
{
|
{
|
||||||
global $migrator_test_if_true_failed;
|
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()
|
function test_false()
|
||||||
{
|
{
|
||||||
global $migrator_test_if_false_failed;
|
global $migrator_test_if_false_failed;
|
||||||
|
|
||||||
$migrator_test_if_false_failed = true;
|
$migrator_test_if_false_failed = !$migrator_test_if_false_failed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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_true_failed, 'True test failed');
|
||||||
$this->assertFalse($migrator_test_if_false_failed, 'False 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()
|
public function test_recall()
|
||||||
|
|
Loading…
Add table
Reference in a new issue