Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 23... Línea 23...
23
 * @category test
23
 * @category test
24
 * @copyright 2022 The Open University
24
 * @copyright 2022 The Open University
25
 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
25
 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
26
 * @covers \core_cache\allow_temporary_caches
26
 * @covers \core_cache\allow_temporary_caches
27
 */
27
 */
28
class allow_temporary_caches_test extends \advanced_testcase {
28
final class allow_temporary_caches_test extends \advanced_testcase {
29
 
-
 
30
    /**
29
    /**
31
     * Tests whether temporary caches are allowed.
30
     * Tests whether temporary caches are allowed.
32
     */
31
     */
33
    public function test_is_allowed(): void {
32
    public function test_is_allowed(): void {
34
        // Not allowed by default.
33
        // Not allowed by default.
Línea 90... Línea 89...
90
            // Let's actually use modinfo, to check it works with locking too.
89
            // Let's actually use modinfo, to check it works with locking too.
91
            $course = $this->getDataGenerator()->create_course();
90
            $course = $this->getDataGenerator()->create_course();
92
            get_fast_modinfo($course);
91
            get_fast_modinfo($course);
93
        } finally {
92
        } finally {
94
            // You have to do this after phpunit_disable or it breaks later tests.
93
            // You have to do this after phpunit_disable or it breaks later tests.
95
            \cache_factory::reset();
94
            factory::reset();
96
            \cache_factory::instance(true);
95
            factory::instance(true);
97
        }
96
        }
98
    }
97
    }
99
}
98
}