From bd01a91ae082e3e72c3b48a41cac170005767781 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Thu, 17 Oct 2024 14:34:17 +0800 Subject: [PATCH] MDL-83468 phpunit: Add back getName to testcase In some situations we use the name of the test so we must keep `getName()` for backwards compatibility. --- lib/phpunit/classes/basic_testcase.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/phpunit/classes/basic_testcase.php b/lib/phpunit/classes/basic_testcase.php index 695a2d5e7a4..0abdb3fc005 100644 --- a/lib/phpunit/classes/basic_testcase.php +++ b/lib/phpunit/classes/basic_testcase.php @@ -50,4 +50,14 @@ abstract class basic_testcase extends base_testcase { phpunit_util::reset_all_data(true); } + + /** + * Get the name of the test. + * + * Replaces the original PHPUnit method. + * @return string + */ + final public function getName(): string { + return $this->name(); + } }