MDL-61858 core_privacy: Add test to ensure component implementations
authorAndrew Nicols <andrew@nicols.co.uk>
Wed, 9 May 2018 11:57:45 +0000 (19:57 +0800)
committerMark Nelson <markn@moodle.com>
Fri, 11 May 2018 11:37:48 +0000 (19:37 +0800)
privacy/tests/provider_test.php

index 943d54e..496d996 100644 (file)
@@ -163,6 +163,18 @@ class provider_testcase extends advanced_testcase {
         }
     }
 
+    /**
+     * Test that all providers implement some form of compliant provider.
+     *
+     * @dataProvider get_component_list
+     * @param string $component frankenstyle component name, e.g. 'mod_assign'
+     * @param string $classname the fully qualified provider classname
+     */
+    public function test_all_providers_compliant($component, $classname) {
+        $manager = new manager();
+        $this->assertTrue($manager->component_is_compliant($component));
+    }
+
     /**
      * Data provider for the metadata\provider tests.
      *