1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-10 18:54:08 +02:00

[feature/migrations] Reverse data functionality

If data step fails, attempt to roll back any previous calls from the
migration that failed.

Fix some failing tests

PHPBB3-9737
This commit is contained in:
Nathan Guse
2013-01-09 18:24:32 -06:00
parent 28cd253d19
commit 3d4c00619f
8 changed files with 240 additions and 15 deletions

View File

@@ -94,4 +94,31 @@ class phpbb_dbal_migrator_tool_config_test extends phpbb_test_case
}
$this->assertFalse(isset($this->config['foo']));
}
public function test_reverse()
{
$this->config->set('foo', 'bar');
try
{
$this->tool->reverse('add', 'foo');
}
catch (Exception $e)
{
$this->fail($e);
}
$this->assertFalse(isset($this->config['foo']));
$this->config->set('foo', 'bar');
try
{
$this->tool->reverse('update_if_equals', 'test', 'foo', 'bar');
}
catch (Exception $e)
{
$this->fail($e);
}
$this->assertEquals('test', $this->config['foo']);
}
}