Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ticket/11995 Fix Revert of config.remove migration #1847

Merged
merged 3 commits into from Nov 2, 2013
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions phpBB/phpbb/db/migration/tool/config.php
Expand Up @@ -130,6 +130,10 @@ public function reverse()

case 'remove':
$call = 'add';
if (sizeof($arguments) == 1)
{
$arguments[] = '';
}
break;

case 'update_if_equals':
Expand Down
16 changes: 16 additions & 0 deletions tests/dbal/migrator_tool_config_test.php
Expand Up @@ -94,6 +94,7 @@ public function test_remove()

public function test_reverse()
{
// add
$this->config->set('foo', 'bar');

try
Expand All @@ -106,6 +107,21 @@ public function test_reverse()
}
$this->assertFalse(isset($this->config['foo']));

// remove
$this->config->delete('foo');

try
{
$this->tool->reverse('remove', 'foo');
}
catch (Exception $e)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is an explicit catch necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its just a copy from all the code around, should I change all of them?

{
$this->fail($e);
}
$this->assertTrue(isset($this->config['foo']));
$this->assertEquals('', $this->config['foo']);

// update_if_equals
$this->config->set('foo', 'bar');

try
Expand Down