From 6db92c6c37fa6c24876fab88c2e7cd86ca6a8ac2 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Tue, 25 Oct 2016 08:53:34 +0800 Subject: [PATCH] MDL-56516 tool_usertous: Remove eroneous test --- admin/tool/usertours/classes/manager.php | 1 - admin/tool/usertours/tests/manager_test.php | 29 +-------------------- 2 files changed, 1 insertion(+), 29 deletions(-) diff --git a/admin/tool/usertours/classes/manager.php b/admin/tool/usertours/classes/manager.php index d9589fc33aa..47e46330fd3 100644 --- a/admin/tool/usertours/classes/manager.php +++ b/admin/tool/usertours/classes/manager.php @@ -561,7 +561,6 @@ class manager { public static function get_matching_tours(\moodle_url $pageurl) { global $PAGE; - $tours = cache::get_matching_tourdata($pageurl->out_as_local_url()); foreach ($tours as $record) { diff --git a/admin/tool/usertours/tests/manager_test.php b/admin/tool/usertours/tests/manager_test.php index f32727a9bbe..321ff065051 100644 --- a/admin/tool/usertours/tests/manager_test.php +++ b/admin/tool/usertours/tests/manager_test.php @@ -242,10 +242,7 @@ class tool_usertours_manager_testcase extends advanced_testcase { $this->resetAfterTest(); foreach ($alltours as $tourconfig) { - $tourconfig = (object) $tourconfig; - $tourconfig->id = null; - $tour = \tool_usertours\tour::load_from_record($tourconfig, true); - $tour->persist(true); + $tour = $this->helper_create_tour((object) $tourconfig); $this->helper_create_step((object) ['tourid' => $tour->get_id()]); } @@ -257,28 +254,4 @@ class tool_usertours_manager_testcase extends advanced_testcase { $this->assertEquals($expected, $match->get_name()); } } - - /** - * Tests for the get_matching_tours function when requiring an upgrade - * - * @dataProvider get_matching_tours_provider - * @param array $alltours The list of tours to insert - * @param string $url The URL to test - * @param string $expected The name of the expected matching tour - */ - public function test_get_matching_tours_requires_upgrade($alltours, $url, $expected) { - $this->resetAfterTest(); - - global $CFG; - unset($CFG->version); - - foreach ($alltours as $tourconfig) { - $tourconfig = (object) $tourconfig; - $tourconfig->id = null; - $tour = \tool_usertours\tour::load_from_record($tourconfig, true); - $tour->persist(true); - } - - $this->assertNull(\tool_usertours\manager::get_matching_tours(new moodle_url($url))); - } }