Commit 3d5560b6 authored by alexpott's avatar alexpott

Issue #2252991 by neclimdul: PhpUnit tests for ModuleHandler.

parent 463ad143
......@@ -183,7 +183,7 @@ public function addProfile($name, $path) {
*/
protected function add($type, $name, $path) {
$pathname = "$path/$name.info.yml";
$filename = file_exists("$path/$name.$type") ? "$name.$type" : NULL;
$filename = file_exists(DRUPAL_ROOT . "/$path/$name.$type") ? "$name.$type" : NULL;
$this->moduleList[$name] = new Extension($type, $pathname, $filename);
$this->resetImplementations();
}
......
This diff is collapsed.
name: module handler test module
type: module
description: 'Test module enabled by default in module handler unit tests.'
package: Testing
version: VERSION
core: 8.x
<?php
/**
* Implements hook_hook_info().
*/
function module_handler_test_hook_info() {
return array(
'hook' => array('group' => 'hook'),
);
}
function module_handler_test_hook($arg) { return $arg; }
name: module handler test module
type: module
description: 'Test module used to test adding a module during runtime.'
package: Testing
version: VERSION
core: 8.x
hidden: true
name: module handler test all1
type: module
description: 'Test module used to test adding groups of modules with loadAll during runtime.'
package: Testing
version: VERSION
core: 8.x
hidden: true
<?php
// return an array to test nested merge in invoke all.
function module_handler_test_all1_hook($arg) { return array($arg); }
name: module handler test all2
type: module
description: 'Test module used to test adding groups of modules with loadAll during runtime.'
package: Testing
version: VERSION
core: 8.x
hidden: true
......@@ -90,8 +90,9 @@ function drupal_phpunit_register_extension_dirs(Composer\Autoload\ClassLoader $l
$dirs = array_reduce($dirs, 'array_merge', array());
drupal_phpunit_register_extension_dirs($loader, $dirs);
// Look into removing this later.
// Look into removing these later.
define('REQUEST_TIME', (int) $_SERVER['REQUEST_TIME']);
define('DRUPAL_ROOT', realpath(__DIR__ . '/../../'));
// Set sane locale settings, to ensure consistent string, dates, times and
// numbers handling.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment