]> granicus.if.org Git - php/commitdiff
Fix declare encoding tests
authorNikita Popov <nikic@php.net>
Sat, 24 Jan 2015 20:50:04 +0000 (21:50 +0100)
committerNikita Popov <nikic@php.net>
Sat, 24 Jan 2015 20:51:45 +0000 (21:51 +0100)
Also add a test for bwoebi's last change.

Zend/tests/declare_002.phpt
Zend/tests/declare_004.phpt
Zend/tests/self_class_const_outside_class.phpt [new file with mode: 0644]

index 19844556f1791b23b0903263fcbacda424c0a74f..42f8127bfe75a5898def16ff5327085885c9a009 100644 (file)
@@ -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
index a2ba51ac9c4da048d9487b679766cb7623920cec..d823c9a95021c516230255143801aec2a6bac561 100644 (file)
@@ -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 (file)
index 0000000..0ef03c2
--- /dev/null
@@ -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