/**
* Tests whether the correct module metadata is returned.
*/
public function testModuleMetaData() { // Generate the list of available modules.
$modules =
$this->container->
get('extension.list.module'
)->
getList();
// Check that the mtime field exists for the system module.
$this->
assertNotEmpty($modules['system'
]->info
['mtime'
], 'The system.info.yml file modification time field is present.'
);
// Use 0 if mtime isn't present, to avoid an array index notice.
$test_mtime = !
empty($modules['system'
]->info
['mtime'
]) ?
$modules['system'
]->info
['mtime'
] : 0;
// Ensure the mtime field contains a number that is greater than zero.
$this->
assertIsNumeric($test_mtime);
$this->
assertGreaterThan(0,
$test_mtime);
} /**
* Tests whether module-provided stream wrappers are registered properly.
*/
public function testModuleStreamWrappers() { // file_test.module provides (among others) a 'dummy' stream wrapper.
// Verify that it is not registered yet to prevent false positives.
$stream_wrappers = \Drupal::
service('stream_wrapper_manager'
)->
getWrappers();
$this->
assertFalse(isset($stream_wrappers['dummy'
]));