aboutsummaryrefslogtreecommitdiffstats
path: root/tests/tree
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tree')
-rw-r--r--tests/tree/nestedset_forum_base.php8
-rw-r--r--tests/tree/nestedset_forum_get_data_test.php16
2 files changed, 20 insertions, 4 deletions
diff --git a/tests/tree/nestedset_forum_base.php b/tests/tree/nestedset_forum_base.php
index 43680609f8..ce03c1fc21 100644
--- a/tests/tree/nestedset_forum_base.php
+++ b/tests/tree/nestedset_forum_base.php
@@ -52,11 +52,11 @@ class phpbb_tests_tree_nestedset_forum_base extends phpbb_database_test_case
global $config;
- $config = $this->config = new phpbb_config(array('nestedset_forum_lock' => 0));
+ $config = $this->config = new \phpbb\config\config(array('nestedset_forum_lock' => 0));
set_config(null, null, null, $this->config);
- $this->lock = new phpbb_lock_db('nestedset_forum_lock', $this->config, $this->db);
- $this->set = new phpbb_tree_nestedset_forum($this->db, $this->lock, 'phpbb_forums');
+ $this->lock = new \phpbb\lock\db('nestedset_forum_lock', $this->config, $this->db);
+ $this->set = new \phpbb\tree\nestedset_forum($this->db, $this->lock, 'phpbb_forums');
$this->set_up_forums();
}
@@ -97,7 +97,7 @@ class phpbb_tests_tree_nestedset_forum_base extends phpbb_database_test_case
}
else
{
- $buffer = new phpbb_db_sql_insert_buffer($this->db, 'phpbb_forums');
+ $buffer = new \phpbb\db\sql_insert_buffer($this->db, 'phpbb_forums');
$buffer->insert_all($forums);
$buffer->flush();
diff --git a/tests/tree/nestedset_forum_get_data_test.php b/tests/tree/nestedset_forum_get_data_test.php
index ca1863e55e..a0d0778e82 100644
--- a/tests/tree/nestedset_forum_get_data_test.php
+++ b/tests/tree/nestedset_forum_get_data_test.php
@@ -116,4 +116,20 @@ class phpbb_tests_tree_nestedset_forum_get_data_test extends phpbb_tests_tree_ne
$forum_data['forum_parents'] = $forum_parents;
$this->assertEquals($expected, array_keys($this->set->get_path_basic_data($forum_data)));
}
+
+ public function get_all_tree_data_data()
+ {
+ return array(
+ array(true, array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)),
+ array(false, array(11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1)),
+ );
+ }
+
+ /**
+ * @dataProvider get_all_tree_data_data
+ */
+ public function test_get_all_tree_data($order_asc, $expected)
+ {
+ $this->assertEquals($expected, array_keys($this->set->get_all_tree_data($order_asc)));
+ }
}