diff options
| author | Joas Schilling <nickvergessen@gmx.de> | 2013-04-16 23:09:56 +0200 |
|---|---|---|
| committer | Joas Schilling <nickvergessen@gmx.de> | 2013-04-16 23:43:38 +0200 |
| commit | dcee7961e80a0d188d887a13cc6409623bc1ff6e (patch) | |
| tree | a7365c51b9208c3d8a7c38b7388d1eb7ca64520f /tests/nestedset/item_forum_test.php | |
| parent | 57a05e7cf509f56309591aaf9344226a8f1a9a8e (diff) | |
| download | forums-dcee7961e80a0d188d887a13cc6409623bc1ff6e.tar forums-dcee7961e80a0d188d887a13cc6409623bc1ff6e.tar.gz forums-dcee7961e80a0d188d887a13cc6409623bc1ff6e.tar.bz2 forums-dcee7961e80a0d188d887a13cc6409623bc1ff6e.tar.xz forums-dcee7961e80a0d188d887a13cc6409623bc1ff6e.zip | |
[ticket/11495] Add unit tests for the implemented functions
PHPBB3-11495
Diffstat (limited to 'tests/nestedset/item_forum_test.php')
| -rw-r--r-- | tests/nestedset/item_forum_test.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/nestedset/item_forum_test.php b/tests/nestedset/item_forum_test.php new file mode 100644 index 0000000000..1ca89ebd2f --- /dev/null +++ b/tests/nestedset/item_forum_test.php @@ -0,0 +1,31 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2013 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +class phpbb_tests_nestedset_item_forum_test extends phpbb_test_case +{ + public function test_item_forum_constructor() + { + $forum_data = array( + 'parent_id' => 1, + 'forum_id' => 5, + 'user_id' => 32, + 'left_id' => 2, + 'right_id' => 3, + 'forum_parents' => '', + ); + + $forum = new phpbb_nestedset_item_forum($forum_data); + + $this->assertEquals($forum->get_item_id(), $forum_data['forum_id']); + $this->assertEquals($forum->get_left_id(), $forum_data['left_id']); + $this->assertEquals($forum->get_right_id(), $forum_data['right_id']); + $this->assertEquals($forum->get_parent_id(), $forum_data['parent_id']); + $this->assertEquals($forum->get_item_parents_data(), $forum_data['forum_parents']); + } +} |
