Merge branch 'MDL-62048_master' of git://github.com/markn86/moodle

This commit is contained in:
Jun Pataleta
2018-04-20 11:53:37 +08:00
+7
View File
@@ -110,6 +110,8 @@ class provider_testcase extends advanced_testcase {
* @param string $classname The name of the class for privacy
*/
public function test_metadata_provider($component, $classname) {
global $DB;
$collection = new collection($component);
$metadata = $classname::get_metadata($collection);
$this->assertInstanceOf(collection::class, $metadata);
@@ -121,6 +123,11 @@ class provider_testcase extends advanced_testcase {
// Note: This is not a string identifier.
$this->assertInternalType('string', $item->get_name());
if ($item instanceof database_table) {
// Check that the table is valid.
$this->assertTrue($DB->get_manager()->table_exists($item->get_name()));
}
if ($summary = $item->get_summary()) {
// Summary is optional, but when provided must be a valid string identifier.
$this->assertInternalType('string', $summary);