com php-src: Fix declare encoding tests: Zend/tests/declare_ 002.phpt Zend/tests/declare_004.phpt Zend /tests/self_class_const_outside_class.phpt

From: Date: Sat, 24 Jan 2015 20:51:45 +0000
Subject: com php-src: Fix declare encoding tests: Zend/tests/declare_ 002.phpt Zend/tests/declare_004.phpt Zend /tests/self_class_const_outside_class.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-84357@lists.php.net to get a copy of this message
Commit: 05166566db19fb02d0b31eaa64238bf58299d222 Author: Nikita Popov <nikic@php.net> Sat, 24 Jan 2015 21:50:04 +0100 Parents: c637ba118e4a42e5710b7beaf18ae79f4878ed5c Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=05166566db19fb02d0b31eaa64238bf58299d222 Log: Fix declare encoding tests Also add a test for bwoebi's last change. Changed paths: M Zend/tests/declare_002.phpt M Zend/tests/declare_004.phpt A Zend/tests/self_class_const_outside_class.phpt Diff: diff --git a/Zend/tests/declare_002.phpt b/Zend/tests/declare_002.phpt index 1984455..42f8127 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 a2ba51a..d823c9a 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 0000000...0ef03c2 --- /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

« previous php.cvs (#84357) next »