diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2013-02-26 17:01:45 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2013-02-26 17:01:45 +0100 |
commit | 1261583afab236d6986827695dd6f80770fb1eb4 (patch) | |
tree | 1b9e8f3cacbb407ab13860a081b6bddc02d0e9da /tests/groupposition/teampage_test.php | |
parent | 9e70f7a4e0e419984ad5dd0392857ecd810ad252 (diff) | |
download | forums-1261583afab236d6986827695dd6f80770fb1eb4.tar forums-1261583afab236d6986827695dd6f80770fb1eb4.tar.gz forums-1261583afab236d6986827695dd6f80770fb1eb4.tar.bz2 forums-1261583afab236d6986827695dd6f80770fb1eb4.tar.xz forums-1261583afab236d6986827695dd6f80770fb1eb4.zip |
[ticket/10411] Test for thrown exceptions when group does not exist
PHPBB3-10411
Diffstat (limited to 'tests/groupposition/teampage_test.php')
-rw-r--r-- | tests/groupposition/teampage_test.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/groupposition/teampage_test.php b/tests/groupposition/teampage_test.php index 7d00e2c5d3..b0ce6b29c3 100644 --- a/tests/groupposition/teampage_test.php +++ b/tests/groupposition/teampage_test.php @@ -20,15 +20,16 @@ class phpbb_groupposition_teampage_test extends phpbb_database_test_case public function get_group_value_data() { return array( - array(2, 3), - array(6, 8), + array(2, 3, ''), + array(6, 8, ''), + array(10, 0, 'phpbb_groupposition_exception'), ); } /** * @dataProvider get_group_value_data */ - public function test_get_group_value($group_id, $expected) + public function test_get_group_value($group_id, $expected, $throws_exception) { global $cache; @@ -37,6 +38,11 @@ class phpbb_groupposition_teampage_test extends phpbb_database_test_case $user = new phpbb_user; $user->lang = array(); + if ($throws_exception) + { + $this->setExpectedException($throws_exception); + } + $test_class = new phpbb_groupposition_teampage($db, $user, $cache); $this->assertEquals($expected, $test_class->get_group_value($group_id)); } |