summaryrefslogtreecommitdiff
path: root/Zend/tests
diff options
context:
space:
mode:
authorAndrea Faulds <ajf@ajf.me>2014-11-29 01:45:54 +0000
committerAndrea Faulds <ajf@ajf.me>2014-11-29 01:45:54 +0000
commit01554bf3e417f13baf7af874e449c265c0309279 (patch)
tree8aca46ab27a54cea34c14001af774942f0502e39 /Zend/tests
parent65c8edd525108f6598a8bb25fb3c5d6c80233322 (diff)
parent719083bd943e6c287c2dcb47918cf51f89a4ac08 (diff)
downloadphp-git-01554bf3e417f13baf7af874e449c265c0309279.tar.gz
Merge branch 'master' into zppFailOnOverflow
Diffstat (limited to 'Zend/tests')
-rw-r--r--Zend/tests/bug21478.phpt2
-rw-r--r--Zend/tests/bug33512.phpt2
-rw-r--r--Zend/tests/bug38779_1.phpt8
-rw-r--r--Zend/tests/bug40809.phpt2
-rw-r--r--Zend/tests/bug43200.phpt2
-rw-r--r--Zend/tests/bug43200_2.phpt2
-rw-r--r--Zend/tests/bug65419.phpt23
-rw-r--r--Zend/tests/bug68370.phpt18
-rw-r--r--Zend/tests/bug68446.phpt36
-rw-r--r--Zend/tests/class_properties_const.phpt25
-rw-r--r--Zend/tests/debug_backtrace_with_include_and_this.phpt8
-rw-r--r--Zend/tests/traits/bug54441.phpt2
-rw-r--r--Zend/tests/try_finally_010.phpt2
-rw-r--r--Zend/tests/varSyntax/tempDimFetchByRefError.phpt2
14 files changed, 122 insertions, 12 deletions
diff --git a/Zend/tests/bug21478.phpt b/Zend/tests/bug21478.phpt
index 8b38f24d6e..5955c4c1dc 100644
--- a/Zend/tests/bug21478.phpt
+++ b/Zend/tests/bug21478.phpt
@@ -27,7 +27,7 @@ stream_filter_append($fp, "myfilter");
fwrite($fp, "This is a test.\n");
print "Done.\n";
fclose($fp);
-// Uncommenting the following 'print' line causes the segfault to stop occuring
+// Uncommenting the following 'print' line causes the segfault to stop occurring
// print "2\n";
readfile(dirname(__FILE__)."/test.txt");
unlink(dirname(__FILE__)."/test.txt");
diff --git a/Zend/tests/bug33512.phpt b/Zend/tests/bug33512.phpt
index 9dd4e4e5f9..dcb8f0417e 100644
--- a/Zend/tests/bug33512.phpt
+++ b/Zend/tests/bug33512.phpt
@@ -53,7 +53,7 @@ class TheObj {
unset($SomeObj->Virtual1);
unset($SomeObj->{'Virtual'.(3)});
- //but, these variables are still available??? eventhough they're "unset"-ed
+ //but, these variables are still available??? even though they're "unset"-ed
print $SomeObj->Virtual1."\n";
print $SomeObj->{'Virtual'.(3)}."\n";
?>
diff --git a/Zend/tests/bug38779_1.phpt b/Zend/tests/bug38779_1.phpt
index eefa952e36..e2a5b208c6 100644
--- a/Zend/tests/bug38779_1.phpt
+++ b/Zend/tests/bug38779_1.phpt
@@ -39,6 +39,14 @@ include $filename;
echo "Done\n";
?>
+--CLEAN--
+<?php
+
+$filename = dirname(__FILE__)."/bug38779.txt";
+if (file_exists($filename)) {
+ @unlink(dirname(__FILE__)."/bug38779.txt");
+}
+?>
--EXPECTF--
Parse error: %s error%sin %s on line %d
string(6) "flush!"
diff --git a/Zend/tests/bug40809.phpt b/Zend/tests/bug40809.phpt
index 08fc89f553..9ff4e6f1b6 100644
--- a/Zend/tests/bug40809.phpt
+++ b/Zend/tests/bug40809.phpt
@@ -1,5 +1,5 @@
--TEST--
-Bug #40809 (Poor perfomance of ".=")
+Bug #40809 (Poor performance of ".=")
--FILE--
<?php
error_reporting(E_ALL|E_STRICT);
diff --git a/Zend/tests/bug43200.phpt b/Zend/tests/bug43200.phpt
index 24a8bbb1d7..7a995aab3e 100644
--- a/Zend/tests/bug43200.phpt
+++ b/Zend/tests/bug43200.phpt
@@ -1,5 +1,5 @@
--TEST--
-Bug #43200 (Interface implementation / inheritence not possible in abstract classes)
+Bug #43200 (Interface implementation / inheritance not possible in abstract classes)
--FILE--
<?php
diff --git a/Zend/tests/bug43200_2.phpt b/Zend/tests/bug43200_2.phpt
index 5efc5facff..3c8a98bddc 100644
--- a/Zend/tests/bug43200_2.phpt
+++ b/Zend/tests/bug43200_2.phpt
@@ -1,5 +1,5 @@
--TEST--
-Bug #43200.2 (Interface implementation / inheritence not possible in abstract classes)
+Bug #43200.2 (Interface implementation / inheritance not possible in abstract classes)
--FILE--
<?php
diff --git a/Zend/tests/bug65419.phpt b/Zend/tests/bug65419.phpt
new file mode 100644
index 0000000000..677b2750f2
--- /dev/null
+++ b/Zend/tests/bug65419.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Bug #65419 (Inside trait, self::class != __CLASS__)
+--FILE--
+<?php
+trait abc
+{
+ static function def()
+ {
+ echo self::class, "\n";
+ echo __CLASS__, "\n";
+ }
+}
+
+class ghi
+{
+ use abc;
+}
+
+ghi::def();
+?>
+--EXPECTF--
+ghi
+ghi \ No newline at end of file
diff --git a/Zend/tests/bug68370.phpt b/Zend/tests/bug68370.phpt
new file mode 100644
index 0000000000..25589bf455
--- /dev/null
+++ b/Zend/tests/bug68370.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Bug #68370 "unset($this)" can make the program crash
+--FILE--
+<?php
+class C {
+ public function test() {
+ unset($this);
+ return get_defined_vars();
+ }
+}
+$c = new C();
+$x = $c->test();
+print_r($x);
+unset($c, $x);
+--EXPECTF--
+Array
+(
+)
diff --git a/Zend/tests/bug68446.phpt b/Zend/tests/bug68446.phpt
new file mode 100644
index 0000000000..48e6f52f1c
--- /dev/null
+++ b/Zend/tests/bug68446.phpt
@@ -0,0 +1,36 @@
+--TEST--
+Bug #68446 (Array constant not accepted for array parameter default)
+--FILE--
+<?php
+const FOO = [1];
+const BAR = null;
+
+function a(array $a = FOO) {
+ var_dump($a);
+}
+
+function b(array $b = BAR) {
+ var_dump($b);
+}
+
+b(null);
+b([]);
+b();
+a([]);
+a();
+a(null);
+?>
+--EXPECTF--
+NULL
+array(0) {
+}
+NULL
+array(0) {
+}
+array(1) {
+ [0]=>
+ int(1)
+}
+
+Catchable fatal error: Argument 1 passed to a() must be of the type array, null given, called in %s on line %d and defined in %s on line %d
+
diff --git a/Zend/tests/class_properties_const.phpt b/Zend/tests/class_properties_const.phpt
new file mode 100644
index 0000000000..ac871b5c2b
--- /dev/null
+++ b/Zend/tests/class_properties_const.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Const class properties(runtime cache)
+--FILE--
+<?php
+class A {
+}
+
+$a = new A;
+
+echo "runtime\n";
+var_dump($a->{array()});
+var_dump($a->{1});
+var_dump($a->{function(){}});
+?>
+--EXPECTF--
+Notice: Array to string conversion in %sclass_properties_const.php on line %d
+runtime
+
+Notice: Undefined property: A::$Array in %sclass_properties_const.php on line %d
+NULL
+
+Notice: Undefined property: A::$1 in %sclass_properties_const.php on line %d
+NULL
+
+Catchable fatal error: Object of class Closure could not be converted to string in %sclass_properties_const.php on line %d
diff --git a/Zend/tests/debug_backtrace_with_include_and_this.phpt b/Zend/tests/debug_backtrace_with_include_and_this.phpt
index 171ad9f451..2827ab1b74 100644
--- a/Zend/tests/debug_backtrace_with_include_and_this.phpt
+++ b/Zend/tests/debug_backtrace_with_include_and_this.phpt
@@ -23,15 +23,15 @@ set_error_handler(function($code, $msg, $file, $line) {
});
try {
- (new CL())->load('class://non.existant.Class');
+ (new CL())->load('class://non.existent.Class');
} catch (CLException $e) {
echo $e."\n";
}
--EXPECTF--
-ERR#2: include(class://non.existant.Class): failed to open stream: "CLWrapper::stream_open" call failed @ include
-ERR#2: include(): Failed opening 'class://non.existant.Class' for inclusion (include_path='%s') @ include
+ERR#2: include(class://non.existent.Class): failed to open stream: "CLWrapper::stream_open" call failed @ include
+ERR#2: include(): Failed opening 'class://non.existent.Class' for inclusion (include_path='%s') @ include
-Fatal error: Uncaught exception 'Exception' with message 'Failed loading class://non.existant.Class' in %s
+Fatal error: Uncaught exception 'Exception' with message 'Failed loading class://non.existent.Class' in %s
Stack trace:
#0 %s(%d): CL->load('class://non.exi...')
#1 {main}
diff --git a/Zend/tests/traits/bug54441.phpt b/Zend/tests/traits/bug54441.phpt
index 84139f326b..3fe688b3b1 100644
--- a/Zend/tests/traits/bug54441.phpt
+++ b/Zend/tests/traits/bug54441.phpt
@@ -16,4 +16,4 @@ class Boo {
?>
--EXPECTF--
-Fatal error: The modifiers for the trait alias dontKnow() need to be changed in the same statment in which the alias is defined. Error in %s on line %d
+Fatal error: The modifiers for the trait alias dontKnow() need to be changed in the same statement in which the alias is defined. Error in %s on line %d
diff --git a/Zend/tests/try_finally_010.phpt b/Zend/tests/try_finally_010.phpt
index bbac8dd1e5..91eb7821ee 100644
--- a/Zend/tests/try_finally_010.phpt
+++ b/Zend/tests/try_finally_010.phpt
@@ -1,5 +1,5 @@
--TEST--
-Try finally (function call in the finaly block after exception)
+Try finally (function call in the finally block after exception)
--FILE--
<?php
function foo() {
diff --git a/Zend/tests/varSyntax/tempDimFetchByRefError.phpt b/Zend/tests/varSyntax/tempDimFetchByRefError.phpt
index dbcac75ea9..492627302f 100644
--- a/Zend/tests/varSyntax/tempDimFetchByRefError.phpt
+++ b/Zend/tests/varSyntax/tempDimFetchByRefError.phpt
@@ -1,5 +1,5 @@
--TEST--
-Passing a dimention fetch on a temporary by reference is not allowed
+Passing a dimension fetch on a temporary by reference is not allowed
--FILE--
<?php