com php-langspec: Test fixes: tests/functions/anonymous_funct ions.phpt tests/functions/type_hints.phpt tests/varia bles/variable_names.phpt

[email protected] (Nikita Popov) Mon, 11 Jul 2016 16:51:01 +0000
Newsgroups php.standards.cvs
Message-ID <[email protected]>
Commit:    8f029a6d992ad0f04449493a0743525950824f4b
Author:    Nikita Popov <[email protected]>         Mon, 11 Jul 2016 18:49:30 +0200
Parents:   afd005b29c0a7adeeae1882bd69621f8f4dde543
Branches:  PHP-7.0 master

Link:       http://git.php.net/?p=php-langspec.git;a=commitdiff;h=8f029a6d992ad0f04449493a0743525950824f4b

Log:
Test fixes

* New __METHOD__ value for closures
* Missing pass-by-ref notice for object

Changed paths:
  M  tests/functions/anonymous_functions.phpt
  M  tests/functions/type_hints.phpt
  M  tests/variables/variable_names.phpt


Diff:
diff --git a/tests/functions/anonymous_functions.phpt b/tests/functions/anonymous_functions.phpt
index e0c5cfa..0a8a87c 100644
--- a/tests/functions/anonymous_functions.phpt
+++ b/tests/functions/anonymous_functions.phpt
@@ -122,7 +122,7 @@ class D
 
 		$callback = function ($p1, $p2) use (&$count, $values)
 		{
-			echo "Inside method >>" . __METHOD__ . "<<\n";	// called D::{closure}
+			echo "Inside method >>" . __METHOD__ . "<<\n";	// called {closure}
 			++$count;
 
 			$this->f();	// $this is available automatically; can't put it in use clause anyway
@@ -143,7 +143,7 @@ class D
 
 		$callback2 = function()
 		{
-			echo "Inside method >>" . __METHOD__ . "<<\n";	// ALSO called D::{closure}
+			echo "Inside method >>" . __METHOD__ . "<<\n";	// ALSO called {closure}
 		};
 
 		echo "--\n";
@@ -307,10 +307,10 @@ object(Closure%S)#%d (3) {
 --
 bool(true)
 --
-Inside method >>D::{closure}<<
+Inside method >>{closure}<<
 Inside method >>D::f<<
 $count = 1
-Inside method >>D::{closure}<<
+Inside method >>{closure}<<
 Inside method >>D::f<<
 $count = 2
 --
@@ -324,7 +324,7 @@ object(Closure%S)#%d (1) {
 --
 bool(true)
 --
-Inside method >>D::{closure}<<
+Inside method >>{closure}<<
 ----------------- using a use clause, #3 (static method) ----------------------
 --
 string(6) "object"
@@ -353,9 +353,9 @@ object(Closure%S)#%d (2) {
 --
 bool(true)
 --
-Inside method >>D::{closure}<<
+Inside method >>{closure}<<
 $count = 1
-Inside method >>D::{closure}<<
+Inside method >>{closure}<<
 $count = 2
 ----------------- Misc. Stuff ----------------------
 Hi
diff --git a/tests/functions/type_hints.phpt b/tests/functions/type_hints.phpt
index de5685e..9869962 100644
--- a/tests/functions/type_hints.phpt
+++ b/tests/functions/type_hints.phpt
@@ -101,7 +101,8 @@ function f6(C1 &$p1)
     var_dump($p1);
 }
 
-f6(new C1);
+$obj = new C1;
+f6($obj);
 --EXPECT--
 --------------- test type hint array ---------------------
 Inside f1
diff --git a/tests/variables/variable_names.phpt b/tests/variables/variable_names.phpt
index cebcaae..e50b92b 100644
--- a/tests/variables/variable_names.phpt
+++ b/tests/variables/variable_names.phpt
@@ -81,6 +81,6 @@ array(12) {
   ["argv"]=>
   array(1) {
     [0]=>
-    string(60) "/Users/smalyshev/php-spec/tests/variables/variable_names.php"
+    string(%d) "%s/tests/variables/variable_names.php"
   }
-}
\ No newline at end of file
+}