summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-05-30 17:59:58 +0200
committerRemi Collet <fedora@famillecollet.com>2016-05-30 17:59:58 +0200
commit0bc0208298ba87c07dff60acec8dd8efa612484c (patch)
tree5174580c28218336670e0f3ba576db117a532a6f
parent55855deb1f8cb1999e54d07966dd98fb816bb060 (diff)
php-nette-application: add upstream patch for tests
-rw-r--r--php-nette-application-upstream.patch173
-rw-r--r--php-nette-application.spec9
2 files changed, 181 insertions, 1 deletions
diff --git a/php-nette-application-upstream.patch b/php-nette-application-upstream.patch
new file mode 100644
index 0000000..a46d10b
--- /dev/null
+++ b/php-nette-application-upstream.patch
@@ -0,0 +1,173 @@
+From e071611a93ce117c0983ad824c817c0ba0d242bb Mon Sep 17 00:00:00 2001
+From: David Grudl <david@grudl.com>
+Date: Tue, 17 May 2016 18:00:56 +0200
+Subject: [PATCH] tests: compatibility with DI & Latte 2.4
+
+---
+ tests/Bridges.DI/ApplicationExtension.basic.phpt | 2 +-
+ tests/Bridges.DI/ApplicationExtension.invalidLink.phpt | 8 ++++----
+ tests/Bridges.DI/ApplicationExtension.scan.phpt | 6 +++---
+ tests/Bridges.DI/LatteExtension.basic.phpt | 2 +-
+ tests/Bridges.DI/RoutingExtension.basic.phpt | 2 +-
+ tests/Bridges.DI/RoutingExtension.cache.phpt | 6 +++---
+ tests/Bridges.Latte/UIMacros.link.2.phpt | 4 ++--
+ 7 files changed, 15 insertions(+), 15 deletions(-)
+
+diff --git a/tests/Bridges.DI/ApplicationExtension.basic.phpt b/tests/Bridges.DI/ApplicationExtension.basic.phpt
+index ee98341..d3b74cd 100644
+--- a/tests/Bridges.DI/ApplicationExtension.basic.phpt
++++ b/tests/Bridges.DI/ApplicationExtension.basic.phpt
+@@ -21,7 +21,7 @@ test(function () {
+ $builder->addDefinition('myHttpRequest')->setFactory('Nette\Http\Request', array(new DI\Statement('Nette\Http\UrlScript')));
+ $builder->addDefinition('myHttpResponse')->setClass('Nette\Http\Response');
+
+- $code = $compiler->compile(array(), 'Container1');
++ $code = @$compiler->compile(array(), 'Container1'); // @ compatibility with 2.4
+ eval($code);
+
+ $container = new Container1;
+diff --git a/tests/Bridges.DI/ApplicationExtension.invalidLink.phpt b/tests/Bridges.DI/ApplicationExtension.invalidLink.phpt
+index 95d2fa4..fb11893 100644
+--- a/tests/Bridges.DI/ApplicationExtension.invalidLink.phpt
++++ b/tests/Bridges.DI/ApplicationExtension.invalidLink.phpt
+@@ -36,7 +36,7 @@ test(function () {
+ presenter: Presenter1
+ ');
+ $compiler->addExtension('application', new ApplicationExtension(TRUE));
+- $code = $compiler->compile(NULL, 'Container4');
++ $code = @$compiler->compile(NULL, 'Container4'); // @ compatibility with 2.4
+ eval($code);
+
+ $container = new Container4;
+@@ -57,7 +57,7 @@ test(function () {
+ presenter: Presenter1
+ ');
+ $compiler->addExtension('application', new ApplicationExtension(TRUE));
+- $code = $compiler->compile(NULL, 'Container5');
++ $code = @$compiler->compile(NULL, 'Container5'); // @ compatibility with 2.4
+ eval($code);
+
+ $container = new Container5;
+@@ -78,7 +78,7 @@ test(function () {
+ presenter: Presenter1
+ ');
+ $compiler->addExtension('application', new ApplicationExtension(FALSE));
+- $code = $compiler->compile(NULL, 'Container6');
++ $code = @$compiler->compile(NULL, 'Container6'); // @ compatibility with 2.4
+ eval($code);
+
+ $container = new Container6;
+@@ -99,7 +99,7 @@ test(function () {
+ presenter: Presenter1
+ ');
+ $compiler->addExtension('application', new ApplicationExtension(FALSE));
+- $code = $compiler->compile(NULL, 'Container7');
++ $code = @$compiler->compile(NULL, 'Container7'); // @ compatibility with 2.4
+ eval($code);
+
+ $container = new Container7;
+diff --git a/tests/Bridges.DI/ApplicationExtension.scan.phpt b/tests/Bridges.DI/ApplicationExtension.scan.phpt
+index 7535091..24e2e39 100644
+--- a/tests/Bridges.DI/ApplicationExtension.scan.phpt
++++ b/tests/Bridges.DI/ApplicationExtension.scan.phpt
+@@ -21,7 +21,7 @@ test(function () {
+ $builder->addDefinition('myRouter')->setClass('Nette\Application\Routers\SimpleRouter');
+ $builder->addDefinition('myHttpRequest')->setFactory('Nette\Http\Request', array(new DI\Statement('Nette\Http\UrlScript')));
+ $builder->addDefinition('myHttpResponse')->setClass('Nette\Http\Response');
+- $code = $compiler->compile(array(
++ $code = @$compiler->compile(array( // @ compatibility with 2.4
+ 'application' => array('debugger' => FALSE),
+ ), 'Container1');
+ eval($code);
+@@ -42,7 +42,7 @@ test(function () {
+ $builder->addDefinition('myRouter')->setClass('Nette\Application\Routers\SimpleRouter');
+ $builder->addDefinition('myHttpRequest')->setFactory('Nette\Http\Request', array(new DI\Statement('Nette\Http\UrlScript')));
+ $builder->addDefinition('myHttpResponse')->setClass('Nette\Http\Response');
+- $code = $compiler->compile(array(
++ $code = @$compiler->compile(array( // @ compatibility with 2.4
+ 'application' => array(
+ 'scanDirs' => array(__DIR__ . '/files'),
+ 'debugger' => FALSE,
+@@ -77,7 +77,7 @@ test(function () {
+ setup:
+ - setView(test)
+ ', 'neon'));
+- $code = $compiler->compile($config, 'Container3');
++ $code = @$compiler->compile($config, 'Container3'); // @ compatibility with 2.4
+ eval($code);
+
+ $container = new Container3;
+diff --git a/tests/Bridges.DI/LatteExtension.basic.phpt b/tests/Bridges.DI/LatteExtension.basic.phpt
+index 5f0d215..fc473f3 100644
+--- a/tests/Bridges.DI/LatteExtension.basic.phpt
++++ b/tests/Bridges.DI/LatteExtension.basic.phpt
+@@ -74,7 +74,7 @@ latte:
+ $compiler = new DI\Compiler;
+ $compiler->addExtension('latte', new Nette\Bridges\ApplicationDI\LatteExtension(NULL, FALSE));
+ $compiler->addExtension('another', new AnotherExtension);
+-$code = $compiler->compile($config, 'Container');
++$code = @$compiler->compile($config, 'Container'); // @ compatibility with 2.4
+ eval($code);
+
+ $container = new Container;
+diff --git a/tests/Bridges.DI/RoutingExtension.basic.phpt b/tests/Bridges.DI/RoutingExtension.basic.phpt
+index b8d8f90..c05d116 100644
+--- a/tests/Bridges.DI/RoutingExtension.basic.phpt
++++ b/tests/Bridges.DI/RoutingExtension.basic.phpt
+@@ -23,7 +23,7 @@ test(function () {
+
+ $compiler = new DI\Compiler;
+ $compiler->addExtension('routing', new RoutingExtension(FALSE));
+- $code = $compiler->compile($config, 'Container1');
++ $code = @$compiler->compile($config, 'Container1'); // @ compatibility with 2.4
+ eval($code);
+
+ $container = new Container1;
+diff --git a/tests/Bridges.DI/RoutingExtension.cache.phpt b/tests/Bridges.DI/RoutingExtension.cache.phpt
+index 9f1aad7..fd0d96d 100644
+--- a/tests/Bridges.DI/RoutingExtension.cache.phpt
++++ b/tests/Bridges.DI/RoutingExtension.cache.phpt
+@@ -39,7 +39,7 @@ test(function () {
+
+ $compiler = new DI\Compiler;
+ $compiler->addExtension('routing', new RoutingExtension(FALSE));
+- $code = $compiler->compile($config, 'Container1');
++ $code = @$compiler->compile($config, 'Container1'); // @ compatibility with 2.4
+ eval($code);
+
+ $container = new Container1;
+@@ -60,7 +60,7 @@ test(function () {
+
+ $compiler = new DI\Compiler;
+ $compiler->addExtension('routing', new RoutingExtension(FALSE));
+- $code = $compiler->compile($config, 'Container2');
++ $code = @$compiler->compile($config, 'Container2'); // @ compatibility with 2.4
+ eval($code);
+
+ $container = new Container2;
+@@ -88,5 +88,5 @@ Assert::exception(function () {
+
+ $compiler = new DI\Compiler;
+ $compiler->addExtension('routing', new RoutingExtension(FALSE));
+- $compiler->compile($config, 'Container3');
++ @$compiler->compile($config, 'Container3'); // @ compatibility with 2.4
+ }, 'Nette\DI\ServiceCreationException', 'Unable to cache router due to error: %a%');
+diff --git a/tests/Bridges.Latte/UIMacros.link.2.phpt b/tests/Bridges.Latte/UIMacros.link.2.phpt
+index c1d88ea..a7d8421 100644
+--- a/tests/Bridges.Latte/UIMacros.link.2.phpt
++++ b/tests/Bridges.Latte/UIMacros.link.2.phpt
+@@ -87,7 +87,7 @@ link:['login']
+ <a href="link:['default!#hash',10,20]"></a>
+ EOD
+
+-, $latte->renderToString(<<<EOD
++, strtr($latte->renderToString(<<<EOD
+ {plink Homepage:}
+
+ {plink Homepage: }
+@@ -118,4 +118,4 @@ EOD
+
+ <a n:href="default!#hash 10, 20"></a>
+ EOD
+-, $params));
++, $params), ['&#039;' => "'"]));
diff --git a/php-nette-application.spec b/php-nette-application.spec
index 25d4361..4584b59 100644
--- a/php-nette-application.spec
+++ b/php-nette-application.spec
@@ -18,7 +18,7 @@
Name: php-%{gh_owner}-%{gh_project}
Version: 2.3.12
-%global specrel 2
+%global specrel 3
Release: %{?gh_date:0.%{specrel}.%{?prever}%{!?prever:%{gh_date}git%{gh_short}}}%{!?gh_date:%{specrel}}%{?dist}
Summary: Nette Application MVC Component
@@ -29,6 +29,8 @@ Source0: %{name}-%{version}-%{gh_short}.tgz
# pull a git snapshot to get test sutie
Source1: makesrc.sh
+Patch0: %{name}-upstream.patch
+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: php-composer(theseer/autoload)
@@ -103,6 +105,8 @@ To use this library, you just have to add, in your project:
%prep
%setup -q -n %{gh_project}-%{gh_commit}
+%patch0 -p1 -b .upstream
+
%build
: Generate a classmap autoloader
@@ -180,6 +184,9 @@ rm -rf %{buildroot}
%changelog
+* Mon May 30 2016 Remi Collet <remi@fedoraproject.org> - 2.3.12-3
+- add upstream patch for tests, fix FTBFS, thanks Koschei
+
* Thu Apr 14 2016 Remi Collet <remi@fedoraproject.org> - 2.3.12-2
- don't use include_once in autoloader