diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-01-29 16:18:46 +0100 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-01-30 10:13:29 +0100 |
commit | 146848429605752e156a9f0ced4bfb079720d094 (patch) | |
tree | 1d156686af96094f4d658fc086d6801274bf0bb7 | |
parent | 7d170eb2952d36dd7cc0ff126ef76ba5f299c174 (diff) | |
download | php-git-146848429605752e156a9f0ced4bfb079720d094.tar.gz |
Fix #74063: NumberFormatter fails after retrieval from session
While it would be desireable to actually support unserialization of
NumberFormatter instances, at least we should not allow serialization
for now.
We also remove some doubtful tests, which have been added[1] claiming
that they would crash the intl extension, but apparently no fix has
been applied, and the test cases have not been marked as XFAIL.
[1] <http://git.php.net/?p=php-src.git;a=commit;h=ed793b2a3f857fd49c0c1b036062140da5b3e674>
21 files changed, 20 insertions, 599 deletions
diff --git a/ext/intl/formatter/formatter_class.c b/ext/intl/formatter/formatter_class.c index 91efbed94e..d6c3493c8c 100644 --- a/ext/intl/formatter/formatter_class.c +++ b/ext/intl/formatter/formatter_class.c @@ -23,6 +23,7 @@ #include "formatter_attr.h" #include <zend_exceptions.h> +#include "Zend/zend_interfaces.h" zend_class_entry *NumberFormatter_ce_ptr = NULL; static zend_object_handlers NumberFormatter_handlers; @@ -181,6 +182,8 @@ void formatter_register_class( void ) INIT_CLASS_ENTRY( ce, "NumberFormatter", NumberFormatter_class_functions ); ce.create_object = NumberFormatter_object_create; NumberFormatter_ce_ptr = zend_register_internal_class( &ce ); + NumberFormatter_ce_ptr->serialize = zend_class_serialize_deny; + NumberFormatter_ce_ptr->unserialize = zend_class_unserialize_deny; memcpy(&NumberFormatter_handlers, &std_object_handlers, sizeof(NumberFormatter_handlers)); diff --git a/ext/intl/tests/bug74063.phpt b/ext/intl/tests/bug74063.phpt new file mode 100644 index 0000000000..126c4cc523 --- /dev/null +++ b/ext/intl/tests/bug74063.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #74063 (NumberFormatter fails after retrieval from session) +--SKIPIF-- +<?php +if (!extension_loaded('intl')) die('skip intl extension not available'); +?> +--FILE-- +<?php +$formatter = new NumberFormatter("en_GB", NumberFormatter::CURRENCY); +try { + serialize($formatter); +} catch (Exception $ex) { + echo $ex->getMessage(), PHP_EOL; +} +?> +--EXPECT-- +Serialization of 'NumberFormatter' is not allowed diff --git a/ext/intl/tests/symfony_format_type_double_intl1.phpt b/ext/intl/tests/symfony_format_type_double_intl1.phpt deleted file mode 100644 index 9a5c6b2a25..0000000000 --- a/ext/intl/tests/symfony_format_type_double_intl1.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Symfony StubNumberFormatterTest#testFormatTypeDoubleIntl #1 ---SKIPIF-- -<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> ---FILE-- -<?php - - -// PHP Unit's code to unserialize data passed as args to #testFormatTypeDoubleIntl -$unit_test_args = unserialize('a:3:{i:0;O:15:"NumberFormatter":0:{}i:1;i:1;i:2;s:1:"1";}'); - -var_dump($unit_test_args); - -// execute the code from #testFormatTypeDoubleIntl -try { - $unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_DOUBLE); -} catch (Error $exception) { - echo $exception->getMessage() . "\n"; -} ---EXPECT-- -array(3) { - [0]=> - object(NumberFormatter)#1 (0) { - } - [1]=> - int(1) - [2]=> - string(1) "1" -} -Found unconstructed NumberFormatter diff --git a/ext/intl/tests/symfony_format_type_double_intl2.phpt b/ext/intl/tests/symfony_format_type_double_intl2.phpt deleted file mode 100644 index e5014c6f34..0000000000 --- a/ext/intl/tests/symfony_format_type_double_intl2.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Symfony StubNumberFormatterTest#testFormatTypeDoubleIntl #2 ---SKIPIF-- -<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> ---FILE-- -<?php - - -// PHP Unit's code to unserialize data passed as args to #testFormatTypeDoubleIntl -$unit_test_args = unserialize('a:3:{i:0;O:15:"NumberFormatter":0:{}i:1;d:1.1000000000000001;i:2;s:3:"1.1";}'); - -var_dump($unit_test_args); - -// execute the code from #testFormatTypeDoubleIntl -try { - $unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_DOUBLE); -} catch (Error $exception) { - echo $exception->getMessage() . "\n"; -} ---EXPECT-- -array(3) { - [0]=> - object(NumberFormatter)#1 (0) { - } - [1]=> - float(1.1) - [2]=> - string(3) "1.1" -} -Found unconstructed NumberFormatter diff --git a/ext/intl/tests/symfony_format_type_double_intl3.phpt b/ext/intl/tests/symfony_format_type_double_intl3.phpt deleted file mode 100644 index fbfd629b75..0000000000 --- a/ext/intl/tests/symfony_format_type_double_intl3.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Symfony StubNumberFormatterTest#testFormatTypeDoubleIntl #3 ---SKIPIF-- -<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> ---FILE-- -<?php - - -// PHP Unit's code to unserialize data passed as args to #testFormatTypeDoubleIntl -$unit_test_args = unserialize('a:3:{i:0;O:15:"NumberFormatter":0:{}i:1;i:1;i:2;s:7:"SFD1.00";}'); - -var_dump($unit_test_args); - -// execute the code from #testFormatTypeDoubleIntl -try { - $unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_DOUBLE); -} catch (Error $exception) { - echo $exception->getMessage() . "\n"; -} ---EXPECT-- -array(3) { - [0]=> - object(NumberFormatter)#1 (0) { - } - [1]=> - int(1) - [2]=> - string(7) "SFD1.00" -} -Found unconstructed NumberFormatter diff --git a/ext/intl/tests/symfony_format_type_double_intl4.phpt b/ext/intl/tests/symfony_format_type_double_intl4.phpt deleted file mode 100644 index b736c23dab..0000000000 --- a/ext/intl/tests/symfony_format_type_double_intl4.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -Symfony StubNumberFormatterTest#testFormatTypeDoubleIntl #4 ---SKIPIF-- -<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> ---FILE-- -<?php - - -// PHP Unit's code to unserialize data passed as args to #testFormatTypeDoubleIntl -$unit_test_args = unserialize('a:3:{i:0;O:15:"NumberFormatter":0:{}i:1;d:1.1000000000000001;i:2;s:7:"SFD1.10";}'); - -var_dump($unit_test_args); - -// execute the code from #testFormatTypeDoubleIntl -try { - $unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_DOUBLE); -} catch (Error $exception) { - echo $exception->getMessage() . "\n"; -} -?> ---EXPECT-- -array(3) { - [0]=> - object(NumberFormatter)#1 (0) { - } - [1]=> - float(1.1) - [2]=> - string(7) "SFD1.10" -} -Found unconstructed NumberFormatter diff --git a/ext/intl/tests/symfony_format_type_int32_intl1.phpt b/ext/intl/tests/symfony_format_type_int32_intl1.phpt deleted file mode 100644 index 717414fc6f..0000000000 --- a/ext/intl/tests/symfony_format_type_int32_intl1.phpt +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -Symfony StubNumberFormatterTest#testFormatTypeInt32Intl #1 ---SKIPIF-- -<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> ---FILE-- -<?php - -// port of Symfony's Symfony\Component\Locale\Tests\Stub\StubNumberFormatterTest#testFormatTypeInt32Intl - - -// Crashes on Windows -// Windows note: the popup '...program has stopped working'(AEDebug Popup) -// doesn't always show if you're rapidly running this test repeatedly. -// regardless of that, the test always crashes every time. -// (it will show up the first time, or if you wait a while before running it again.) -// (the popup may also be disabled, which can be done with a registry setting.) -// you can confirm it crashed by checking the exit code OR -// the message this test prints at the very end (expected output for pass). -// -// Get Exit Code -// Linux: echo $? -// Windows: echo %ErrorLevel% - - - - - -// PHP Unit's code to unserialize data passed as args to #testFormatTypeInt32Intl -$unit_test_args = unserialize('a:3:{i:0;O:15:"NumberFormatter":0:{}i:1;i:1;i:2;s:1:"1";}'); - -var_dump($unit_test_args); - -// execute the code from #testFormatTypeInt32Intl -try { - $unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT32); -} catch (Error $exception) { - echo $exception->getMessage() . "\n"; -} ---EXPECT-- -array(3) { - [0]=> - object(NumberFormatter)#1 (0) { - } - [1]=> - int(1) - [2]=> - string(1) "1" -} -Found unconstructed NumberFormatter diff --git a/ext/intl/tests/symfony_format_type_int32_intl2.phpt b/ext/intl/tests/symfony_format_type_int32_intl2.phpt deleted file mode 100644 index 4b84ec1979..0000000000 --- a/ext/intl/tests/symfony_format_type_int32_intl2.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Symfony StubNumberFormatterTest#testFormatTypeInt32Intl #2 ---SKIPIF-- -<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> ---FILE-- -<?php - -// StubNumberFormatterTest#testFormatTypeInt32Intl is tested many times, each with different args. -// there are 7 sets of args that crash PHP (and other args that don't), each of those 7 is now a separate PHPT test -// to ensure that each of the 7 args are always tested. - -// PHP Unit's code to unserialize data passed as args to #testFormatTypeInt32Intl -$unit_test_args = unserialize('a:3:{i:0;O:15:"NumberFormatter":0:{}i:1;d:1.1000000000000001;i:2;s:1:"1";}'); - -var_dump($unit_test_args); - -// execute the code from #testFormatTypeInt32Intl -try { - $unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT32); -} catch (Error $exception) { - echo $exception->getMessage() . "\n"; -} ---EXPECT-- -array(3) { - [0]=> - object(NumberFormatter)#1 (0) { - } - [1]=> - float(1.1) - [2]=> - string(1) "1" -} -Found unconstructed NumberFormatter diff --git a/ext/intl/tests/symfony_format_type_int32_intl3.phpt b/ext/intl/tests/symfony_format_type_int32_intl3.phpt deleted file mode 100644 index efe35dd8b0..0000000000 --- a/ext/intl/tests/symfony_format_type_int32_intl3.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Symfony StubNumberFormatterTest#testFormatTypeInt32Intl #3 ---SKIPIF-- -<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> ---FILE-- -<?php - - -// PHP Unit's code to unserialize data passed as args to #testFormatTypeInt32Intl -$unit_test_args = unserialize('a:4:{i:0;O:15:"NumberFormatter":0:{}i:1;d:2147483648;i:2;s:14:"-2,147,483,648";i:3;s:83:"->format() TYPE_INT32 formats inconsistently an integer if out of the 32 bit range.";}'); - -var_dump($unit_test_args); - -// execute the code from #testFormatTypeInt32Intl -try { - $unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT32); -} catch (Error $exception) { - echo $exception->getMessage() . "\n"; -} ---EXPECT-- -array(4) { - [0]=> - object(NumberFormatter)#1 (0) { - } - [1]=> - float(2147483648) - [2]=> - string(14) "-2,147,483,648" - [3]=> - string(83) "->format() TYPE_INT32 formats inconsistently an integer if out of the 32 bit range." -} -Found unconstructed NumberFormatter diff --git a/ext/intl/tests/symfony_format_type_int32_intl4.phpt b/ext/intl/tests/symfony_format_type_int32_intl4.phpt deleted file mode 100644 index 8f6ea7b0c0..0000000000 --- a/ext/intl/tests/symfony_format_type_int32_intl4.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Symfony StubNumberFormatterTest#testFormatTypeInt32Intl #4 ---SKIPIF-- -<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> ---FILE-- -<?php - - -// PHP Unit's code to unserialize data passed as args to #testFormatTypeInt32Intl -$unit_test_args = unserialize('a:3:{i:0;O:15:"NumberFormatter":0:{}i:1;i:1;i:2;s:7:"SFD1.00";}'); - -var_dump($unit_test_args); - -// execute the code from #testFormatTypeInt32Intl -try { - $unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT32); -} catch (Error $exception) { - echo $exception->getMessage() . "\n"; -} ---EXPECT-- -array(3) { - [0]=> - object(NumberFormatter)#1 (0) { - } - [1]=> - int(1) - [2]=> - string(7) "SFD1.00" -} -Found unconstructed NumberFormatter diff --git a/ext/intl/tests/symfony_format_type_int32_intl5.phpt b/ext/intl/tests/symfony_format_type_int32_intl5.phpt deleted file mode 100644 index b9d302a12f..0000000000 --- a/ext/intl/tests/symfony_format_type_int32_intl5.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Symfony StubNumberFormatterTest#testFormatTypeInt32Intl #5 ---SKIPIF-- -<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> ---FILE-- -<?php - - -// PHP Unit's code to unserialize data passed as args to #testFormatTypeInt32Intl -$unit_test_args = unserialize('a:3:{i:0;O:15:"NumberFormatter":0:{}i:1;d:1.1000000000000001;i:2;s:7:"SFD1.00";}'); - -var_dump($unit_test_args); - -// execute the code from #testFormatTypeInt32Intl -try { - $unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT32); -} catch (Error $exception) { - echo $exception->getMessage() . "\n"; -} ---EXPECT-- -array(3) { - [0]=> - object(NumberFormatter)#1 (0) { - } - [1]=> - float(1.1) - [2]=> - string(7) "SFD1.00" -} -Found unconstructed NumberFormatter diff --git a/ext/intl/tests/symfony_format_type_int32_intl6.phpt b/ext/intl/tests/symfony_format_type_int32_intl6.phpt deleted file mode 100644 index b00f3f7ce9..0000000000 --- a/ext/intl/tests/symfony_format_type_int32_intl6.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Symfony StubNumberFormatterTest#testFormatTypeInt32Intl #6 ---SKIPIF-- -<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> ---FILE-- -<?php - - -// PHP Unit's code to unserialize data passed as args to #testFormatTypeInt32Intl -$unit_test_args = unserialize('a:4:{i:0;O:15:"NumberFormatter":0:{}i:1;d:2147483648;i:2;s:21:"(SFD2,147,483,648.00)";i:3;s:83:"->format() TYPE_INT32 formats inconsistently an integer if out of the 32 bit range.";}'); - -var_dump($unit_test_args); - -// execute the code from #testFormatTypeInt32Intl -try { - $unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT32); -} catch (Error $exception) { - echo $exception->getMessage() . "\n"; -} ---EXPECT-- -array(4) { - [0]=> - object(NumberFormatter)#1 (0) { - } - [1]=> - float(2147483648) - [2]=> - string(21) "(SFD2,147,483,648.00)" - [3]=> - string(83) "->format() TYPE_INT32 formats inconsistently an integer if out of the 32 bit range." -} -Found unconstructed NumberFormatter diff --git a/ext/intl/tests/symfony_format_type_int32_intl7.phpt b/ext/intl/tests/symfony_format_type_int32_intl7.phpt deleted file mode 100644 index 747074f090..0000000000 --- a/ext/intl/tests/symfony_format_type_int32_intl7.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Symfony StubNumberFormatterTest#testFormatTypeInt32Intl #7 ---SKIPIF-- -<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> ---FILE-- -<?php - - -// PHP Unit's code to unserialize data passed as args to #testFormatTypeInt32Intl -$unit_test_args = unserialize('a:4:{i:0;O:15:"NumberFormatter":0:{}i:1;d:-2147483649;i:2;s:19:"SFD2,147,483,647.00";i:3;s:83:"->format() TYPE_INT32 formats inconsistently an integer if out of the 32 bit range.";}'); - -var_dump($unit_test_args); - -// execute the code from #testFormatTypeInt32Intl -try { - $unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT32); -} catch (Error $exception) { - echo $exception->getMessage() . "\n"; -} ---EXPECT-- -array(4) { - [0]=> - object(NumberFormatter)#1 (0) { - } - [1]=> - float(-2147483649) - [2]=> - string(19) "SFD2,147,483,647.00" - [3]=> - string(83) "->format() TYPE_INT32 formats inconsistently an integer if out of the 32 bit range." -} -Found unconstructed NumberFormatter diff --git a/ext/intl/tests/symfony_format_type_int64_intl1.phpt b/ext/intl/tests/symfony_format_type_int64_intl1.phpt deleted file mode 100644 index 01f5820911..0000000000 --- a/ext/intl/tests/symfony_format_type_int64_intl1.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Symfony StubNumberFormatterTest#testFormatTypeInt64Intl #1 ---SKIPIF-- -<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> ---FILE-- -<?php - - -// PHP Unit's code to unserialize data passed as args to #testFormatTypeInt64Intl -$unit_test_args = unserialize('a:3:{i:0;O:15:"NumberFormatter":0:{}i:1;i:1;i:2;s:1:"1";}'); - -var_dump($unit_test_args); - -// execute the code from #testFormatTypeInt64Intl -//$unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT64); - -echo "== didn't crash ==".PHP_EOL; - -?> ---EXPECT-- -array(3) { - [0]=> - object(NumberFormatter)#1 (0) { - } - [1]=> - int(1) - [2]=> - string(1) "1" -} -== didn't crash == diff --git a/ext/intl/tests/symfony_format_type_int64_intl2.phpt b/ext/intl/tests/symfony_format_type_int64_intl2.phpt deleted file mode 100644 index f659ac373d..0000000000 --- a/ext/intl/tests/symfony_format_type_int64_intl2.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Symfony StubNumberFormatterTest#testFormatTypeInt64Intl #2 ---SKIPIF-- -<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> ---FILE-- -<?php - - -// PHP Unit's code to unserialize data passed as args to #testFormatTypeInt64Intl -$unit_test_args = unserialize('a:3:{i:0;O:15:"NumberFormatter":0:{}i:1;d:1.1000000000000001;i:2;s:1:"1";}'); - -var_dump($unit_test_args); - -// execute the code from #testFormatTypeInt64Intl -try { - $unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT64); -} catch (Error $exception) { - echo $exception->getMessage() . "\n"; -} ---EXPECT-- -array(3) { - [0]=> - object(NumberFormatter)#1 (0) { - } - [1]=> - float(1.1) - [2]=> - string(1) "1" -} -Found unconstructed NumberFormatter diff --git a/ext/intl/tests/symfony_format_type_int64_intl3.phpt b/ext/intl/tests/symfony_format_type_int64_intl3.phpt deleted file mode 100644 index e40b74775c..0000000000 --- a/ext/intl/tests/symfony_format_type_int64_intl3.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Symfony StubNumberFormatterTest#testFormatTypeInt64Intl #3 ---SKIPIF-- -<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> ---FILE-- -<?php - - -// PHP Unit's code to unserialize data passed as args to #testFormatTypeInt64Intl -$unit_test_args = unserialize('a:3:{i:0;O:15:"NumberFormatter":0:{}i:1;d:2147483648;i:2;s:13:"2,147,483,648";}'); - -var_dump($unit_test_args); - -// execute the code from #testFormatTypeInt64Intl -try { - $unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT64); -} catch (Error $exception) { - echo $exception->getMessage() . "\n"; -} ---EXPECT-- -array(3) { - [0]=> - object(NumberFormatter)#1 (0) { - } - [1]=> - float(2147483648) - [2]=> - string(13) "2,147,483,648" -} -Found unconstructed NumberFormatter diff --git a/ext/intl/tests/symfony_format_type_int64_intl4.phpt b/ext/intl/tests/symfony_format_type_int64_intl4.phpt deleted file mode 100644 index 8785b83c0a..0000000000 --- a/ext/intl/tests/symfony_format_type_int64_intl4.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Symfony StubNumberFormatterTest#testFormatTypeInt64Intl #4 ---SKIPIF-- -<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> ---FILE-- -<?php - - -// PHP Unit's code to unserialize data passed as args to #testFormatTypeInt64Intl -$unit_test_args = unserialize('a:3:{i:0;O:15:"NumberFormatter":0:{}i:1;d:-2147483649;i:2;s:14:"-2,147,483,649";}'); - -var_dump($unit_test_args); - -// execute the code from #testFormatTypeInt64Intl -try { - $unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT64); -} catch (Error $exception) { - echo $exception->getMessage() . "\n"; -} ---EXPECT-- -array(3) { - [0]=> - object(NumberFormatter)#1 (0) { - } - [1]=> - float(-2147483649) - [2]=> - string(14) "-2,147,483,649" -} -Found unconstructed NumberFormatter diff --git a/ext/intl/tests/symfony_format_type_int64_intl5.phpt b/ext/intl/tests/symfony_format_type_int64_intl5.phpt deleted file mode 100644 index 476e66b61e..0000000000 --- a/ext/intl/tests/symfony_format_type_int64_intl5.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Symfony StubNumberFormatterTest#testFormatTypeInt64Intl #5 ---SKIPIF-- -<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> ---FILE-- -<?php - - -// PHP Unit's code to unserialize data passed as args to #testFormatTypeInt64Intl -$unit_test_args = unserialize('a:3:{i:0;O:15:"NumberFormatter":0:{}i:1;i:1;i:2;s:7:"SFD1.00";}'); - -var_dump($unit_test_args); - -// execute the code from #testFormatTypeInt64Intl -try { - $unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT64); -} catch (Error $exception) { - echo $exception->getMessage() . "\n"; -} ---EXPECT-- -array(3) { - [0]=> - object(NumberFormatter)#1 (0) { - } - [1]=> - int(1) - [2]=> - string(7) "SFD1.00" -} -Found unconstructed NumberFormatter diff --git a/ext/intl/tests/symfony_format_type_int64_intl6.phpt b/ext/intl/tests/symfony_format_type_int64_intl6.phpt deleted file mode 100644 index 5c24fe9617..0000000000 --- a/ext/intl/tests/symfony_format_type_int64_intl6.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Symfony StubNumberFormatterTest#testFormatTypeInt64Intl #6 ---SKIPIF-- -<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> ---FILE-- -<?php - - -// PHP Unit's code to unserialize data passed as args to #testFormatTypeInt64Intl -$unit_test_args = unserialize('a:3:{i:0;O:15:"NumberFormatter":0:{}i:1;d:1.1000000000000001;i:2;s:7:"SFD1.00";}'); - -var_dump($unit_test_args); - -// execute the code from #testFormatTypeInt64Intl -try { - $unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT64); -} catch (Error $exception) { - echo $exception->getMessage() . "\n"; -} ---EXPECT-- -array(3) { - [0]=> - object(NumberFormatter)#1 (0) { - } - [1]=> - float(1.1) - [2]=> - string(7) "SFD1.00" -} -Found unconstructed NumberFormatter diff --git a/ext/intl/tests/symfony_format_type_int64_intl7.phpt b/ext/intl/tests/symfony_format_type_int64_intl7.phpt deleted file mode 100644 index 27b5a79f24..0000000000 --- a/ext/intl/tests/symfony_format_type_int64_intl7.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Symfony StubNumberFormatterTest#testFormatTypeInt64Intl #7 ---SKIPIF-- -<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> ---FILE-- -<?php - - -// PHP Unit's code to unserialize data passed as args to #testFormatTypeInt64Intl -$unit_test_args = unserialize('a:3:{i:0;O:15:"NumberFormatter":0:{}i:1;d:2147483648;i:2;s:19:"SFD2,147,483,648.00";}'); - -var_dump($unit_test_args); - -// execute the code from #testFormatTypeInt64Intl -try { - $unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT64); -} catch (Error $exception) { - echo $exception->getMessage() . "\n"; -} ---EXPECT-- -array(3) { - [0]=> - object(NumberFormatter)#1 (0) { - } - [1]=> - float(2147483648) - [2]=> - string(19) "SFD2,147,483,648.00" -} -Found unconstructed NumberFormatter diff --git a/ext/intl/tests/symfony_format_type_int64_intl8.phpt b/ext/intl/tests/symfony_format_type_int64_intl8.phpt deleted file mode 100644 index d33395d6b3..0000000000 --- a/ext/intl/tests/symfony_format_type_int64_intl8.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Symfony StubNumberFormatterTest#testFormatTypeInt64Intl #8 ---SKIPIF-- -<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> ---FILE-- -<?php - - -// PHP Unit's code to unserialize data passed as args to #testFormatTypeInt64Intl -$unit_test_args = unserialize('a:3:{i:0;O:15:"NumberFormatter":0:{}i:1;d:-2147483649;i:2;s:21:"(SFD2,147,483,649.00)";}'); - -var_dump($unit_test_args); - -// execute the code from #testFormatTypeInt64Intl -try { - $unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT64); -} catch (Error $exception) { - echo $exception->getMessage() . "\n"; -} ---EXPECT-- -array(3) { - [0]=> - object(NumberFormatter)#1 (0) { - } - [1]=> - float(-2147483649) - [2]=> - string(21) "(SFD2,147,483,649.00)" -} -Found unconstructed NumberFormatter |