This commit is contained in:
Remi Collet 2015-11-05 15:42:17 +01:00
commit 367b963103
4 changed files with 9 additions and 80 deletions

2
.gitignore vendored
View file

@ -1,3 +1,4 @@
clog
/php-twig-1.16.0-8ce37115802e257a984a82d38254884085060024.tar.gz
/php-twig-1.16.2-42f758d9fe2146d1f0470604fc05ee43580873fc.tar.gz
/php-twig-1.16.3-6dc11a1e8ecfc30e2c68aaeb218148409d8e68af.tar.gz
@ -6,3 +7,4 @@
/php-twig-1.21.2-ddce1136beb8db29b9cd7dffa8ab518b978c9db3.tar.gz
/php-twig-1.22.2-79249fc8c9ff62e41e217e0c630e2e00bcadda6a.tar.gz
/php-twig-1.23.0-5868cd822fd6cf626d5f805439575f9c323cee2a.tar.gz
/php-twig-1.23.1-d9b6333ae8dd2c8e3fd256e127548def0bc614c6.tar.gz

View file

@ -1,72 +0,0 @@
From ee5e25eb4681b41a7408cd08d4d10ef3d216d3eb Mon Sep 17 00:00:00 2001
From: Remi Collet <fedora@famillecollet.com>
Date: Mon, 2 Nov 2015 15:13:46 +0100
Subject: [PATCH] fix BC, revert to pre 1.23 behavior, and make use of pattern
an option
---
lib/Twig/Test/NodeTestCase.php | 12 ++++++++----
test/Twig/Tests/Node/ModuleTest.php | 6 +++---
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/lib/Twig/Test/NodeTestCase.php b/lib/Twig/Test/NodeTestCase.php
index 6fe1b5f..e591c1d 100644
--- a/lib/Twig/Test/NodeTestCase.php
+++ b/lib/Twig/Test/NodeTestCase.php
@@ -15,17 +15,21 @@
/**
* @dataProvider getTests
*/
- public function testCompile($node, $source, $environment = null)
+ public function testCompile($node, $source, $environment = null, $isPattern = false)
{
- $this->assertNodeCompilation($source, $node, $environment);
+ $this->assertNodeCompilation($source, $node, $environment, $isPattern);
}
- public function assertNodeCompilation($source, Twig_Node $node, Twig_Environment $environment = null)
+ public function assertNodeCompilation($source, Twig_Node $node, Twig_Environment $environment = null, $isPattern = false)
{
$compiler = $this->getCompiler($environment);
$compiler->compile($node);
- $this->assertStringMatchesFormat($source, trim($compiler->getSource()));
+ if ($isPattern) {
+ $this->assertStringMatchesFormat($source, trim($compiler->getSource()));
+ } else {
+ $this->assertEquals($source, trim($compiler->getSource()));
+ }
}
protected function getCompiler(Twig_Environment $environment = null)
diff --git a/test/Twig/Tests/Node/ModuleTest.php b/test/Twig/Tests/Node/ModuleTest.php
index ca784e5..35b3e2e 100644
--- a/test/Twig/Tests/Node/ModuleTest.php
+++ b/test/Twig/Tests/Node/ModuleTest.php
@@ -75,7 +75,7 @@ public function getDebugInfo()
}
}
EOF
- , $twig);
+ , $twig, true);
$import = new Twig_Node_Import(new Twig_Node_Expression_Constant('foo.twig', 1), new Twig_Node_Expression_AssignName('macro', 1), 2);
@@ -128,7 +128,7 @@ public function getDebugInfo()
}
}
EOF
- , $twig);
+ , $twig, true);
$set = new Twig_Node_Set(false, new Twig_Node(array(new Twig_Node_Expression_AssignName('foo', 4))), new Twig_Node(array(new Twig_Node_Expression_Constant('foo', 4))), 4);
$body = new Twig_Node(array($set));
@@ -176,7 +176,7 @@ public function getDebugInfo()
}
}
EOF
- , $twig);
+ , $twig, true);
return $tests;
}

View file

@ -12,8 +12,8 @@
%global github_owner twigphp
%global github_name Twig
%global github_version 1.23.0
%global github_commit 5868cd822fd6cf626d5f805439575f9c323cee2a
%global github_version 1.23.1
%global github_commit d9b6333ae8dd2c8e3fd256e127548def0bc614c6
# Lib
%global composer_vendor twig
@ -47,9 +47,6 @@ License: BSD
URL: http://twig.sensiolabs.org
Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
# https://github.com/twigphp/Twig/pull/1905 (merged)
Patch0: %{name}-upstream.patch
BuildRequires: php-devel >= %{php_min_ver}
# Tests
%if %{with_tests}
@ -129,8 +126,6 @@ Obsoletes: php-channel-twig
%prep
%setup -qn %{github_name}-%{github_commit}
%patch0 -p1
: Ext -- NTS
mv ext/%{ext_name} ext/NTS
%if %{with_zts}
@ -251,6 +246,10 @@ sed 's/function testGetAttributeWithTemplateAsObject/function SKIP_testGetAttrib
%changelog
* Thu Nov 05 2015 Remi Collet <remi@fedoraproject.org> - 1.23.1-1
- Update to 1.23.0
- drop patch merged upstream
* Mon Nov 2 2015 Remi Collet <remi@fedoraproject.org> - 1.23.0-2
- fix BC break in NodeTestCase, add upstream patch from
https://github.com/twigphp/Twig/pull/1905

View file

@ -1 +1 @@
c0d5dbcef4afc5d717d5fd1907f4de08 php-twig-1.23.0-5868cd822fd6cf626d5f805439575f9c323cee2a.tar.gz
33acd115e315a82f0e89663a98e3cbfe php-twig-1.23.1-d9b6333ae8dd2c8e3fd256e127548def0bc614c6.tar.gz