Skip to content

Commit

Permalink
[ticket/14742] Add test for (not) reverting if
Browse files Browse the repository at this point in the history
PHPBB3-14742
  • Loading branch information
Elsensee committed Aug 11, 2016
1 parent 52afa74 commit c12d67c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/dbal/migration/if.php
Expand Up @@ -36,13 +36,13 @@ function test_true()
{
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;
}
}
8 changes: 8 additions & 0 deletions tests/dbal/migrator_test.php
Expand Up @@ -156,6 +156,14 @@ public function test_if()

$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()
Expand Down

0 comments on commit c12d67c

Please sign in to comment.