MDL-63921 privacy: Add unit test to prove userlist compliance
[moodle.git] / privacy / tests / provider_test.php
index f59b042..6261528 100644 (file)
@@ -201,6 +201,17 @@ class provider_testcase extends advanced_testcase {
         $this->assertInstanceOf(\core_privacy\local\request\contextlist::class, $contextlist);
     }
 
         $this->assertInstanceOf(\core_privacy\local\request\contextlist::class, $contextlist);
     }
 
+    /**
+     * Ensure that providers do not throw an error when processing a deleted user.
+     *
+     * @dataProvider    is_user_data_provider
+     * @param   string  $component
+     */
+    public function test_userdata_provider_implements_userlist($component) {
+        $classname = manager::get_provider_classname_for_component($component);
+        $this->assertTrue(is_subclass_of($classname, \core_privacy\local\request\core_userlist_provider::class));
+    }
+
     /**
      * Data provider for the metadata\provider tests.
      *
     /**
      * Data provider for the metadata\provider tests.
      *