Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tests/integration/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
The integration test framework is designed to be used to run tests against
an installed and working XDMoD instance.

Run the tests with ./runtests.sh
46 changes: 46 additions & 0 deletions tests/integration/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

$dir = __DIR__;

// Autoloader for test classes.
spl_autoload_register(
function ($className) use ($dir) {
// Replace the IntegrationTests namespace prefix with the path to the
// integration tests lib directory.
$classPath = preg_replace(
'/IntegrationTests\\\\?/',
"$dir/lib/",
$className
);
// Replace namespace separators with directory separators.
$classPath = str_replace('\\', '/', $classPath) . '.php';
if (is_readable($classPath)) {
return require_once $classPath;
}
// Replace the IntegrationTests namespace prefix with the path to
// the main integration tests lib directory.
$classPath = preg_replace(
'/IntegrationTests\\\\?/',
"$dir/../../../xdmod/tests/integration/lib/",
$className
);
// Replace namespace separators with directory separators.
$classPath = str_replace('\\', '/', $classPath) . '.php';
if (is_readable($classPath)) {
return require_once $classPath;
}
// Autoload the AppKernels module classes
$classPath = (
"$dir/../../classes/"
. str_replace('\\', '/', $className)
. '.php'
);
if (is_readable($classPath)) {
return require_once $classPath;
}
return false;
}
);

// Autoloader for XDMoD classes.
require_once __DIR__ . '/../../../xdmod/configuration/linker.php';
Loading