File: 0001-Use-homemade-autoload.php-for-tests.patch

package info (click to toggle)
php-enum 4.7.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 556 kB
  • sloc: php: 3,481; xml: 15; makefile: 8
file content (27 lines) | stat: -rw-r--r-- 941 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From: =?utf-8?q?David_Pr=C3=A9vot?= <david@tilapin.org>
Date: Tue, 24 Oct 2017 16:41:24 -1000
Subject: Use homemade autoload.php for tests

---
 tests/bootstrap.php | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index 6751f34..fc84afd 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -19,6 +19,14 @@ if (file_exists(__DIR__ . '/../vendor/autoload.php')) {
 } elseif (file_exists(__DIR__ . '/../../../autoload.php')) {
     require_once __DIR__ . '/../../../autoload.php';
 
+// Homemade autoload.php
+} elseif (file_exists(__DIR__ . '/../src/autoload.php')) {
+    require_once __DIR__ . '/../src/autoload.php';
+
+// installed as a package
+} elseif (file_exists('/usr/share/php/MabeEnum/autoload.php')) {
+    require_once '/usr/share/php/MabeEnum/autoload.php';
+
 // not installed
 } else {
     echo "php-enum not installed - please run 'composer install'" . PHP_EOL;