forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-37655 phpunit: Avoid having multiple testcase classes in 1 file
Note that there wasn't any case of multiple testcase classes in 1 file. All the cases reported in the issue were false positives caused but other "mock/fixture" files being named _test. So all this issue does is: 1) rename any _test suffixed class in test files, because we are going to start renaming a lot of test classes to _test. 2) ensure that the 2 test case classes modified in this issue, are already observing the filename = classname rule that will be implemented soon (and verigy it works).
- Loading branch information
Showing
4 changed files
with
27 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ | |
* @copyright 2017 Andrew nicols <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class core_files_converter_testcase extends advanced_testcase { | ||
class converter_test extends advanced_testcase { | ||
|
||
/** | ||
* Get a testable mock of the abstract files_converter class. | ||
|
@@ -247,7 +247,7 @@ public function test_get_document_converter_classes_plugin_class_not_found() { | |
* Test the get_document_converter_classes function when the returned classes do not meet requirements. | ||
*/ | ||
public function test_get_document_converter_classes_plugin_class_requirements_not_met() { | ||
$plugin = $this->getMockBuilder(\core_file_converter_requirements_not_met_test::class) | ||
$plugin = $this->getMockBuilder(\core_file_converter_requirements_not_met::class) | ||
->onlyMethods([]) | ||
->getMock(); | ||
|
||
|
@@ -266,7 +266,7 @@ public function test_get_document_converter_classes_plugin_class_requirements_no | |
* Test the get_document_converter_classes function when the returned classes do not meet requirements. | ||
*/ | ||
public function test_get_document_converter_classes_plugin_class_met_not_supported() { | ||
$plugin = $this->getMockBuilder(\core_file_converter_type_not_supported_test::class) | ||
$plugin = $this->getMockBuilder(\core_file_converter_type_not_supported::class) | ||
->onlyMethods([]) | ||
->getMock(); | ||
|
||
|
@@ -285,7 +285,7 @@ public function test_get_document_converter_classes_plugin_class_met_not_support | |
* Test the get_document_converter_classes function when the returned classes do not meet requirements. | ||
*/ | ||
public function test_get_document_converter_classes_plugin_class_met_and_supported() { | ||
$plugin = $this->getMockBuilder(\core_file_converter_type_supported_test::class) | ||
$plugin = $this->getMockBuilder(\core_file_converter_type_supported::class) | ||
->onlyMethods([]) | ||
->getMock(); | ||
$classname = get_class($plugin); | ||
|
@@ -741,7 +741,7 @@ public function test_get_next_converter_first() { | |
} | ||
} | ||
|
||
class core_file_converter_requirements_test_base implements \core_files\converter_interface { | ||
class core_file_converter_requirements_base implements \core_files\converter_interface { | ||
|
||
/** | ||
* Whether the plugin is configured and requirements are met. | ||
|
@@ -799,7 +799,7 @@ public function get_supported_conversions() { | |
* @copyright 2017 Andrew nicols <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class core_file_converter_requirements_not_met_test extends core_file_converter_requirements_test_base { | ||
class core_file_converter_requirements_not_met extends core_file_converter_requirements_base { | ||
} | ||
|
||
/** | ||
|
@@ -809,7 +809,7 @@ class core_file_converter_requirements_not_met_test extends core_file_converter_ | |
* @copyright 2017 Andrew nicols <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class core_file_converter_type_not_supported_test extends core_file_converter_requirements_test_base { | ||
class core_file_converter_type_not_supported extends core_file_converter_requirements_base { | ||
|
||
/** | ||
* Whether the plugin is configured and requirements are met. | ||
|
@@ -828,7 +828,7 @@ public static function are_requirements_met() { | |
* @copyright 2017 Andrew nicols <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class core_file_converter_type_supported_test extends core_file_converter_requirements_test_base { | ||
class core_file_converter_type_supported extends core_file_converter_requirements_base { | ||
|
||
/** | ||
* Whether the plugin is configured and requirements are met. | ||
|
@@ -858,7 +858,7 @@ public static function supports($from, $to) { | |
* @copyright 2017 Andrew nicols <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class core_file_converter_type_successful extends core_file_converter_requirements_test_base { | ||
class core_file_converter_type_successful extends core_file_converter_requirements_base { | ||
|
||
/** | ||
* Convert a document to a new format and return a conversion object relating to the conversion in progress. | ||
|
@@ -891,7 +891,7 @@ public static function supports($from, $to) { | |
* @copyright 2017 Andrew nicols <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class core_file_converter_type_failed extends core_file_converter_requirements_test_base { | ||
class core_file_converter_type_failed extends core_file_converter_requirements_base { | ||
|
||
/** | ||
* Whether the plugin is configured and requirements are met. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters