-* @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],