com php-src: Skip the tests if multibyte isn't loaded to prevent them from being fragile based on encoding availability: Zend/tests/typehi
nts/scalar_strict_declaration_placement_006.php t Zend/tests/typehints/scalar_strict_declaration_placem ent_007.phpt

From: Date: Wed, 18 Feb 2015 17:00:18 +0000
Subject: com php-src: Skip the tests if multibyte isn't loaded to prevent them from being fragile based on encoding availability: Zend/tests/typehi
nts/scalar_strict_declaration_placement_006.php t Zend/tests/typehints/scalar_strict_declaration_placem ent_007.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-85714@lists.php.net to get a copy of this message
Commit: 37604b45ba256541219a1038b033aed31432e5d7 Author: Anthony Ferrara <ircmaxell@gmail.com> Wed, 18 Feb 2015 12:00:18 -0500 Parents: ac2ece885f7571189c278232f25f3117445c5c03 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=37604b45ba256541219a1038b033aed31432e5d7 Log: Skip the tests if multibyte isn't loaded to prevent them from being fragile based on encoding availability Changed paths: M Zend/tests/typehints/scalar_strict_declaration_placement_006.phpt M Zend/tests/typehints/scalar_strict_declaration_placement_007.phpt Diff: diff --git a/Zend/tests/typehints/scalar_strict_declaration_placement_006.phpt b/Zend/tests/typehints/scalar_strict_declaration_placement_006.phpt index 0c71cd9..cac5848 100644 --- a/Zend/tests/typehints/scalar_strict_declaration_placement_006.phpt +++ b/Zend/tests/typehints/scalar_strict_declaration_placement_006.phpt @@ -1,8 +1,19 @@ --TEST-- Test strict declaration being first operation only 006 +--SKIPIF-- +<?php +if (!in_array("zend.detect_unicode", array_keys(ini_get_all()))) { + die("skip Requires configure --enable-zend-multibyte option"); +} +if (!extension_loaded("mbstring")) { + die("skip Requires mbstring extension"); +} +?> +--INI-- +zend.multibyte=1 --FILE-- <?php -declare(encoding=1); +declare(encoding="UTF-8"); declare(strict_types=1); namespace Foo; @@ -11,6 +22,4 @@ var_dump(strlen("abc")); ?> --EXPECTF-- -Warning: declare(encoding=...) ignored because Zend multibyte feature is turned off by settings in %s on line %d - Fatal error: strict_types declaration must be the very first statement in the script in %s on line %d \ No newline at end of file diff --git a/Zend/tests/typehints/scalar_strict_declaration_placement_007.phpt b/Zend/tests/typehints/scalar_strict_declaration_placement_007.phpt index 1a398de..3e4c693 100644 --- a/Zend/tests/typehints/scalar_strict_declaration_placement_007.phpt +++ b/Zend/tests/typehints/scalar_strict_declaration_placement_007.phpt @@ -1,9 +1,20 @@ --TEST-- Test strict declaration being first operation only 007 +--SKIPIF-- +<?php +if (!in_array("zend.detect_unicode", array_keys(ini_get_all()))) { + die("skip Requires configure --enable-zend-multibyte option"); +} +if (!extension_loaded("mbstring")) { + die("skip Requires mbstring extension"); +} +?> +--INI-- +zend.multibyte=1 --FILE-- <?php declare(strict_types=1); -declare(encoding=1); +declare(encoding="ISO-8859-1"); namespace Foo; @@ -11,5 +22,4 @@ var_dump(strlen("abc")); ?> --EXPECTF-- -Warning: declare(encoding=...) ignored because Zend multibyte feature is turned off by settings in %s on line %d int(3) \ No newline at end of file

« previous php.cvs (#85714) next »