From a999b12e02e04cae2582c2bc4d04e27b415f2ead Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Thu, 3 Feb 2022 11:09:50 +0800 Subject: [PATCH] MDL-72246 core_completion: Stop testing the inner workings of get_data() --- lib/tests/completionlib_test.php | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/lib/tests/completionlib_test.php b/lib/tests/completionlib_test.php index 00ae923f469..e35f5be614f 100644 --- a/lib/tests/completionlib_test.php +++ b/lib/tests/completionlib_test.php @@ -760,26 +760,6 @@ class core_completionlib_testcase extends advanced_testcase { $this->assertEquals(0, $result->id); } - // Check caching. - $key = "{$user->id}_{$this->course->id}"; - $cache = cache::make('core', 'completion'); - if ($iscached) { - // If we expect this to be cached, then fetching the result must match the cached data. - $this->assertEquals($result, (object)$cache->get($key)[$cm->id]); - - // Check cached data for other course modules in the course. - // The sample module created in setup_data() should suffice to confirm this. - $othercm = get_coursemodule_from_instance('forum', $this->module1->id); - if ($wholecourse) { - $this->assertArrayHasKey($othercm->id, $cache->get($key)); - } else { - $this->assertArrayNotHasKey($othercm->id, $cache->get($key)); - } - } else { - // Otherwise, this should not be cached. - $this->assertFalse($cache->get($key)); - } - // Check that we are including relevant completion data for the module. if (!$wholecourse) { $this->assertTrue(property_exists($result, 'viewed'));