summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Autoload.php.in33
-rw-r--r--php-phpunit-PHPUnit.spec30
-rw-r--r--phpunit-rpm.patch17
3 files changed, 43 insertions, 37 deletions
diff --git a/Autoload.php.in b/Autoload.php.in
index 5077fd4..5b6b946 100644
--- a/Autoload.php.in
+++ b/Autoload.php.in
@@ -14,6 +14,19 @@ require_once 'SebastianBergmann/Exporter/autoload.php';
require_once 'SebastianBergmann/Version/autoload.php';
require_once 'SebastianBergmann/Comparator/autoload.php';
+$vendorDir = '/usr/share/php';
+require_once $vendorDir . '/Symfony/Component/ClassLoader/UniversalClassLoader.php';
+use Symfony\Component\ClassLoader\UniversalClassLoader;
+
+$loader = new UniversalClassLoader();
+$loader->registerNamespaces(array(
+ 'Symfony\\Component\\Yaml' => $vendorDir,
+ 'Symfony\\Component\\ClassLoader' => $vendorDir,
+ 'LazyMap' => $vendorDir,
+ 'Instantiator' => $vendorDir,
+));
+$loader->register();
+
spl_autoload_register(
function ($class)
{
@@ -36,26 +49,6 @@ spl_autoload_register(
}
);
-// Symfony Yaml autoloader
-spl_autoload_register(
- function ($class) {
- if (0 === strpos(ltrim($class, '/'), 'Symfony\Component\Yaml')) {
- $file = sprintf(
- 'Symfony/Component/Yaml%s.php',
-
- substr(
- str_replace('\\', '/', $class),
- strlen('Symfony\Component\Yaml')
- )
- );
-
- if (stream_resolve_include_path($file)) {
- require_once $file;
- }
- }
- }
-);
-
/* Optional */
if (stream_resolve_include_path('PHPUnit/Extensions/Database/Autoload.php')) {
diff --git a/php-phpunit-PHPUnit.spec b/php-phpunit-PHPUnit.spec
index 5311d30..da33aa6 100644
--- a/php-phpunit-PHPUnit.spec
+++ b/php-phpunit-PHPUnit.spec
@@ -8,7 +8,7 @@
#
# Please, preserve the changelog entries
#
-%global gh_commit a71c4842c5fb836d8b200624583b859ec34e8a26
+%global gh_commit 58db726aa45fe26bca93f692cb3d77e9a46b7830
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner sebastianbergmann
%global gh_project phpunit
@@ -17,7 +17,7 @@
%global pear_channel pear.phpunit.de
Name: php-phpunit-PHPUnit
-Version: 4.1.4
+Version: 4.2.0
Release: 1%{?dist}
Summary: The PHP Unit Testing framework
@@ -40,13 +40,14 @@ BuildRequires: php-composer(phpunit/php-file-iterator) >= 1.3.1
BuildRequires: php-composer(phpunit/php-text-template) >= 1.2
BuildRequires: php-composer(phpunit/php-code-coverage) >= 2.0
BuildRequires: php-composer(phpunit/php-timer) >= 1.0.2
-BuildRequires: php-composer(phpunit/phpunit-mock-objects) >= 2.1
+BuildRequires: php-composer(phpunit/phpunit-mock-objects) >= 2.2
BuildRequires: php-composer(sebastian/comparator) >= 1.0
BuildRequires: php-composer(sebastian/diff) >= 1.1
BuildRequires: php-composer(sebastian/environment) >= 1.0
BuildRequires: php-composer(sebastian/exporter) >= 1.0
BuildRequires: php-composer(sebastian/version) >= 1.0
-BuildRequires: php-symfony-yaml >= 2.0.0
+BuildRequires: php-composer(symfony/yaml) >= 2.0
+BuildRequires: php-composer(symfony/class-loader) >= 2.0
BuildRequires: php-composer(phpunit/php-invoker) >= 1.1.0
# From composer.json
@@ -55,7 +56,7 @@ BuildRequires: php-composer(phpunit/php-invoker) >= 1.1.0
# "phpunit/php-text-template": "~1.2",
# "phpunit/php-code-coverage": "~2.0",
# "phpunit/php-timer": "~1.0.2",
-# "phpunit/phpunit-mock-objects": "~2.1",
+# "phpunit/phpunit-mock-objects": "~2.2",
# "symfony/yaml": "~2.0",
# "sebastian/comparator": "~1.0",
# "sebastian/diff": "~1.1",
@@ -76,7 +77,7 @@ Requires: php-composer(phpunit/php-code-coverage) >= 2.0
Requires: php-composer(phpunit/php-code-coverage) < 3
Requires: php-composer(phpunit/php-timer) >= 1.0.2
Requires: php-composer(phpunit/php-timer) < 1.1
-Requires: php-composer(phpunit/phpunit-mock-objects) >= 2.1
+Requires: php-composer(phpunit/phpunit-mock-objects) >= 2.2
Requires: php-composer(phpunit/phpunit-mock-objects) < 3
Requires: php-composer(sebastian/comparator) >= 1.0
Requires: php-composer(sebastian/comparator) < 2
@@ -88,8 +89,8 @@ Requires: php-composer(sebastian/exporter) >= 1.0
Requires: php-composer(sebastian/exporter) < 2
Requires: php-composer(sebastian/version) >= 1.0
Requires: php-composer(sebastian/version) < 2
-Requires: php-symfony-yaml >= 2.0.0
-Requires: php-symfony-yaml < 3
+Requires: php-composer(symfony/yaml) >= 2.0
+Requires: php-composer(symfony/yaml) < 3
Requires: php-dom
Requires: php-json
Requires: php-pcre
@@ -99,6 +100,13 @@ Requires: php-spl
# "phpunit/php-invoker": "~1.1"
Requires: php-composer(phpunit/php-invoker) >= 1.1
Requires: php-composer(phpunit/php-invoker) < 2
+# For our autoload patch
+Requires: php-composer(ocramius/instantiator) >= 1.0
+Requires: php-composer(ocramius/instantiator) < 2
+Requires: php-composer(ocramius/lazy-map) >= 1.0.0
+Requires: php-composer(ocramius/lazy-map) < 1.1
+Requires: php-composer(symfony/class-loader) >= 2.0
+Requires: php-composer(symfony/class-loader) < 3
# From phpcompatinfo report for version 4.0.18
Requires: php-date
Requires: php-libxml
@@ -189,6 +197,12 @@ fi
%changelog
+* Mon Aug 11 2014 Remi Collet <remi@fedoraproject.org> - 4.2.0-1
+- Update to 4.2.0
+- raise dependency on phpunit/phpunit-mock-objects >= 2.2
+- add dependency on ocramius/instantiator, ocramius/lazy-map
+ and symfony/class-loader
+
* Fri Jul 18 2014 Remi Collet <remi@fedoraproject.org> - 4.1.4-1
- Update to 4.1.4
- composer dependencies
diff --git a/phpunit-rpm.patch b/phpunit-rpm.patch
index 4279352..6c71e99 100644
--- a/phpunit-rpm.patch
+++ b/phpunit-rpm.patch
@@ -1,13 +1,13 @@
diff -up ./phpunit.rpm ./phpunit
---- ./phpunit.rpm 2014-05-02 09:13:40.000000000 +0200
-+++ ./phpunit 2014-05-06 15:37:05.557950817 +0200
+--- ./phpunit.rpm 2014-08-08 07:13:30.000000000 +0200
++++ ./phpunit 2014-08-11 11:12:26.435360930 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env php
+#!/usr/bin/php
<?php
/* PHPUnit
*
-@@ -35,21 +35,7 @@
+@@ -35,20 +35,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
@@ -19,11 +19,10 @@ diff -up ./phpunit.rpm ./phpunit
-}
-
-if (!defined('PHPUNIT_COMPOSER_INSTALL')) {
-- die(
-- 'You need to set up the project dependencies using the following commands:' . PHP_EOL .
+- echo 'You need to set up the project dependencies using the following commands:' . PHP_EOL .
- 'wget http://getcomposer.org/composer.phar' . PHP_EOL .
-- 'php composer.phar install' . PHP_EOL
-- );
+- 'php composer.phar install' . PHP_EOL;
+- die(1);
-}
-
+define ('PHPUNIT_COMPOSER_INSTALL', stream_resolve_include_path('PHPUnit/Autoload.php'));
@@ -31,8 +30,8 @@ diff -up ./phpunit.rpm ./phpunit
PHPUnit_TextUI_Command::main();
diff -up ./tests/bootstrap.php.rpm ./tests/bootstrap.php
---- ./tests/bootstrap.php.rpm 2014-06-07 11:26:13.357779078 +0200
-+++ ./tests/bootstrap.php 2014-06-07 11:25:17.659035072 +0200
+--- ./tests/bootstrap.php.rpm 2014-08-08 07:13:30.000000000 +0200
++++ ./tests/bootstrap.php 2014-08-11 11:08:14.835209501 +0200
@@ -1,5 +1,8 @@
<?php
-require __DIR__ . '/../vendor/autoload.php';