From 1d74ef12551eedfae8a0d5a92847445ea153362a Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Tue, 13 Dec 2022 11:22:33 +0000 Subject: [PATCH] MDL-70070 phpunit: correct data provider method names. They should not be prefixed `test_` because that's how actual test methods containing assertions are identified by PHPUnit. --- .../log/store/database/tests/store_test.php | 7 ++-- .../log/store/standard/tests/store_test.php | 14 ++++---- .../completion/tests/condition_test.php | 8 ++--- calendar/tests/externallib_test.php | 6 ++-- calendar/tests/std_proxy_test.php | 12 +++---- filter/mathjaxloader/tests/filter_test.php | 15 +++------ .../mathjaxloader/tests/filtermath_test.php | 4 +-- h5p/tests/framework_test.php | 22 ++++--------- h5p/tests/generator_test.php | 33 +++++++------------ lib/ddl/tests/ddl_test.php | 8 ++--- .../mustache_template_source_loader_test.php | 12 +++---- lib/tests/plugininfo/base_test.php | 25 +++++--------- lib/tests/task_manager_test.php | 4 +-- message/tests/api_test.php | 4 +-- message/tests/externallib_test.php | 6 ++-- mod/assign/tests/locallib_test.php | 4 +-- mod/forum/tests/entities_discussion_test.php | 4 +-- 17 files changed, 76 insertions(+), 112 deletions(-) diff --git a/admin/tool/log/store/database/tests/store_test.php b/admin/tool/log/store/database/tests/store_test.php index 10dab29ce41..9d1b4d81a5a 100644 --- a/admin/tool/log/store/database/tests/store_test.php +++ b/admin/tool/log/store/database/tests/store_test.php @@ -32,8 +32,7 @@ class logstore_database_store_testcase extends advanced_testcase { * Tests log writing. * * @param bool $jsonformat True to test with JSON format - * @dataProvider test_log_writing_provider - * @throws moodle_exception + * @dataProvider log_writing_provider */ public function test_log_writing(bool $jsonformat) { global $DB, $CFG; @@ -251,9 +250,9 @@ class logstore_database_store_testcase extends advanced_testcase { * Returns different JSON format settings so the test can be run with JSON format either on or * off. * - * @return [bool] Array of true/false + * @return bool[] Array of true/false */ - public static function test_log_writing_provider(): array { + public static function log_writing_provider(): array { return [ [false], [true] diff --git a/admin/tool/log/store/standard/tests/store_test.php b/admin/tool/log/store/standard/tests/store_test.php index 1492718b0fb..4170d32f7ee 100644 --- a/admin/tool/log/store/standard/tests/store_test.php +++ b/admin/tool/log/store/standard/tests/store_test.php @@ -37,8 +37,7 @@ class logstore_standard_store_testcase extends advanced_testcase { * Tests log writing. * * @param bool $jsonformat True to test with JSON format - * @dataProvider test_log_writing_provider - * @throws moodle_exception + * @dataProvider log_writing_provider */ public function test_log_writing(bool $jsonformat) { global $DB; @@ -222,9 +221,9 @@ class logstore_standard_store_testcase extends advanced_testcase { * Returns different JSON format settings so the test can be run with JSON format either on or * off. * - * @return [bool] Array of true/false + * @return bool[] Array of true/false */ - public static function test_log_writing_provider(): array { + public static function log_writing_provider(): array { return [ [false], [true] @@ -367,7 +366,7 @@ class logstore_standard_store_testcase extends advanced_testcase { * Tests the decode_other function can cope with both JSON and PHP serialized format. * * @param mixed $value Value to encode and decode - * @dataProvider test_decode_other_provider + * @dataProvider decode_other_provider */ public function test_decode_other($value) { $this->assertEquals($value, \logstore_standard\log\store::decode_other(serialize($value))); @@ -386,7 +385,7 @@ class logstore_standard_store_testcase extends advanced_testcase { * * @return array Array of parameters */ - public function test_decode_other_provider(): array { + public function decode_other_provider(): array { return [ [['info' => 'd2819896', 'logurl' => 'discuss.php?d=2819896']], [null], @@ -399,8 +398,7 @@ class logstore_standard_store_testcase extends advanced_testcase { * Checks that backup and restore of log data works correctly. * * @param bool $jsonformat True to test with JSON format - * @dataProvider test_log_writing_provider - * @throws moodle_exception + * @dataProvider log_writing_provider */ public function test_backup_restore(bool $jsonformat) { global $DB; diff --git a/availability/condition/completion/tests/condition_test.php b/availability/condition/completion/tests/condition_test.php index b1a004093c6..4c30190289d 100644 --- a/availability/condition/completion/tests/condition_test.php +++ b/availability/condition/completion/tests/condition_test.php @@ -386,7 +386,7 @@ class availability_completion_condition_testcase extends advanced_testcase { /** * Tests the is_available and get_description functions for previous activity option. * - * @dataProvider test_previous_activity_data + * @dataProvider previous_activity_data * @param int $grade the current assign grade (0 for none) * @param int $condition true for complete, false for incomplete * @param string $mark activity to mark as complete @@ -475,7 +475,7 @@ class availability_completion_condition_testcase extends advanced_testcase { $this->assertRegExp($description, $information); } - public function test_previous_activity_data(): array { + public function previous_activity_data(): array { // Assign grade, condition, activity to complete, activity to test, result, resultnot, description. return [ 'Missing previous activity complete' => [ @@ -567,7 +567,7 @@ class availability_completion_condition_testcase extends advanced_testcase { * Tests the is_available and get_description functions for * previous activity option in course sections. * - * @dataProvider test_section_previous_activity_data + * @dataProvider section_previous_activity_data * @param int $condition condition value * @param bool $mark if Page 1 must be mark as completed * @param string $section section to add the availability @@ -640,7 +640,7 @@ class availability_completion_condition_testcase extends advanced_testcase { } - public function test_section_previous_activity_data(): array { + public function section_previous_activity_data(): array { return [ // Condition, Activity completion, section to test, result, resultnot, description. 'Completion complete Section with no previous activity' => [ diff --git a/calendar/tests/externallib_test.php b/calendar/tests/externallib_test.php index 9e3ed4dd07a..50e32debad6 100644 --- a/calendar/tests/externallib_test.php +++ b/calendar/tests/externallib_test.php @@ -2643,7 +2643,7 @@ class core_calendar_externallib_testcase extends externallib_advanced_testcase { * Prevent user from reading other user's event. * * @covers \core_calendar_external::get_calendar_event_by_id - * @dataProvider test_get_calendar_event_by_id_prevent_read_other_users_events_data_provider + * @dataProvider get_calendar_event_by_id_prevent_read_other_users_events_data_provider * * @param bool $isadminevent Is admin's event * @param bool $isadmin Is current user admin user @@ -2713,7 +2713,7 @@ class core_calendar_externallib_testcase extends externallib_advanced_testcase { /** * Test the behavior of deleting other users' user events. * - * @dataProvider test_edit_or_delete_other_users_events_data_provider + * @dataProvider edit_or_delete_other_users_events_data_provider * @covers \core_calendar_external::delete_calendar_events * @param bool $isadmin Whether the current user is admin. * @param bool $isadminevent Whether it's an admin event or not. @@ -2760,7 +2760,7 @@ class core_calendar_externallib_testcase extends externallib_advanced_testcase { /** * Test the behavior of editing other users' user events * - * @dataProvider test_edit_or_delete_other_users_events_data_provider + * @dataProvider edit_or_delete_other_users_events_data_provider * @covers \core_calendar_external::submit_create_update_form * @param bool $isadmin Whether the current user is admin. * @param bool $isadminevent Whether it's an admin event or not. diff --git a/calendar/tests/std_proxy_test.php b/calendar/tests/std_proxy_test.php index dc9f25e3efb..c0b78897c50 100644 --- a/calendar/tests/std_proxy_test.php +++ b/calendar/tests/std_proxy_test.php @@ -56,7 +56,7 @@ class core_calendar_std_proxy_testcase extends advanced_testcase { /** * Test proxying. * - * @dataProvider test_proxy_testcases() + * @dataProvider proxy_testcases * @param int $id Object ID. * @param string $member Object member to retrieve. * @param mixed $expected Expected value of member. @@ -72,7 +72,7 @@ class core_calendar_std_proxy_testcase extends advanced_testcase { /** * Test setting values with a base class. * - * @dataProvider test_proxy_testcases() + * @dataProvider proxy_testcases * @param int $id Object ID. * @param string $member Object member to retrieve. * @param mixed $storedvalue Value as would be stored externally. @@ -93,7 +93,7 @@ class core_calendar_std_proxy_testcase extends advanced_testcase { /** * Test getting a non existant member. * - * @dataProvider test_get_set_testcases() + * @dataProvider get_set_testcases * @param int $id ID of the object being proxied. */ public function test_get_invalid_member($id) { @@ -108,7 +108,7 @@ class core_calendar_std_proxy_testcase extends advanced_testcase { /** * Test get proxied instance. * - * @dataProvider test_get_set_testcases() + * @dataProvider get_set_testcases * @param int $id Object ID. */ public function test_get_proxied_instance($id) { @@ -122,7 +122,7 @@ class core_calendar_std_proxy_testcase extends advanced_testcase { /** * Test cases for proxying test. */ - public function test_proxy_testcases() { + public function proxy_testcases() { return [ 'Object 1 member 1' => [ 1, @@ -160,7 +160,7 @@ class core_calendar_std_proxy_testcase extends advanced_testcase { /** * Test cases for getting and setting tests. */ - public function test_get_set_testcases() { + public function get_set_testcases() { return [ 'Object 1' => [1], 'Object 2' => [5] diff --git a/filter/mathjaxloader/tests/filter_test.php b/filter/mathjaxloader/tests/filter_test.php index 06eeb7989c3..75326673d9d 100644 --- a/filter/mathjaxloader/tests/filter_test.php +++ b/filter/mathjaxloader/tests/filter_test.php @@ -14,15 +14,6 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -/** - * Provides the {@link filter_mathjaxloader_filter_testcase} class. - * - * @package filter_mathjaxloader - * @category test - * @copyright 2017 David Mudrák - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ - defined('MOODLE_INTERNAL') || die(); global $CFG; @@ -31,6 +22,8 @@ require_once($CFG->dirroot.'/filter/mathjaxloader/filter.php'); /** * Unit tests for the MathJax loader filter. * + * @package filter_mathjaxloader + * @category test * @copyright 2017 David Mudrak * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -42,7 +35,7 @@ class filter_mathjaxloader_filter_testcase extends advanced_testcase { * @param string $moodlelangcode the user's current language * @param string $mathjaxlangcode the mathjax language to be used for the moodle language * - * @dataProvider test_map_language_code_expected_mappings + * @dataProvider map_language_code_expected_mappings */ public function test_map_language_code($moodlelangcode, $mathjaxlangcode) { @@ -55,7 +48,7 @@ class filter_mathjaxloader_filter_testcase extends advanced_testcase { * * @return array of [moodlelangcode, mathjaxcode] tuples */ - public function test_map_language_code_expected_mappings() { + public function map_language_code_expected_mappings() { return [ ['cz', 'cs'], // Explicit mapping. diff --git a/filter/mathjaxloader/tests/filtermath_test.php b/filter/mathjaxloader/tests/filtermath_test.php index 31bd1ee0677..9f6b12ed3f6 100644 --- a/filter/mathjaxloader/tests/filtermath_test.php +++ b/filter/mathjaxloader/tests/filtermath_test.php @@ -38,7 +38,7 @@ class filter_mathjaxloader_filtermath_testcase extends advanced_testcase { * @param string $inputtext The text given by the user. * @param string $expected The expected output after filtering. * - * @dataProvider test_math_filtering_inputs + * @dataProvider math_filtering_inputs */ public function test_math_filtering($inputtext, $expected) { $filter = new filter_mathjaxloader(context_system::instance(), []); @@ -50,7 +50,7 @@ class filter_mathjaxloader_filtermath_testcase extends advanced_testcase { * * @return array of [inputtext, expectedoutput] tuples. */ - public function test_math_filtering_inputs() { + public function math_filtering_inputs() { return [ // One inline formula. ['Some inline math \\( y = x^2 \\).', diff --git a/h5p/tests/framework_test.php b/h5p/tests/framework_test.php index cee8266744b..e95459229fd 100644 --- a/h5p/tests/framework_test.php +++ b/h5p/tests/framework_test.php @@ -14,15 +14,6 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -/** - * Testing the H5PFrameworkInterface interface implementation. - * - * @package core_h5p - * @category test - * @copyright 2019 Mihail Geshoski - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ - namespace core_h5p; use core_collator; @@ -32,6 +23,7 @@ use core_collator; * Test class covering the H5PFrameworkInterface interface implementation. * * @package core_h5p + * @category test * @copyright 2019 Mihail Geshoski * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @runTestsInSeparateProcesses @@ -587,7 +579,7 @@ class framework_testcase extends \advanced_testcase { /** * Test the behaviour of isPatchedLibrary(). * - * @dataProvider test_isPatchedLibrary_provider + * @dataProvider isPatchedLibrary_provider * @param array $libraryrecords Array containing data for the library creation * @param array $testlibrary Array containing the test library data * @param bool $expected The expectation whether the library is patched or not @@ -609,7 +601,7 @@ class framework_testcase extends \advanced_testcase { * * @return array */ - public function test_isPatchedLibrary_provider(): array { + public function isPatchedLibrary_provider(): array { return [ 'Unpatched library. No different versioning' => [ [ @@ -1365,7 +1357,7 @@ class framework_testcase extends \advanced_testcase { /** * Test the behaviour of loadLibrarySemantics(). * - * @dataProvider test_loadLibrarySemantics_provider + * @dataProvider loadLibrarySemantics_provider * @param array $libraryrecords Array containing data for the library creation * @param array $testlibrary Array containing the test library data * @param string $expected The expected semantics value @@ -1388,7 +1380,7 @@ class framework_testcase extends \advanced_testcase { * * @return array */ - public function test_loadLibrarySemantics_provider(): array { + public function loadLibrarySemantics_provider(): array { $semantics = json_encode( [ @@ -2157,7 +2149,7 @@ class framework_testcase extends \advanced_testcase { /** * Test the behaviour of test_libraryHasUpgrade(). * - * @dataProvider test_libraryHasUpgrade_provider + * @dataProvider libraryHasUpgrade_provider * @param array $libraryrecords Array containing data for the library creation * @param array $testlibrary Array containing the test library data * @param bool $expected The expectation whether the library is patched or not @@ -2179,7 +2171,7 @@ class framework_testcase extends \advanced_testcase { * * @return array */ - public function test_libraryHasUpgrade_provider(): array { + public function libraryHasUpgrade_provider(): array { return [ 'Lower major version; Identical lower version' => [ [ diff --git a/h5p/tests/generator_test.php b/h5p/tests/generator_test.php index dc266f5f2f8..69b5f050bcc 100644 --- a/h5p/tests/generator_test.php +++ b/h5p/tests/generator_test.php @@ -14,23 +14,12 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -/** -* Test class covering the h5p data generator class. -* -* @package core_h5p -* @category test -* @copyright 2019 Mihail Geshoski -* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later -*/ - namespace core_h5p; use core_h5p\local\library\autoloader; -defined('MOODLE_INTERNAL') || die(); - /** -* Generator testcase for the core_grading generator. +* Test class covering the h5p data generator class. * * @package core_h5p * @category test @@ -165,7 +154,7 @@ class generator_testcase extends \advanced_testcase { * Test the behaviour of generate_h5p_data(). Test whether library files are created or not * on filesystem depending what the method defines. * - * @dataProvider test_generate_h5p_data_files_creation_provider + * @dataProvider generate_h5p_data_files_creation_provider * @param bool $createlibraryfiles Whether to create library files on the filesystem * @param bool $expected The expectation whether the files have been created or not **/ @@ -205,7 +194,7 @@ class generator_testcase extends \advanced_testcase { * * @return array */ - public function test_generate_h5p_data_files_creation_provider(): array { + public function generate_h5p_data_files_creation_provider(): array { return [ 'Do not create library related files on the filesystem' => [ false, @@ -256,7 +245,7 @@ class generator_testcase extends \advanced_testcase { * Test the behaviour of create_h5p_record(). Test whather the h5p content data is * properly saved in the database. * - * @dataProvider test_create_h5p_record_provider + * @dataProvider create_h5p_record_provider * @param array $h5pdata The h5p content data * @param \stdClass $expected The expected saved data **/ @@ -282,7 +271,7 @@ class generator_testcase extends \advanced_testcase { * * @return array */ - public function test_create_h5p_record_provider(): array { + public function create_h5p_record_provider(): array { $createdjsoncontent = json_encode( array( 'text' => '

Created dummy text<\/p>\n', @@ -379,7 +368,7 @@ class generator_testcase extends \advanced_testcase { * Test the behaviour of create_contents_libraries_record(). Test whether the contents libraries * are properly saved in the database. * - * @dataProvider test_create_contents_libraries_record_provider + * @dataProvider create_contents_libraries_record_provider * @param array $contentslibrariestdata The h5p contents libraries data. * @param \stdClass $expected The expected saved data. **/ @@ -403,7 +392,7 @@ class generator_testcase extends \advanced_testcase { * * @return array */ - public function test_create_contents_libraries_record_provider(): array { + public function create_contents_libraries_record_provider(): array { return [ 'Create h5p content library with set dependency type' => [ [ @@ -439,7 +428,7 @@ class generator_testcase extends \advanced_testcase { * Test the behaviour of create_library_dependency_record(). Test whether the contents libraries * are properly saved in the database. * - * @dataProvider test_create_library_dependency_record_provider + * @dataProvider create_library_dependency_record_provider * @param array $librarydependencydata The library dependency data. * @param \stdClass $expected The expected saved data. **/ @@ -463,7 +452,7 @@ class generator_testcase extends \advanced_testcase { * * @return array */ - public function test_create_library_dependency_record_provider(): array { + public function create_library_dependency_record_provider(): array { return [ 'Create h5p library dependency with set dependency type' => [ [ @@ -494,7 +483,7 @@ class generator_testcase extends \advanced_testcase { /** * Test the behaviour of create_content_file(). Test whether a file belonging to a content is created. * - * @dataProvider test_create_content_file_provider + * @dataProvider create_content_file_provider * @param array $filedata Data from the file to be created. * @param array $expecteddata Data expected.Data from the file to be created. */ @@ -529,7 +518,7 @@ class generator_testcase extends \advanced_testcase { * * @return array **/ - public function test_create_content_file_provider(): array { + public function create_content_file_provider(): array { return [ 'Create file in content with id 4' => [ [ diff --git a/lib/ddl/tests/ddl_test.php b/lib/ddl/tests/ddl_test.php index 852b9e95133..47b5ff5469f 100644 --- a/lib/ddl/tests/ddl_test.php +++ b/lib/ddl/tests/ddl_test.php @@ -2258,7 +2258,7 @@ class core_ddl_testcase extends database_driver_testcase { * * @return array The type-value pair fixture. */ - public function test_get_enc_quoted_provider() { + public function get_enc_quoted_provider() { return array( // Reserved: some examples from SQL-92. [true, 'from'], @@ -2272,7 +2272,7 @@ class core_ddl_testcase extends database_driver_testcase { /** * This is a test for sql_generator::getEncQuoted(). * - * @dataProvider test_get_enc_quoted_provider + * @dataProvider get_enc_quoted_provider * @param bool $reserved Whether the column name is reserved or not. * @param string $columnname The column name to be quoted, according to the value of $reserved. **/ @@ -2307,7 +2307,7 @@ class core_ddl_testcase extends database_driver_testcase { * * @return array The type-old-new tuple fixture. */ - public function test_sql_generator_get_rename_field_sql_provider() { + public function sql_generator_get_rename_field_sql_provider() { return array( // Reserved: an example from SQL-92. // Both names should be reserved. @@ -2320,7 +2320,7 @@ class core_ddl_testcase extends database_driver_testcase { /** * This is a unit test for sql_generator::getRenameFieldSQL(). * - * @dataProvider test_sql_generator_get_rename_field_sql_provider + * @dataProvider sql_generator_get_rename_field_sql_provider * @param bool $reserved Whether the column name is reserved or not. * @param string $oldcolumnname The column name to be renamed. * @param string $newcolumnname The new column name. diff --git a/lib/tests/mustache_template_source_loader_test.php b/lib/tests/mustache_template_source_loader_test.php index a0e30db7b16..53ebb136816 100644 --- a/lib/tests/mustache_template_source_loader_test.php +++ b/lib/tests/mustache_template_source_loader_test.php @@ -142,7 +142,7 @@ TBC; /** * Data provider for the test_load function. */ - public function test_load_test_cases() { + public function load_test_cases() { $cache = [ 'core' => [ 'test' => '{{! a comment }}The rest of the template' @@ -171,7 +171,7 @@ TBC; /** * Test the load function. * - * @dataProvider test_load_test_cases() + * @dataProvider load_test_cases * @param mustache_template_source_loader $loader The loader * @param string $component The moodle component * @param string $name The template name @@ -185,7 +185,7 @@ TBC; /** * Data provider for the load_with_dependencies function. */ - public function test_load_with_dependencies_test_cases() { + public function load_with_dependencies_test_cases() { // Create a bunch of templates that include one another in various ways. There is // multiple instances of recursive inclusions to test that the code doensn't get // stuck in an infinite loop. @@ -338,7 +338,7 @@ TBC; /** * Test the load_with_dependencies function. * - * @dataProvider test_load_with_dependencies_test_cases() + * @dataProvider load_with_dependencies_test_cases * @param mustache_template_source_loader $loader The loader * @param string $component The moodle component * @param string $name The template name @@ -352,7 +352,7 @@ TBC; /** * Data provider for the test_load function. */ - public function test_scan_template_source_for_dependencies_test_cases() { + public function scan_template_source_for_dependencies_test_cases() { $foo = '{{! a comment }}{{> core/bar }}{{< test/bop }}{{/ test/bop}}{{#str}} help, core {{/str}}'; $bar = '{{! a comment }}{{> core/baz }}'; $baz = '{{! a comment }}{{#str}} hide, core {{/str}}'; @@ -496,7 +496,7 @@ TEMPLATE; /** * Test the scan_template_source_for_dependencies function. * - * @dataProvider test_scan_template_source_for_dependencies_test_cases() + * @dataProvider scan_template_source_for_dependencies_test_cases() * @param mustache_template_source_loader $loader The loader * @param string $source The template to test * @param string $expected The expected output diff --git a/lib/tests/plugininfo/base_test.php b/lib/tests/plugininfo/base_test.php index d5b805fa992..352350cc21e 100644 --- a/lib/tests/plugininfo/base_test.php +++ b/lib/tests/plugininfo/base_test.php @@ -14,6 +14,13 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . +declare(strict_types = 1); + +namespace core\plugininfo; + +use testable_core_plugin_manager; +use testable_plugininfo_base; + /** * Unit tests for plugin base class. * @@ -21,20 +28,6 @@ * @copyright 2019 Andrew Nicols * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ - -declare(strict_types = 1); -namespace core\plugininfo; - -defined('MOODLE_INTERNAL') || die(); - -use core_plugin_manager; -use testable_core_plugin_manager; -use testable_plugininfo_base; - - -/** - * Tests of the basic API of the plugin manager. - */ class base_testcase extends \advanced_testcase { /** @@ -172,7 +165,7 @@ class base_testcase extends \advanced_testcase { * Test the load_disk_version function to check that it handles a range of correct supported and incompatible field * definitions. * - * @dataProvider test_load_disk_version_branch_supports_provider + * @dataProvider load_disk_version_branch_supports_provider * @param array|null $supported Supported versions to inject * @param string|int|null $incompatible Incompatible version to inject. * @param int $version Version to test @@ -204,7 +197,7 @@ class base_testcase extends \advanced_testcase { * * @return array */ - public function test_load_disk_version_branch_supports_provider(): array { + public function load_disk_version_branch_supports_provider(): array { return [ 'Range, branch in support, lowest' => [ 'supported' => [29, 31], diff --git a/lib/tests/task_manager_test.php b/lib/tests/task_manager_test.php index b3007e9a265..62c39bed86d 100644 --- a/lib/tests/task_manager_test.php +++ b/lib/tests/task_manager_test.php @@ -32,7 +32,7 @@ defined('MOODLE_INTERNAL') || die(); */ class core_task_manager_testcase extends advanced_testcase { - public function test_ensure_adhoc_task_qos_provider() { + public function ensure_adhoc_task_qos_provider() { return [ [ [], @@ -176,7 +176,7 @@ class core_task_manager_testcase extends advanced_testcase { /** * Test that the Quality of Service reordering works. * - * @dataProvider test_ensure_adhoc_task_qos_provider + * @dataProvider ensure_adhoc_task_qos_provider * * @param array $input array of tasks * @param array $expected array of reordered tasks diff --git a/message/tests/api_test.php b/message/tests/api_test.php index e1e1a54023a..451810fb297 100644 --- a/message/tests/api_test.php +++ b/message/tests/api_test.php @@ -6806,7 +6806,7 @@ class core_message_api_testcase extends core_message_messagelib_testcase { /** * Test the get_conversation_counts() function. * - * @dataProvider test_get_conversation_counts_test_cases() + * @dataProvider get_conversation_counts_test_cases * @param array $conversationconfigs Conversations to create * @param int $deletemessagesuser The user who is deleting the messages * @param array $deletemessages The list of messages to delete (by index) @@ -6929,7 +6929,7 @@ class core_message_api_testcase extends core_message_messagelib_testcase { /** * Test the get_unread_conversation_counts() function. * - * @dataProvider test_get_conversation_counts_test_cases() + * @dataProvider get_conversation_counts_test_cases * @param array $conversationconfigs Conversations to create * @param int $deletemessagesuser The user who is deleting the messages * @param array $deletemessages The list of messages to delete (by index) diff --git a/message/tests/externallib_test.php b/message/tests/externallib_test.php index a082fbee3ad..64a1c2c4376 100644 --- a/message/tests/externallib_test.php +++ b/message/tests/externallib_test.php @@ -6803,7 +6803,7 @@ class core_message_externallib_testcase extends externallib_advanced_testcase { /** * Data provider for test_get_conversation_counts(). */ - public function test_get_conversation_counts_test_cases() { + public function get_conversation_counts_test_cases() { $typeindividual = \core_message\api::MESSAGE_CONVERSATION_TYPE_INDIVIDUAL; $typegroup = \core_message\api::MESSAGE_CONVERSATION_TYPE_GROUP; $typeself = \core_message\api::MESSAGE_CONVERSATION_TYPE_SELF; @@ -7166,7 +7166,7 @@ class core_message_externallib_testcase extends externallib_advanced_testcase { /** * Test the get_conversation_counts() function. * - * @dataProvider test_get_conversation_counts_test_cases() + * @dataProvider get_conversation_counts_test_cases() * @param array $conversationconfigs Conversations to create * @param int $deletemessagesuser The user who is deleting the messages * @param array $deletemessages The list of messages to delete (by index) @@ -7263,7 +7263,7 @@ class core_message_externallib_testcase extends externallib_advanced_testcase { /** * Test the get_unread_conversation_counts() function. * - * @dataProvider test_get_conversation_counts_test_cases() + * @dataProvider get_conversation_counts_test_cases * @param array $conversationconfigs Conversations to create * @param int $deletemessagesuser The user who is deleting the messages * @param array $deletemessages The list of messages to delete (by index) diff --git a/mod/assign/tests/locallib_test.php b/mod/assign/tests/locallib_test.php index e27894ec591..1ea9bfb0d34 100644 --- a/mod/assign/tests/locallib_test.php +++ b/mod/assign/tests/locallib_test.php @@ -859,7 +859,7 @@ class mod_assign_locallib_testcase extends advanced_testcase { * We only test combinations of plugins here. Individual plugins are tested * in their respective test files. * - * @dataProvider test_new_submission_empty_testcases + * @dataProvider new_submission_empty_testcases * @param string $data The file submission data * @param bool $expected The expected return value */ @@ -899,7 +899,7 @@ class mod_assign_locallib_testcase extends advanced_testcase { * * @return array of testcases */ - public function test_new_submission_empty_testcases() { + public function new_submission_empty_testcases() { return [ 'With file and onlinetext' => [ [ diff --git a/mod/forum/tests/entities_discussion_test.php b/mod/forum/tests/entities_discussion_test.php index b4779010fc5..40844561d19 100644 --- a/mod/forum/tests/entities_discussion_test.php +++ b/mod/forum/tests/entities_discussion_test.php @@ -123,7 +123,7 @@ class mod_forum_entities_discussion_testcase extends advanced_testcase { * Test the display period settings for discussions. * This covers each individual date function as well as the combination of the 2. * - * @dataProvider test_diplay_period_options_provider + * @dataProvider diplay_period_options_provider * @param string $testdescription A basic description of the base assertions. * @param int $startoffset Start time offset with current time in seconds. * @param int $endoffset End time offset with current time in seconds. @@ -167,7 +167,7 @@ class mod_forum_entities_discussion_testcase extends advanced_testcase { * * @return array start/end time offsets and the expected results. */ - public function test_diplay_period_options_provider() { + public function diplay_period_options_provider() { return array( ["No dates set", 0, 0, true, false, true], ["Only started date in the future", 100, 0, false, false, false],