659a6dd
diff -up ./phpunit.rpm ./phpunit
e70cad3
--- ./phpunit.rpm	2019-01-15 09:19:08.000000000 +0100
e70cad3
+++ ./phpunit	2019-01-15 11:49:08.859885786 +0100
23f99f0
@@ -27,25 +27,12 @@ if (!ini_get('date.timezone')) {
659a6dd
     ini_set('date.timezone', 'UTC');
659a6dd
 }
659a6dd
 
659a6dd
-foreach (array(__DIR__ . '/../../autoload.php', __DIR__ . '/../vendor/autoload.php', __DIR__ . '/vendor/autoload.php') as $file) {
659a6dd
-    if (file_exists($file)) {
659a6dd
-        define('PHPUNIT_COMPOSER_INSTALL', $file);
659a6dd
-
659a6dd
-        break;
659a6dd
-    }
659a6dd
-}
659a6dd
-
659a6dd
-unset($file);
659a6dd
-
659a6dd
-if (!defined('PHPUNIT_COMPOSER_INSTALL')) {
659a6dd
-    fwrite(
659a6dd
-        STDERR,
659a6dd
-        'You need to set up the project dependencies using Composer:' . PHP_EOL . PHP_EOL .
659a6dd
-        '    composer install' . PHP_EOL . PHP_EOL .
659a6dd
-        'You can learn all about Composer on https://getcomposer.org/.' . PHP_EOL
659a6dd
-    );
659a6dd
-
659a6dd
-    die(1);
659a6dd
+// Libraries PATH
659a6dd
+if (file_exists('./vendor/phpunit/phpunit/phpunit') && file_exists('./vendor/autoload.php')) {
659a6dd
+    echo "\n==== Redirecting to composer installed version in vendor/phpunit ====\n\n";
659a6dd
+    define ('PHPUNIT_COMPOSER_INSTALL', realpath('./vendor/autoload.php'));
659a6dd
+} else {
659a6dd
+    define ('PHPUNIT_COMPOSER_INSTALL', '/usr/share/php/PHPUnit7/autoload.php');
659a6dd
 }
659a6dd
 
23f99f0
 $options = getopt('', array('prepend:'));
23f99f0
@@ -58,4 +45,8 @@ unset($options);
23f99f0
 
659a6dd
 require PHPUNIT_COMPOSER_INSTALL;
659a6dd
 
659a6dd
-PHPUnit\TextUI\Command::main();
659a6dd
+if (class_exists('PHPUnit_TextUI_Command')) {
659a6dd
+    PHPUnit_TextUI_Command::main(); // PHPUnit v5 or older
659a6dd
+} else {
659a6dd
+    PHPUnit\TextUI\Command::main(); // PHPUnit v6 or newer
659a6dd
+}
23f99f0
diff -up ./src/Util/Configuration.php.rpm ./src/Util/Configuration.php
e70cad3
--- ./src/Util/Configuration.php.rpm	2019-01-15 09:19:08.000000000 +0100
e70cad3
+++ ./src/Util/Configuration.php	2019-01-15 11:49:08.859885786 +0100
23f99f0
@@ -1025,7 +1025,7 @@ final class Configuration
23f99f0
     private function validateConfigurationAgainstSchema(): void
23f99f0
     {
23f99f0
         $original    = \libxml_use_internal_errors(true);
23f99f0
-        $xsdFilename = __DIR__ . '/../../phpunit.xsd';
23f99f0
+        $xsdFilename = __DIR__ . '/../phpunit.xsd';
23f99f0
 
23f99f0
         if (\defined('__PHPUNIT_PHAR_ROOT__')) {
23f99f0
             $xsdFilename =  __PHPUNIT_PHAR_ROOT__ . '/phpunit.xsd';
659a6dd
diff -up ./tests/bootstrap.php.rpm ./tests/bootstrap.php
e70cad3
--- ./tests/bootstrap.php.rpm	2019-01-15 11:49:08.859885786 +0100
e70cad3
+++ ./tests/bootstrap.php	2019-01-15 11:50:12.567276300 +0100
e70cad3
@@ -14,4 +14,9 @@ if (!\defined('TEST_FILES_PATH')) {
4646cf5
 \ini_set('precision', 14);
4646cf5
 \ini_set('serialize_precision', 14);
659a6dd
 
659a6dd
-require_once __DIR__ . '/../vendor/autoload.php';
659a6dd
+require_once '@PATH@/autoload.php';
4646cf5
+require_once __DIR__ . '/_files/CoverageNamespacedFunctionTest.php';
659a6dd
+require_once __DIR__ . '/_files/CoveredFunction.php';
4646cf5
+require_once __DIR__ . '/_files/NamespaceCoveredFunction.php';
659a6dd
+require_once '@PATH@/Framework/Assert/Functions.php';
659a6dd
+require_once __DIR__ . '/autoload.php';