Skip to content

Commit

Permalink
Move test autoload setup to composer.json.
Browse files Browse the repository at this point in the history
  • Loading branch information
demiankatz committed Dec 9, 2024
1 parent f962bf2 commit 7d57479
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
"minSO": "module/VuFind/src/VuFind/Search"
}
},
"autoload-dev": {
"psr-4": {
"VuFindTest\\": ["module/VuFind/src/VuFindTest", "module/VuFind/tests/unit-tests/src/VuFindTest"]
}
},
"provide": {
"ext-memcached": "*",
"ext-oci8": "*",
Expand Down
14 changes: 0 additions & 14 deletions module/VuFind/tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,6 @@
// Composer autoloading
if (file_exists('vendor/autoload.php')) {
include 'vendor/autoload.php';
$loader = new Composer\Autoload\ClassLoader();
$loader->addClassMap(['minSO' => __DIR__ . '/../src/VuFind/Search/minSO.php']);
$loader->add('VuFindTest', __DIR__ . '/unit-tests/src');
$loader->add('VuFindTest', __DIR__ . '/../src');
// Dynamically discover all module src directories:
$modules = opendir(__DIR__ . '/../..');
while ($mod = readdir($modules)) {
$mod = trim($mod, '.'); // ignore . and ..
$dir = empty($mod) ? false : realpath(__DIR__ . "/../../{$mod}/src");
if (!empty($dir) && is_dir($dir . '/' . $mod)) {
$loader->add($mod, $dir);
}
}
$loader->register();
}

// Make sure local config dir exists:
Expand Down

0 comments on commit 7d57479

Please sign in to comment.