summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-04-21 06:31:26 +0200
committerRemi Collet <fedora@famillecollet.com>2016-04-21 06:31:26 +0200
commit7822cc249aa17725f5abaf7aade8b326b566945a (patch)
tree6efc00f4bc79703a805776a16d140797b567954b
parent8a21e63e53a3f1737918eca941a6bd8eb75886b9 (diff)
php-nikic-php-parser: patch
-rw-r--r--php-nikic-php-parser-upstream.patch64
1 files changed, 64 insertions, 0 deletions
diff --git a/php-nikic-php-parser-upstream.patch b/php-nikic-php-parser-upstream.patch
new file mode 100644
index 0000000..8206723
--- /dev/null
+++ b/php-nikic-php-parser-upstream.patch
@@ -0,0 +1,64 @@
+From e45e31c218dc224f20155b932e309438fe2eeeb2 Mon Sep 17 00:00:00 2001
+From: Nikita Popov <nikita.ppv@googlemail.com>
+Date: Wed, 20 Apr 2016 15:03:18 +0200
+Subject: [PATCH] Fix new.test and code test runner
+
+Using only the basename leads to collisions...
+---
+ test/PhpParser/CodeTestAbstract.php | 5 +++--
+ test/code/parser/expr/new.test | 6 ++++++
+ 2 files changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/test/PhpParser/CodeTestAbstract.php b/test/PhpParser/CodeTestAbstract.php
+index 4395ad3..369ee41 100644
+--- a/test/PhpParser/CodeTestAbstract.php
++++ b/test/PhpParser/CodeTestAbstract.php
+@@ -5,13 +5,14 @@
+ abstract class CodeTestAbstract extends \PHPUnit_Framework_TestCase
+ {
+ protected function getTests($directory, $fileExtension) {
++ $directory = realpath($directory);
+ $it = new \RecursiveDirectoryIterator($directory);
+ $it = new \RecursiveIteratorIterator($it, \RecursiveIteratorIterator::LEAVES_ONLY);
+ $it = new \RegexIterator($it, '(\.' . preg_quote($fileExtension) . '$)');
+
+ $tests = array();
+ foreach ($it as $file) {
+- $fileName = realpath($file->getPathname());
++ $fileName = $file->getPathname();
+ $fileContents = file_get_contents($fileName);
+ $fileContents = canonicalize($fileContents);
+
+@@ -29,7 +30,7 @@ function($matches) {
+
+ // first part is the name
+ $name = array_shift($parts) . ' (' . $fileName . ')';
+- $shortName = basename($fileName, '.test');
++ $shortName = ltrim(str_replace($directory, '', $fileName), '/\\');
+
+ // multiple sections possible with always two forming a pair
+ $chunks = array_chunk($parts, 2);
+diff --git a/test/code/parser/expr/new.test b/test/code/parser/expr/new.test
+index b7ce7a9..a132bbb 100644
+--- a/test/code/parser/expr/new.test
++++ b/test/code/parser/expr/new.test
+@@ -50,6 +50,9 @@ array(
+ )
+ args: array(
+ )
++ comments: array(
++ 0: // class name variations
++ )
+ )
+ 3: Expr_New(
+ class: Expr_ArrayDimFetch(
+@@ -84,6 +87,9 @@ array(
+ )
+ args: array(
+ )
++ comments: array(
++ 0: // DNCR object access
++ )
+ )
+ 6: Expr_New(
+ class: Expr_PropertyFetch(