siwinski pushed to php-guzzlehttp-ringphp (master). "Fix tests' autoload"

notifications at fedoraproject.org notifications at fedoraproject.org
Sat Jun 13 00:39:32 UTC 2015


From 38f7de3337f245487bbc62e125a388507bf21d3c Mon Sep 17 00:00:00 2001
From: Shawn Iwinski <shawn.iwinski at gmail.com>
Date: Fri, 12 Jun 2015 20:39:15 -0400
Subject: Fix tests' autoload


diff --git a/php-guzzlehttp-ringphp.spec b/php-guzzlehttp-ringphp.spec
index fd6bca5..b9a7db3 100644
--- a/php-guzzlehttp-ringphp.spec
+++ b/php-guzzlehttp-ringphp.spec
@@ -36,7 +36,7 @@
 
 Name:          php-%{composer_vendor}-%{composer_project}
 Version:       %{github_version}
-Release:       2%{?github_release}%{?dist}
+Release:       3%{?github_release}%{?dist}
 Summary:       Simple handler system used to power clients and servers in PHP
 
 Group:         Development/Libraries
@@ -164,12 +164,14 @@ AUTOLOAD
 require_once 'GuzzleHttp/Ring/autoload.php';
 
 $fedoraClassLoader->addPrefix('GuzzleHttp\\Tests\\Ring', __DIR__);
+$fedoraClassLoader->setUseIncludePath(true);
 
 return $fedoraClassLoader;
 AUTOLOAD
 ) | tee tests/autoload.php
 
 : Create custom tests PHPUnit config
+rm -f phpunit.xml.dist
 (cat <<'PHPUNIT'
 <?xml version="1.0" encoding="UTF-8"?>
 <phpunit bootstrap="./bootstrap.php" colors="true">
@@ -180,10 +182,11 @@ AUTOLOAD
     </testsuites>
 </phpunit>
 PHPUNIT
-) | tee tests/phpunit.xml.dist
+) | tee phpunit.xml.dist
 
 : Modify tests bootstrap
-sed "s#.*require.*autoload.*#require __DIR__ . '/autoload.php';#" \
+sed -e "s#.*require.*autoload.*#require __DIR__ . '/autoload.php';#" \
+    -e "s#Client/Server.php#GuzzleHttp/Tests/Ring/Client/Server.php#" \
     -i tests/bootstrap.php
 
 
@@ -196,9 +199,12 @@ sed "s#.*require.*autoload.*#require __DIR__ . '/autoload.php';#" \
 mkdir -p %{buildroot}%{phpdir}/GuzzleHttp/Ring
 cp -rp src/* %{buildroot}%{phpdir}/GuzzleHttp/Ring/
 
-: Tests
-mkdir -p %{buildroot}%{testsdir}/%{name}
-cp -rp tests/* %{buildroot}%{testsdir}/%{name}/
+: Tests -- classes must be PSR-0
+mkdir -p %{buildroot}%{testsdir}/%{name}/GuzzleHttp/Tests/Ring
+cp -rp tests/* %{buildroot}%{testsdir}/%{name}/GuzzleHttp/Tests/Ring/
+mv %{buildroot}%{testsdir}/%{name}/GuzzleHttp/Tests/Ring/{autoload,bootstrap}.php \
+    %{buildroot}%{testsdir}/%{name}/
+cp -p phpunit.xml.dist %{buildroot}%{testsdir}/%{name}/
 
 
 %check
@@ -224,6 +230,9 @@ cp -rp tests/* %{buildroot}%{testsdir}/%{name}/
 
 
 %changelog
+* Fri Jun 12 2015 Shawn Iwinski <shawn.iwinski at gmail.com> - 1.1.0-3
+- Fix tests' autoload
+
 * Fri Jun 12 2015 Shawn Iwinski <shawn.iwinski at gmail.com> - 1.1.0-2
 - Use new $fedoraClassLoader concept in autoloader
 - Remove secondary "tests" directory from tests sub-package
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/php-guzzlehttp-ringphp.git/commit/?h=master&id=38f7de3337f245487bbc62e125a388507bf21d3c


More information about the scm-commits mailing list