Skip to content

Commit

Permalink
MDL-73348 phpunit: normalize all privacy provider tests
Browse files Browse the repository at this point in the history
As far as now all them have correct privacy level2 namespace:
- Move them to "privacy" subdir.
- Rename the files to "provider_test.php", this includes old
  privacy_test.php and privacy_provider_test.php files
- Rename the testcase to provider_test too (to match file name)

Also, change some relative paths and comments to point to new
locations.
  • Loading branch information
stronk7 committed Dec 17, 2021
1 parent 57e6fb7 commit e4a2d9c
Show file tree
Hide file tree
Showing 135 changed files with 174 additions and 173 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* @copyright 2018 Carlos Escobedo <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_test extends provider_testcase {
class provider_test extends provider_testcase {
/**
* Test to check export_user_preferences.
* returns user preferences data.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @coversDefaultClass \tool_admin_presets\privacy\provider
*/
class privacy_provider_test extends provider_testcase {
class provider_test extends provider_testcase {

/**
* Test for provider::get_metadata().
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* @copyright 2018 Zig Tan <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_test extends \core_privacy\tests\provider_testcase {
class provider_test extends \core_privacy\tests\provider_testcase {

/**
* Overriding setUp() function to always reset after tests.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* @copyright 2020 Paul Holden <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_provider_test extends provider_testcase {
class provider_test extends provider_testcase {

/**
* Test provider get_contexts_for_userid method
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
use core_privacy\local\request\writer;
use logstore_database\privacy\provider;

require_once(__DIR__ . '/fixtures/event.php');
require_once(__DIR__ . '/../fixtures/event.php');

/**
* Data provider testcase class.
Expand All @@ -49,7 +49,7 @@
* @author Frédéric Massart <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_test extends provider_testcase {
class provider_test extends provider_testcase {

public function setUp(): void {
global $CFG;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
use logstore_legacy\privacy\provider;
use logstore_legacy\event\unittest_executed;

require_once(__DIR__ . '/fixtures/event.php');
require_once(__DIR__ . '/../fixtures/event.php');

/**
* Data provider testcase class.
Expand All @@ -47,7 +47,7 @@
* @author Frédéric Massart <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_test extends provider_testcase {
class provider_test extends provider_testcase {

public function setUp(): void {
$this->resetAfterTest();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
use core_privacy\local\request\writer;
use logstore_standard\privacy\provider;

require_once(__DIR__ . '/fixtures/event.php');
require_once(__DIR__ . '/../fixtures/event.php');

/**
* Data provider testcase class.
Expand All @@ -46,7 +46,7 @@
* @author Frédéric Massart <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_test extends provider_testcase {
class provider_test extends provider_testcase {

public function setUp(): void {
$this->resetAfterTest();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
* @author Frédéric Massart <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_test extends provider_testcase {
class provider_test extends provider_testcase {

public function setUp(): void {
$this->resetAfterTest();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
* @author Frédéric Massart <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_test extends provider_testcase {
class provider_test extends provider_testcase {

public function setUp(): void {
global $CFG;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* @copyright 2018 Carlos Escobedo <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_provider_test extends \core_privacy\tests\provider_testcase {
class provider_test extends \core_privacy\tests\provider_testcase {

/**
* Basic setup for these tests.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* @copyright 2018 Adrian Greeve <adriangreeve.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_test extends provider_testcase {
class provider_test extends provider_testcase {

/**
* Set up method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* @copyright 2018 Sara Arjona <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_provider_test extends \core_privacy\tests\provider_testcase {
class provider_test extends \core_privacy\tests\provider_testcase {
/** @var stdClass The user object. */
protected $user;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* @copyright 2018 Andrew Nicols <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_provider_test extends \core_privacy\tests\provider_testcase {
class provider_test extends \core_privacy\tests\provider_testcase {

/**
* Helper method for creating a tour
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@

defined('MOODLE_INTERNAL') || die();

require_once(__DIR__ . '/fixtures/test_indicator_max.php');
require_once(__DIR__ . '/fixtures/test_indicator_min.php');
require_once(__DIR__ . '/fixtures/test_target_site_users.php');
require_once(__DIR__ . '/fixtures/test_target_course_users.php');
require_once(__DIR__ . '/../fixtures/test_indicator_max.php');
require_once(__DIR__ . '/../fixtures/test_indicator_min.php');
require_once(__DIR__ . '/../fixtures/test_target_site_users.php');
require_once(__DIR__ . '/../fixtures/test_target_course_users.php');

/**
* Unit tests for privacy.
Expand All @@ -43,7 +43,7 @@
* @copyright 2018 David Monllaó {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_test extends \core_privacy\tests\provider_testcase {
class provider_test extends \core_privacy\tests\provider_testcase {

public function setUp(): void {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* @copyright 2018 Carlos Escobedo <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_provider_test extends \core_privacy\tests\provider_testcase {
class provider_test extends \core_privacy\tests\provider_testcase {

/** @var \auth_plugin_manual Keeps the authentication plugin. */
protected $authplugin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* @copyright 2018 Victor Deniz <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_provider_test extends provider_testcase {
class provider_test extends provider_testcase {
/**
* Set up method.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* @copyright 2018 Carlos Escobedo <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_provider_test extends provider_testcase {
class provider_test extends provider_testcase {
/**
* Set up method.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* @author Frédéric Massart <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_test extends provider_testcase {
class provider_test extends provider_testcase {

public function setUp(): void {
$this->resetAfterTest();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* @copyright 2018 Mark Nelson <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_provider_test extends \core_privacy\tests\provider_testcase {
class provider_test extends \core_privacy\tests\provider_testcase {

/**
* Test getting the context for the user ID related to this plugin.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
* @author Frédéric Massart <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_test extends provider_testcase {
class provider_test extends provider_testcase {

public function setUp(): void {
$this->resetAfterTest();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
defined('MOODLE_INTERNAL') || die();

/**
* Class block_comments_privacy_provider_testcase.
* Privacy provider test for block_comments.
*
* @copyright 2018 Shamim Rezaie <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_provider_test extends \core_privacy\tests\provider_testcase {
class provider_test extends \core_privacy\tests\provider_testcase {

/** @var stdClass A student who is only enrolled in course1. */
protected $student1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* @copyright 2018 Andrew Nicols <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_provider_test extends \core_privacy\tests\provider_testcase {
class provider_test extends \core_privacy\tests\provider_testcase {
/**
* Get the list of standard format options for comparison.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* @copyright 2018 Peter Dias <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_test extends \core_privacy\tests\provider_testcase {
class provider_test extends \core_privacy\tests\provider_testcase {
/**
* Ensure that export_user_preferences returns no data if the user has not visited the myoverview block.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @since Moodle 3.6
*/
class privacy_test extends \core_privacy\tests\provider_testcase {
class provider_test extends \core_privacy\tests\provider_testcase {

/**
* Test getting the context for the user ID related to this plugin.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* @copyright 2018 Mihail Geshoski <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_test extends provider_testcase {
class provider_test extends provider_testcase {

/**
* Basic setup for these tests.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
* @author Frédéric Massart <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_test extends provider_testcase {
class provider_test extends provider_testcase {

public function setUp(): void {
$this->resetAfterTest();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* @copyright 2018 Peter Dias <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_test extends \core_privacy\tests\provider_testcase {
class provider_test extends \core_privacy\tests\provider_testcase {

/**
* Ensure that export_user_preferences returns no data if the user has not visited the myoverview block.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
* @author Frédéric Massart <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_test extends provider_testcase {
class provider_test extends provider_testcase {

public function setUp(): void {
$this->resetAfterTest();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
* @copyright 2018 Zig Tan <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_test extends provider_testcase {
class provider_test extends provider_testcase {

/**
* Overriding setUp() function to always reset after tests.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* @copyright 2018 Sara Arjona <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_test extends provider_testcase {
class provider_test extends provider_testcase {

/**
* Basic setup for these tests.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* @copyright 2018 Adrian Greeve <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_test extends provider_testcase {
class provider_test extends provider_testcase {

protected function setUp(): void {
$this->resetAfterTest();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
* @author Frédéric Massart <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_test extends provider_testcase {
class provider_test extends provider_testcase {

public function setUp(): void {
global $PAGE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* @copyright 2018 Adrian Greeve <adriangreeve.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_test extends \core_privacy\tests\provider_testcase {
class provider_test extends \core_privacy\tests\provider_testcase {

use \completion_creation;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
* @copyright 2020 Carlos Escobedo <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_test extends provider_testcase {
class provider_test extends provider_testcase {

/**
* Setup to ensure that fixtures are loaded.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

namespace core_courseformat\privacy;

use context_course;
use core_privacy\local\request\writer;

/**
* Privacy tests for core_courseformat.
*
Expand All @@ -22,13 +27,7 @@
* @copyright 2021 Ferran Recio <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace core_courseformat\privacy;

use context_course;
use core_privacy\local\request\writer;

class privacy_test extends \core_privacy\tests\provider_testcase {
class provider_test extends \core_privacy\tests\provider_testcase {

/**
* Test for provider::test_export_user_preferences().
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* @copyright 2018 Adrian Greeve <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_test extends \core_privacy\tests\provider_testcase {
class provider_test extends \core_privacy\tests\provider_testcase {

use \completion_creation;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* @copyright 2019 Marina Glancy
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_test extends provider_testcase {
class provider_test extends provider_testcase {

/**
* Generate data.
Expand Down
Loading

0 comments on commit e4a2d9c

Please sign in to comment.