From 8ca4a0087dfee94d01f296b306c09ccfb329209b Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Fri, 30 Sep 2022 16:36:31 +0800 Subject: [PATCH] MDL-75614 dml: Unit tests must test something --- lib/dml/tests/dml_test.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/dml/tests/dml_test.php b/lib/dml/tests/dml_test.php index 4f01f49d9f8..b05090d0cef 100644 --- a/lib/dml/tests/dml_test.php +++ b/lib/dml/tests/dml_test.php @@ -532,14 +532,15 @@ EOD; /** * Just a test log function */ - public function log() { + public function get_site() { global $DB; - $DB->get_records_sql('SELECT firstname FROM {user} WHERE firstname = :firstname', ['firstname' => 'JohnDoe']); + + return $DB->get_record('course', ['category' => 0]); } }; - $another->log(); + $site = $another->get_site(); $CFG->debugsqltrace = 0; - // No assertions just it should not error. + $this->assertEquals(get_site(), $site); } public function test_strtok() {