diff options
author | Matt Friedman <maf675@gmail.com> | 2013-12-12 10:28:10 -0800 |
---|---|---|
committer | Matt Friedman <maf675@gmail.com> | 2013-12-12 10:28:10 -0800 |
commit | a59bbeed2dd82b316f1e2f9ad484b978ef2a541c (patch) | |
tree | f3d667b7711b44fa56f6d575b8ae2bc072682d23 /tests/dbal/migrator_tool_config_test.php | |
parent | 2ae6f216f66466a1851f52cbc9839e3405525981 (diff) | |
parent | da6ced59d9632fec5103ce4bea86eb6bcceb5d1e (diff) | |
download | forums-a59bbeed2dd82b316f1e2f9ad484b978ef2a541c.tar forums-a59bbeed2dd82b316f1e2f9ad484b978ef2a541c.tar.gz forums-a59bbeed2dd82b316f1e2f9ad484b978ef2a541c.tar.bz2 forums-a59bbeed2dd82b316f1e2f9ad484b978ef2a541c.tar.xz forums-a59bbeed2dd82b316f1e2f9ad484b978ef2a541c.zip |
[ticket/11966] Merge branch 'develop' into ticket/11966
PHPBB3-11966
Diffstat (limited to 'tests/dbal/migrator_tool_config_test.php')
-rw-r--r-- | tests/dbal/migrator_tool_config_test.php | 91 |
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']); } } |