From 39ff3ed15fc77215153a47a870e8cde5436674ae Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 30 Apr 2013 18:05:44 +0200 Subject: [ticket/11495] Add proper testing of item_parent to tests PHPBB3-11495 --- tests/tree/nestedset_forum_get_data_test.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'tests/tree/nestedset_forum_get_data_test.php') diff --git a/tests/tree/nestedset_forum_get_data_test.php b/tests/tree/nestedset_forum_get_data_test.php index 76c99650aa..ca1863e55e 100644 --- a/tests/tree/nestedset_forum_get_data_test.php +++ b/tests/tree/nestedset_forum_get_data_test.php @@ -98,20 +98,22 @@ class phpbb_tests_tree_nestedset_forum_get_data_test extends phpbb_tests_tree_ne public function get_path_basic_data_data() { return array( - array(1, array(), array()), - array(1, array('forum_parents' => serialize(array())), array()), - array(2, array(), array(1)), - array(2, array('forum_parents' => serialize(array(1 => array()))), array(1)), - array(10, array(), array(7, 9)), - array(10, array('forum_parents' => serialize(array(7 => array(), 9 => array()))), array(7, 9)), + array(1, '', array()), + array(1, serialize(array()), array()), + array(2, '', array(1)), + array(2, serialize(array(1 => array())), array(1)), + array(10, '', array(7, 9)), + array(10, serialize(array(7 => array(), 9 => array())), array(7, 9)), ); } /** * @dataProvider get_path_basic_data_data */ - public function test_get_path_basic_data($forum_id, $forum_data, $expected) + public function test_get_path_basic_data($forum_id, $forum_parents, $expected) { - $this->assertEquals($expected, array_keys($this->set->get_path_basic_data(array_merge($this->forum_data[$forum_id], $forum_data)))); + $forum_data = $this->forum_data[$forum_id]; + $forum_data['forum_parents'] = $forum_parents; + $this->assertEquals($expected, array_keys($this->set->get_path_basic_data($forum_data))); } } -- cgit v1.2.1