summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2015-01-24 21:50:04 +0100
committerNikita Popov <nikic@php.net>2015-01-24 21:51:45 +0100
commit05166566db19fb02d0b31eaa64238bf58299d222 (patch)
tree1071881f5446c1754d0bac51ee8e4277035a33c1
parentc637ba118e4a42e5710b7beaf18ae79f4878ed5c (diff)
downloadphp-git-05166566db19fb02d0b31eaa64238bf58299d222.tar.gz
Fix declare encoding tests
Also add a test for bwoebi's last change.
-rw-r--r--Zend/tests/declare_002.phpt10
-rw-r--r--Zend/tests/declare_004.phpt13
-rw-r--r--Zend/tests/self_class_const_outside_class.phpt8
3 files changed, 14 insertions, 17 deletions
diff --git a/Zend/tests/declare_002.phpt b/Zend/tests/declare_002.phpt
index 19844556f1..42f8127bfe 100644
--- a/Zend/tests/declare_002.phpt
+++ b/Zend/tests/declare_002.phpt
@@ -2,19 +2,17 @@
Testing declare statement with several type values
--SKIPIF--
<?php
-if (!ini_get("zend.multibyte")) {
- die("skip Requires zend.multibyte=1");
-}
if (!extension_loaded("mbstring")) {
die("skip Requires ext/mbstring");
}
?>
+--INI--
+zend.multibyte=1
--FILE--
<?php
declare(encoding = 1);
declare(encoding = 1123131232131312321);
-declare(encoding = NULL);
declare(encoding = 'utf-8');
declare(encoding = M_PI);
@@ -26,6 +24,4 @@ Warning: Unsupported encoding [%d] in %sdeclare_002.php on line 3
Warning: Unsupported encoding [%f] in %sdeclare_002.php on line 4
-Warning: Unsupported encoding [] in %sdeclare_002.php on line 5
-
-Fatal error: Cannot use constants as encoding in %sdeclare_002.php on line 7
+Fatal error: Encoding must be a literal in %sdeclare_002.php on line 6
diff --git a/Zend/tests/declare_004.phpt b/Zend/tests/declare_004.phpt
index a2ba51ac9c..d823c9a950 100644
--- a/Zend/tests/declare_004.phpt
+++ b/Zend/tests/declare_004.phpt
@@ -1,17 +1,12 @@
--TEST--
Testing declare statement with several type values
---SKIPIF--
-<?php
-if (!ini_get("zend.multibyte")) {
- die("skip Requires zend.multibyte=1");
-}
-?>
+--INI--
+zend.multibyte=1
--FILE--
<?php
declare(encoding = 1);
declare(encoding = 1123131232131312321);
-declare(encoding = NULL);
declare(encoding = M_PI);
print 'DONE';
@@ -22,6 +17,4 @@ Warning: Unsupported encoding [%d] in %sdeclare_004.php on line 3
Warning: Unsupported encoding [%f] in %sdeclare_004.php on line 4
-Warning: Unsupported encoding [] in %sdeclare_004.php on line 5
-
-Fatal error: Cannot use constants as encoding in %sdeclare_004.php on line 6
+Fatal error: Encoding must be a literal in %sdeclare_004.php on line 5
diff --git a/Zend/tests/self_class_const_outside_class.phpt b/Zend/tests/self_class_const_outside_class.phpt
new file mode 100644
index 0000000000..0ef03c286f
--- /dev/null
+++ b/Zend/tests/self_class_const_outside_class.phpt
@@ -0,0 +1,8 @@
+--TEST--
+Accessing self::FOO outside a class
+--FILE--
+<?php
+var_dump(self::FOO);
+?>
+--EXPECTF--
+Fatal error: Cannot access self:: when no class scope is active in %s on line %d