From d30532646e05be2d361348ba6287e51346e2069f Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 22 Jan 2018 10:20:50 +0100 Subject: duplicate php-deepend-Mockery --- Makefile | 4 ++ composer.json | 35 +++++++++++ php-mockery.spec | 186 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 225 insertions(+) create mode 100644 Makefile create mode 100644 composer.json create mode 100644 php-mockery.spec diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..91b0fd5 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +SRCDIR := $(shell pwd) +NAME := $(shell basename $(SRCDIR)) +include ../../common/Makefile + diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..d538f0d --- /dev/null +++ b/composer.json @@ -0,0 +1,35 @@ +{ + "name": "mockery/mockery", + "description": "Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succinct API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with PHPUnit and can operate alongside phpunit-mock-objects without the World ending.", + "keywords": ["library", "testing", "test", "stub", "mock", "mockery", "test double", "tdd", "bdd", "mock objects"], + "homepage": "http://github.com/padraic/mockery", + "license": "BSD-3-Clause", + "authors": [ + { + "name": "Pádraic Brady", + "email": "padraic.brady@gmail.com", + "homepage": "http://blog.astrumfutura.com" + }, + { + "name": "Dave Marshall", + "email": "dave.marshall@atstsolutions.co.uk", + "homepage": "http://davedevelopment.co.uk" + } + ], + "require": { + "php": ">=5.3.2", + "lib-pcre": ">=7.0", + "hamcrest/hamcrest-php": "~1.1" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "autoload": { + "psr-0": { "Mockery": "library/" } + }, + "extra": { + "branch-alias": { + "dev-master": "0.9.x-dev" + } + } +} diff --git a/php-mockery.spec b/php-mockery.spec new file mode 100644 index 0000000..818a9bd --- /dev/null +++ b/php-mockery.spec @@ -0,0 +1,186 @@ +# remirepo spec file for php-deepend-Mockery, from +# +# Fedora spec file for php-deepend-Mockery +# +# License: MIT +# http://opensource.org/licenses/MIT +# +# Please preserve changelog entries +# +%global gh_commit 6fdb61243844dc924071d3404bb23994ea0b6856 +%global gh_short %(c=%{gh_commit}; echo ${c:0:7}) +%global gh_owner padraic +%global gh_project mockery +%global with_tests 0%{!?_without_tests:1} + +Name: php-deepend-Mockery +Version: 0.9.9 +Release: 4%{?dist} +Summary: Mockery is a simple but flexible PHP mock object framework + +Group: Development/Libraries +License: BSD +URL: https://github.com/%{gh_owner}/%{gh_project} +Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz + +# Autoloader +Source1: %{gh_project}-autoload.php + +# Use our autoloader +Patch0: %{gh_project}-tests.patch +# Upstream patch for 7.2 +Patch1: https://github.com/mockery/mockery/commit/b2f20b33942c2c84bc3b3b169098b448b3e66737.patch +Patch2: https://patch-diff.githubusercontent.com/raw/mockery/mockery/pull/798.patch + +BuildArch: noarch +%if %{with_tests} +# From composer.json, "require-dev": { +# "phpunit/phpunit": "~4.0" +BuildRequires: php-composer(phpunit/phpunit) >= 4.0 +BuildRequires: php(language) >= 5.3.2 +BuildRequires: php-composer(hamcrest/hamcrest-php) >= 1.1 +# Autoloader +BuildRequires: php-composer(fedora/autoloader) +%endif + +# From composer.json, "require": { +# "php": ">=5.3.2", +# "lib-pcre": ">=7.0", +# "hamcrest/hamcrest-php": "~1.1" +Requires: php(language) >= 5.3.2 +Requires: php-composer(hamcrest/hamcrest-php) >= 1.1 +Requires: php-composer(hamcrest/hamcrest-php) < 2 +# From phpcompatinfo report for version 0.9.7 +Requires: php-pcre +Requires: php-spl +Requires: php-reflection +# Autoloader +Requires: php-composer(fedora/autoloader) + +Provides: php-composer(mockery/mockery) = %{version} +Provides: php-pear(pear.survivethedeepend.com/Mockery) = %{version} +Obsoletes: php-channel-deepend <= 1.3 + + +%description +Mockery is a simple but flexible PHP mock object framework for use in unit +testing. It is inspired by Ruby's flexmock and Java's Mockito, borrowing +elements from both of their APIs. + +To use this library, you just have to add, in your project: + require_once '%{_datadir}/php/Mockery/autoload.php'; + + +%prep +%setup -q -n %{gh_project}-%{gh_commit} + +cp %{SOURCE1} library/Mockery/autoload.php +%patch0 -p0 -b .rpm +%patch1 -p1 +%patch2 -p1 + + +%build +# Empty build section, most likely nothing required. + + +%install +mkdir -p %{buildroot}/%{_datadir}/php +cp -rp library/* %{buildroot}/%{_datadir}/php/ + + +%check +%if %{with_tests} +: Use installed tree and our autoloader +sed -e 's:@BUILD@:%{buildroot}/%{_datadir}/php:' -i tests/Bootstrap.php + +: Run upstream test suite +ret=0 +for cmd in php php56 php70 php71 php72; do + if which $cmd; then + $cmd %{_bindir}/phpunit --verbose || ret=1 + fi +done +exit $ret +%endif + + +%post +if [ -x %{_bindir}/pear ]; then + %{_bindir}/pear uninstall --nodeps --ignore-errors --register-only \ + pear.survivethedeepend.com/Mockery >/dev/null || : +fi + + +%files +%{!?_licensedir:%global license %%doc} +%license LICENSE +%doc README.md docs +%doc composer.json +%{_datadir}/php/Mockery/ +%{_datadir}/php/Mockery.php + + +%changelog +* Fri Oct 6 2017 Remi Collet - 0.9.9-4 +- add patches for PHP 7.2 + +* Tue Feb 28 2017 Remi Collet - 0.9.9-1 +- Update to 0.9.9 + +* Fri Feb 10 2017 Remi Collet - 0.9.8-1 +- Update to 0.9.8 + +* Fri Dec 23 2016 Remi Collet - 0.9.7-1 +- Update to 0.9.7 + +* Sat Nov 26 2016 Remi Collet - 0.9.6-1 +- Update to 0.9.6 +- switch to fedora/autoloader + +* Tue Jun 14 2016 Remi Collet - 0.9.5-1 +- Update to 0.9.5 + +* Fri Oct 16 2015 Remi Collet - 0.9.3-1 +- downgrade to 0.9.3 + +* Fri Oct 16 2015 Remi Collet - 0.9.4-1 +- Update to 0.9.4 +- add autoloader using symfony/class-loader +- add dependency on hamcrest/hamcrest-php +- run test suite +- use github archive from commit reference + +* Wed Jul 16 2014 Igor Gnatenko - 0.9.1-2 +- fixed requires (Remi) +- add script which will delete older pear package if installed (Remi) +- fix provides/obsoletes (Remi) + +* Tue Jul 15 2014 Igor Gnatenko - 0.9.1-1 +- update to 0.9.1 (RHBZ #1119451) + +* Tue Feb 11 2014 Remi Collet - 0.9.0-1 +- Update to 0.9.0 + +* Fri Apr 19 2013 Remi Collet - 0.8.0-1 +- Update to 0.8.0 (backport) + +* Thu Apr 18 2013 Christof Damian - 0.8.0-1 +- upstream 0.8.0 + +* Sun Mar 04 2012 Remi Collet - 0.7.2-1 +- upstream 0.7.2, rebuild for remi repository + +* Sun Mar 4 2012 Christof Damian - 0.7.2-1 +- upstream 0.7.2 + +* Tue Jul 27 2010 Remi Collet - 0.6.3-2 +- rebuild for remi repository + +* Tue Jul 27 2010 Christof Damian - 0.6.3-2 +- add license and readme file from github + +* Fri May 28 2010 Christof Damian - 0.6.0-1 +- initial packaging + + -- cgit