MDL-81520 mod_assign: Update tests to not extend assign_provider test

This commit is contained in:
Andrew Nicols
2024-12-11 12:30:21 +08:00
parent 7bb9f136d2
commit 3555770591
8 changed files with 57 additions and 80 deletions
@@ -0,0 +1,19 @@
issueNumber: MDL-81520
notes:
mod_assign:
- message: >
The unit test for the privacy provider has been marked as final.
A number of core tests had been incorrectly configured to extend this
test
but should instead be extending `\mod_assign\tests\provider_testcase`.
Any community plugins extending the `\mod_assign\privacy\provider_test`
test
class should be updated to extend `\mod_assign\tests\provider_testcase`
instead.
type: fixed
@@ -21,8 +21,10 @@ use mod_assign\tests\provider_testcase;
/**
* Unit tests for mod/assign/feedback/comments/classes/privacy/
*
* @package assignfeedback_comments
* @copyright 2018 Adrian Greeve <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @covers \assignfeedback_comments\privacy\provider
*/
final class provider_test extends provider_testcase {
/**
@@ -14,32 +14,29 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Unit tests for assignfeedback_editpdf.
*
* @package assignfeedback_editpdf
* @copyright 2018 Adrian Greeve <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace assignfeedback_editpdf\privacy;
defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once($CFG->dirroot . '/mod/assign/locallib.php');
require_once($CFG->dirroot . '/mod/assign/tests/privacy/provider_test.php');
use assignfeedback_editpdf\page_editor;
use mod_assign\privacy\assign_plugin_request_data;
/**
* Unit tests for mod/assign/feedback/editpdf/classes/privacy/
* Unit tests for mod/assign/feedback/editpdf/classes/privacy/provider.
*
* @package assignfeedback_editpdf
* @copyright 2018 Adrian Greeve <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @covers \assignfeedback_editpdf\privacy\provider
*/
final class provider_test extends \mod_assign\privacy\provider_test {
final class provider_test extends \mod_assign\tests\provider_testcase {
#[\Override]
public static function setUpBeforeClass(): void {
global $CFG;
parent::setUpBeforeClass();
require_once($CFG->dirroot . '/mod/assign/locallib.php');
}
#[\Override]
public function setUp(): void {
// Skip this test if ghostscript is not supported.
$result = \assignfeedback_editpdf\pdf::test_gs_path(false);
@@ -14,30 +14,26 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Unit tests for assignfeedback_file.
*
* @package assignfeedback_file
* @copyright 2018 Adrian Greeve <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace assignfeedback_file\privacy;
defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once($CFG->dirroot . '/mod/assign/locallib.php');
require_once($CFG->dirroot . '/mod/assign/tests/privacy/provider_test.php');
use mod_assign\privacy\assign_plugin_request_data;
/**
* Unit tests for mod/assign/feedback/file/classes/privacy/
* Unit tests for mod/assign/feedback/file/classes/privacy/provider.
*
* @copyright 2018 Adrian Greeve <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package assignfeedback_file
* @covers \assignfeedback_file\privacy\provider
*/
final class provider_test extends \mod_assign\privacy\provider_test {
final class provider_test extends \mod_assign\tests\provider_testcase {
#[\Override]
public static function setUpBeforeClass(): void {
global $CFG;
parent::setUpBeforeClass();
require_once($CFG->dirroot . '/mod/assign/locallib.php');
}
/**
* Convenience function for creating feedback data.
@@ -14,29 +14,19 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Unit tests for assignsubmission_comments.
*
* @package assignsubmission_comments
* @copyright 2018 Adrian Greeve <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace assignsubmission_comments\privacy;
defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once($CFG->dirroot . '/mod/assign/tests/privacy/provider_test.php');
use mod_assign\privacy\useridlist;
/**
* Unit tests for mod/assign/submission/comments/classes/privacy/
*
* @package assignsubmission_comments
* @copyright 2018 Adrian Greeve <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @covers \assignsubmission_comments\privacy\provider
*/
final class provider_test extends \mod_assign\privacy\provider_test {
final class provider_test extends \mod_assign\tests\provider_testcase {
/**
* Convenience function for creating feedback data.
@@ -14,28 +14,17 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Unit tests for assignsubmission_file.
*
* @package assignsubmission_file
* @copyright 2018 Adrian Greeve <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace assignsubmission_file\privacy;
defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once($CFG->dirroot . '/mod/assign/tests/privacy/provider_test.php');
/**
* Unit tests for mod/assign/submission/file/classes/privacy/
*
* @package assignsubmission_file
* @copyright 2018 Adrian Greeve <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @covers \assignsubmission_file\privacy\provider
*/
final class provider_test extends \mod_assign\privacy\provider_test {
final class provider_test extends \mod_assign\tests\provider_testcase {
/**
* Convenience function for creating feedback data.
*
@@ -14,27 +14,17 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Unit tests for assignsubmission_onlinetext.
*
* @package assignsubmission_onlinetext
* @copyright 2018 Adrian Greeve <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace assignsubmission_onlinetext\privacy;
defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once($CFG->dirroot . '/mod/assign/tests/privacy/provider_test.php');
/**
* Unit tests for mod/assign/submission/onlinetext/classes/privacy/
* Unit tests for mod/assign/submission/onlinetext/classes/privacy/provider.
*
* @copyright 2018 Adrian Greeve <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package assignsubmission_onlinetext
* @covers \assignsubmission_onlinetext\privacy\provider
*/
final class provider_test extends \mod_assign\privacy\provider_test {
final class provider_test extends \mod_assign\tests\provider_testcase {
/**
* Convenience function for creating feedback data.
+3 -9
View File
@@ -14,14 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Base class for unit tests for mod_assign.
*
* @package mod_assign
* @copyright 2018 Adrian Greeve <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_assign\privacy;
use core_privacy\local\request\writer;
@@ -32,10 +24,12 @@ use mod_assign\tests\provider_testcase;
/**
* Unit tests for mod/assign/classes/privacy/
*
* @package mod_assign
* @copyright 2018 Adrian Greeve <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @covers \mod_assign\privacy\provider
*/
class provider_test extends provider_testcase {
final class provider_test extends provider_testcase {
/**
* Test that getting the contexts for a user works.
*/