Page MenuHomeDevCentral

D3771.id9766.diff
No OneTemporary

D3771.id9766.diff

diff --git a/workspaces/tests/bootstrap.php b/workspaces/src/includes/autoload_vendor.php
rename from workspaces/tests/bootstrap.php
rename to workspaces/src/includes/autoload_vendor.php
--- a/workspaces/tests/bootstrap.php
+++ b/workspaces/src/includes/autoload_vendor.php
@@ -1,7 +1,7 @@
<?php
/* -------------------------------------------------------------
- Bootstrap tests for Obsidian Workspaces
+ Obsidian Workspaces :: Autoloader from vendor/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Project: Nasqueron
Product: Obsidian Workspaces
@@ -14,19 +14,16 @@
const VENDOR_DIR_CANDIDATES = [
# Composer packages have been installed directly in workspaces/
- __DIR__ . "/../vendor",
-
- # Composer packages have been installed at monorepo root level
__DIR__ . "/../../vendor",
+ # Composer packages have been installed at monorepo root level
+ __DIR__ . "/../../../vendor",
];
function search_vendor_autoload () : string|null {
foreach (VENDOR_DIR_CANDIDATES as $dir) {
$autoload_path = $dir . "/autoload.php";
- echo "Candidate: $autoload_path\n";
-
if (file_exists($autoload_path)) {
return $autoload_path;
}
@@ -36,18 +33,18 @@
}
/* -------------------------------------------------------------
- Entry point for tests
+ Loader
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-function run() : void {
+function require_vendor_autoload() : void {
$vendor_autoload = search_vendor_autoload();
if ($vendor_autoload === null) {
- fwrite(STDERR, "Your first need to install dependencies. Run `composer install` before running tests.");
+ fwrite(STDERR, "You first need to install dependencies. Run `composer install`.");
die;
}
require($vendor_autoload);
}
-run();
+require_vendor_autoload();
diff --git a/workspaces/src/includes/core.php b/workspaces/src/includes/core.php
--- a/workspaces/src/includes/core.php
+++ b/workspaces/src/includes/core.php
@@ -16,14 +16,14 @@
*
*/
-require_once(__DIR__ . "/../../vendor/autoload.php");
-
////////////////////////////////////////////////////////////////////////////////
/// ///
/// Configures PHP and loads site-wide used libraries ///
/// ///
////////////////////////////////////////////////////////////////////////////////
+require_once("autoload_vendor.php");
+
//Errors management
include_once("error.php");
error_reporting(E_ALL);
diff --git a/workspaces/tests/phpunit.xml b/workspaces/tests/phpunit.xml
--- a/workspaces/tests/phpunit.xml
+++ b/workspaces/tests/phpunit.xml
@@ -1,7 +1,7 @@
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.4/phpunit.xsd"
- bootstrap="bootstrap.php"
+ bootstrap="../src/includes/autoload_vendor.php"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnPhpunitDeprecations="true"

File Metadata

Mime Type
text/plain
Expires
Mon, Oct 20, 09:27 (3 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3089110
Default Alt Text
D3771.id9766.diff (3 KB)

Event Timeline