aboutsummaryrefslogtreecommitdiffstats
path: root/tests/dbal/migrator_tool_config_test.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2013-11-27 14:55:05 +0100
committerMarc Alexander <admin@m-a-styles.de>2013-11-27 14:55:24 +0100
commit33f4d267ef9a3b65a1fbda82afa13ecc486b5c80 (patch)
tree2e19c6d0b72144d50197c01dcc2ad000913553ef /tests/dbal/migrator_tool_config_test.php
parent0d4bf3ff45a76dcb763c76502944aa7bf78b690b (diff)
parent125e76f9aa83141534387a965e8373c9b9cd5c4d (diff)
downloadforums-33f4d267ef9a3b65a1fbda82afa13ecc486b5c80.tar
forums-33f4d267ef9a3b65a1fbda82afa13ecc486b5c80.tar.gz
forums-33f4d267ef9a3b65a1fbda82afa13ecc486b5c80.tar.bz2
forums-33f4d267ef9a3b65a1fbda82afa13ecc486b5c80.tar.xz
forums-33f4d267ef9a3b65a1fbda82afa13ecc486b5c80.zip
Merge branch 'develop' of https://github.com/phpbb/phpbb3 into ticket/11842
Conflicts: phpBB/includes/acp/acp_groups.php
Diffstat (limited to 'tests/dbal/migrator_tool_config_test.php')
-rw-r--r--tests/dbal/migrator_tool_config_test.php91
1 files changed, 28 insertions, 63 deletions
diff --git a/tests/dbal/migrator_tool_config_test.php b/tests/dbal/migrator_tool_config_test.php
index a8d8966839..807399385c 100644
--- a/tests/dbal/migrator_tool_config_test.php
+++ b/tests/dbal/migrator_tool_config_test.php
@@ -20,35 +20,24 @@ class phpbb_dbal_migrator_tool_config_test extends phpbb_test_case
public function test_add()
{
- try
- {
- $this->tool->add('foo', 'bar');
- }
- catch (Exception $e)
- {
- $this->fail($e);
- }
+ $this->tool->add('foo', 'bar');
+ $this->assertEquals('bar', $this->config['foo']);
+ }
+
+ public function test_add_twice()
+ {
+ $this->tool->add('foo', 'bar');
$this->assertEquals('bar', $this->config['foo']);
- try
- {
- $this->tool->add('foo', 'bar');
- $this->fail('Exception not thrown');
- }
- catch (Exception $e) {}
+ $this->tool->add('foo', 'bar2');
+ $this->assertEquals('bar', $this->config['foo']);
}
public function test_update()
{
$this->config->set('foo', 'bar');
- try
- {
- $this->tool->update('foo', 'bar2');
- }
- catch (Exception $e)
- {
- $this->fail($e);
- }
+
+ $this->tool->update('foo', 'bar2');
$this->assertEquals('bar2', $this->config['foo']);
}
@@ -56,24 +45,10 @@ class phpbb_dbal_migrator_tool_config_test extends phpbb_test_case
{
$this->config->set('foo', 'bar');
- try
- {
- $this->tool->update_if_equals('', 'foo', 'bar2');
- }
- catch (Exception $e)
- {
- $this->fail($e);
- }
+ $this->tool->update_if_equals('', 'foo', 'bar2');
$this->assertEquals('bar', $this->config['foo']);
- try
- {
- $this->tool->update_if_equals('bar', 'foo', 'bar2');
- }
- catch (Exception $e)
- {
- $this->fail($e);
- }
+ $this->tool->update_if_equals('bar', 'foo', 'bar2');
$this->assertEquals('bar2', $this->config['foo']);
}
@@ -81,41 +56,31 @@ class phpbb_dbal_migrator_tool_config_test extends phpbb_test_case
{
$this->config->set('foo', 'bar');
- try
- {
- $this->tool->remove('foo');
- }
- catch (Exception $e)
- {
- $this->fail($e);
- }
+ $this->tool->remove('foo');
$this->assertFalse(isset($this->config['foo']));
}
- public function test_reverse()
+ public function test_reverse_add()
{
$this->config->set('foo', 'bar');
- try
- {
- $this->tool->reverse('add', 'foo');
- }
- catch (Exception $e)
- {
- $this->fail($e);
- }
+ $this->tool->reverse('add', 'foo');
$this->assertFalse(isset($this->config['foo']));
+ }
+
+ public function test_reverse_remove()
+ {
+ $this->config->delete('foo');
+ $this->tool->reverse('remove', 'foo');
+ $this->assertEquals('', $this->config['foo']);
+ }
+
+ public function test_reverse_update_if_equals()
+ {
$this->config->set('foo', 'bar');
- try
- {
- $this->tool->reverse('update_if_equals', 'test', 'foo', 'bar');
- }
- catch (Exception $e)
- {
- $this->fail($e);
- }
+ $this->tool->reverse('update_if_equals', 'test', 'foo', 'bar');
$this->assertEquals('test', $this->config['foo']);
}
}