*
* @param $relativePath Relative path to test classes
* @return void
- * @throws InvalidArgumentException If a parameter is invalid
+ * @throws InvalidArgumentException If a parameter is invalid or path not found
*/
public static function registerTestsPath (string $relativePath) {
// Validate parameter
+ //* NOISY-DEBUG: */ printf('[%s:%d]: relativePath=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $relativePath);
if (empty($relativePath)) {
// Should not be empty
throw new InvalidArgumentException('Parameter "relativePath" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
}
+ // Get real path from it
+ $fullQualifiedPath = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('root_base_path') . $relativePath;
+
+ // Is it there?
+ //* NOISY-DEBUG: */ printf('[%s:%d]: fullQualifiedPath=%s' . PHP_EOL, __METHOD__, __LINE__, $fullQualifiedPath);
+ if (!is_dir($fullQualifiedPath)) {
+ // Not there
+ throw new InvalidArgumentException(sprintf('fullQualifiedPath=%s cannot be found', $fullQualifiedPath));
+ } elseif (!is_readable($fullQualifiedPath)) {
+ // Not readable
+ throw new InvalidArgumentException(sprintf('fullQualifiedPath=%s is not readable', $fullQualifiedPath));
+ }
+
// "Register" it
- //* NOISY-DEBUG: */ printf('[%s:%d]: relativePath=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $relativePath);
+ //* NOISY-DEBUG: */ printf('[%s:%d]: Adding relativePath=%s ...' . PHP_EOL, __METHOD__, __LINE__, $relativePath);
self::$testPaths[$relativePath] = $relativePath;
// Trace message