1--TEST--
2Symfony StubNumberFormatterTest#testFormatTypeInt32Intl #1
3--SKIPIF--
4<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
5--FILE--
6<?php
7
8// port of Symfony's Symfony\Component\Locale\Tests\Stub\StubNumberFormatterTest#testFormatTypeInt32Intl
9
10
11// Crashes on Windows
12// Windows note: the popup '...program has stopped working'(AEDebug Popup)
13//    doesn't always show if you're rapidly running this test repeatedly.
14//    regardless of that, the test always crashes every time.
15//    (it will show up the first time, or if you wait a while before running it again.)
16//    (the popup may also be disabled, which can be done with a registry setting.)
17//    you can confirm it crashed by checking the exit code OR
18//    the message this test prints at the very end (expected output for pass).
19//
20// Get Exit Code
21//  Linux: echo $?
22//  Windows: echo %ErrorLevel%
23
24
25
26
27
28// PHP Unit's code to unserialize data passed as args to #testFormatTypeInt32Intl
29$unit_test_args = unserialize('a:3:{i:0;O:15:"NumberFormatter":0:{}i:1;i:1;i:2;s:1:"1";}');
30
31var_dump($unit_test_args);
32
33// execute the code from #testFormatTypeInt32Intl
34$unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT32);
35
36echo "== didn't crash ==".PHP_EOL;
37
38?>
39--EXPECT--
40array(3) {
41  [0]=>
42  object(NumberFormatter)#1 (0) {
43  }
44  [1]=>
45  int(1)
46  [2]=>
47  string(1) "1"
48}
49== didn't crash ==
50