blob: 5235bfa7b9b5314319c3ea37e9bf88a5b389aaa4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
From 9d351061fdc28a58e5a75effd4879c4e556585d2 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Tue, 13 Oct 2020 08:35:27 +0200
Subject: [PATCH] fix for PHPUnit 5
---
src/Constraint/XmlMatchesXsd.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/Constraint/XmlMatchesXsd.php b/src/Constraint/XmlMatchesXsd.php
index f981ab5..e9e6490 100644
--- a/src/Constraint/XmlMatchesXsd.php
+++ b/src/Constraint/XmlMatchesXsd.php
@@ -12,7 +12,8 @@
namespace PhpCsFixer\PhpunitConstraintXmlMatchesXsd\Constraint;
-if (version_compare(\PHPUnit\Runner\Version::id(), '7.0.0') < 0) {
+if (!class_exists('\PHPUnit\Runner\Version')
+ || version_compare(\PHPUnit\Runner\Version::id(), '7.0.0') < 0) {
class_alias(XmlMatchesXsdForV5::class, XmlMatchesXsd::class);
} elseif (version_compare(\PHPUnit\Runner\Version::id(), '8.0.0') < 0) {
class_alias(XmlMatchesXsdForV7::class, XmlMatchesXsd::class);
|