From 93ccd9a8edc7dbb78512fecf594ea968e11cd225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Mudr=C3=A1k?= Date: Thu, 10 Nov 2016 09:52:31 +0100 Subject: [PATCH] MDL-53481 availability: Fix unit test to not execute the huge query Some DBs have troubles to execute such a huge query as generated in this test. We do not actually need to execute it. All we need is to make sure that the parameter placeholders are enumerated correctly. So it is what this new test does. --- availability/tests/tree_test.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/availability/tests/tree_test.php b/availability/tests/tree_test.php index f82d78a08d3..1b131a9a96e 100644 --- a/availability/tests/tree_test.php +++ b/availability/tests/tree_test.php @@ -728,8 +728,8 @@ class tree_testcase extends \advanced_testcase { shuffle($conditions); $tree = new tree(tree::get_root_json($conditions)); list($sql, $params) = $tree->get_user_list_sql(false, $info, false); - $result = $DB->get_fieldset_sql($sql, $params); - $this->assertEquals(array($user->id), $result); + // This must not throw exception. + $DB->fix_sql_params($sql, $params); } /**