summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--php-phpspec-prophecy-autoload.php10
-rw-r--r--php-phpspec-prophecy.spec5
2 files changed, 12 insertions, 3 deletions
diff --git a/php-phpspec-prophecy-autoload.php b/php-phpspec-prophecy-autoload.php
index 12f47cb..da7df3b 100644
--- a/php-phpspec-prophecy-autoload.php
+++ b/php-phpspec-prophecy-autoload.php
@@ -9,6 +9,12 @@ require_once '/usr/share/php/Fedora/Autoloader/autoload.php';
// Dependencies
require_once 'Doctrine/Instantiator/autoload.php';
-require_once 'SebastianBergmann/Comparator/autoload.php';
-require_once 'SebastianBergmann/RecursionContext/autoload.php';
require_once 'phpDocumentor/Reflection/DocBlock/autoload.php';
+
+if (!class_exists('SebastianBergmann\\Comparator\\Comparator')) { // v2 from phpunit, v1 from phpspec
+ require_once (stream_resolve_include_path('SebastianBergmann/Comparator2/autoload.php') ?: 'SebastianBergmann/Comparator/autoload.php');
+}
+if (!class_exists('SebastianBergmann\\RecursionContext\\Context')) { // v3 from phpunit, v2 from phpspec (via exporter)
+ require_once (stream_resolve_include_path('SebastianBergmann/RecursionContext3/autoload.php') ?: 'SebastianBergmann/RecursionContext/autoload.php');
+}
+
diff --git a/php-phpspec-prophecy.spec b/php-phpspec-prophecy.spec
index 28434fa..e066429 100644
--- a/php-phpspec-prophecy.spec
+++ b/php-phpspec-prophecy.spec
@@ -20,7 +20,7 @@
Name: php-phpspec-prophecy
Version: 1.7.0
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Highly opinionated mocking framework for PHP
Group: Development/Libraries
@@ -134,6 +134,9 @@ rm -rf %{buildroot}
%changelog
+* Fri Mar 3 2017 Remi Collet <remi@remirepo.net> - 1.7.0-2
+- fix autoloader for dep. with multiple versions
+
* Fri Mar 3 2017 Remi Collet <remi@remirepo.net> - 1.7.0-1
- Update to 1.7.0