MDL-73785 phpunit: Move more tests to use correct names and namespaces
Applied the following changes to various testcase classes:
- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- Remove file phpdoc block
- Remove MOODLE_INTERNAL if not needed.
- Changed code to point to global scope when needed.
- Fix some relative paths and comments here and there.
- All them passing individually.
- Complete runs passing too.
Special mention to:
- When belonging to other components and being valid api:
- analytics related tests have been moved to tests/analytics subdir.
- backup & restore related tests have been moved to tests/backup subdir.
- events related tests have been moved to tests/event subdir.
- privacy related tests have been moved to tests/privacy.
- task related tests have been moved to tests/task subdir.
- Some simple renames, not including the component part anymore (not
needed now that they are namespaced):
- some xxxlib_test.php have been renamed lib_test.php
(when they where testing the corresponding lib.php).
- cache stores tests have been all renamed store_test, originally
each one had its own name (file_test, apcu_test, redis_test...)
- assign feedback tests have been all renamed feedback_test, originally
each one had its own name (file_test, editpdf_test...)
This commit is contained in:
@@ -14,16 +14,9 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Test completion progress API.
|
||||
*
|
||||
* @package core_completion
|
||||
* @category test
|
||||
* @copyright 2017 Mark Nelson <[email protected]>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
namespace core_completion;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
use completion_completion;
|
||||
|
||||
/**
|
||||
* Test completion progress API.
|
||||
@@ -33,7 +26,7 @@ defined('MOODLE_INTERNAL') || die();
|
||||
* @copyright 2017 Mark Nelson <[email protected]>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class core_completion_progress_testcase extends advanced_testcase {
|
||||
class progress_test extends \advanced_testcase {
|
||||
|
||||
/**
|
||||
* Test setup.
|
||||
@@ -75,7 +68,7 @@ class core_completion_progress_testcase extends advanced_testcase {
|
||||
// Mark two of them as completed for a user.
|
||||
$cmassign = get_coursemodule_from_id('assign', $assign->cmid);
|
||||
$cmdata = get_coursemodule_from_id('data', $data->cmid);
|
||||
$completion = new completion_info($course);
|
||||
$completion = new \completion_info($course);
|
||||
$completion->update_state($cmassign, COMPLETION_COMPLETE, $user->id);
|
||||
$completion->update_state($cmdata, COMPLETION_COMPLETE, $user->id);
|
||||
|
||||
@@ -114,7 +107,7 @@ class core_completion_progress_testcase extends advanced_testcase {
|
||||
// Mark two of them as completed for a user.
|
||||
$cmassign = get_coursemodule_from_id('assign', $assign->cmid);
|
||||
$cmdata = get_coursemodule_from_id('data', $data->cmid);
|
||||
$completion = new completion_info($course);
|
||||
$completion = new \completion_info($course);
|
||||
$completion->update_state($cmassign, COMPLETION_COMPLETE, $user->id);
|
||||
$completion->update_state($cmdata, COMPLETION_COMPLETE, $user->id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user