fix reader/writer options according to docs
[awesomized/ext-ion] / tests / Reader / Options.phpt
1 --TEST--
2 ion\Reader\Options
3 --EXTENSIONS--
4 ion
5 --FILE--
6 TEST
7 <?php
8 $o = new ion\Reader\Options;
9 var_dump($o, clone $o);
10
11 $o = new ion\Reader\Options(
12 catalog: new ion\Catalog,
13 decimalContext: ion\Decimal\Context::Dec32(),
14 onContextChange: function(ion\Reader $r) {},
15 returnSystemValues: true,
16 skipCharacterValidation: true,
17 );
18 var_dump($o, clone $o);
19 ?>
20 DONE
21 --EXPECTF--
22 TEST
23 object(ion\Reader\Options)#%d (9) {
24 ["catalog"]=>
25 NULL
26 ["decimalContext"]=>
27 NULL
28 ["onContextChange"]=>
29 NULL
30 ["returnSystemValues"]=>
31 bool(false)
32 ["maxContainerDepth"]=>
33 int(10)
34 ["maxAnnotations"]=>
35 int(10)
36 ["annotationBufferSize"]=>
37 int(16384)
38 ["tempBufferSize"]=>
39 int(16384)
40 ["skipCharacterValidation"]=>
41 bool(false)
42 }
43 object(ion\Reader\Options)#%d (9) {
44 ["catalog"]=>
45 NULL
46 ["decimalContext"]=>
47 NULL
48 ["onContextChange"]=>
49 NULL
50 ["returnSystemValues"]=>
51 bool(false)
52 ["maxContainerDepth"]=>
53 int(10)
54 ["maxAnnotations"]=>
55 int(10)
56 ["annotationBufferSize"]=>
57 int(16384)
58 ["tempBufferSize"]=>
59 int(16384)
60 ["skipCharacterValidation"]=>
61 bool(false)
62 }
63 object(ion\Reader\Options)#%d (9) {
64 ["catalog"]=>
65 object(ion\Catalog)#%d (1) {
66 ["symbolTables":"ion\Catalog":private]=>
67 array(0) {
68 }
69 }
70 ["decimalContext"]=>
71 object(ion\Decimal\Context)#%d (5) {
72 ["digits"]=>
73 int(7)
74 ["eMax"]=>
75 int(96)
76 ["eMin"]=>
77 int(-95)
78 ["round"]=>
79 int(3)
80 ["clamp"]=>
81 bool(true)
82 }
83 ["onContextChange"]=>
84 object(Closure)#%d (1) {
85 ["parameter"]=>
86 array(1) {
87 ["$r"]=>
88 string(10) "<required>"
89 }
90 }
91 ["returnSystemValues"]=>
92 bool(true)
93 ["maxContainerDepth"]=>
94 int(10)
95 ["maxAnnotations"]=>
96 int(10)
97 ["annotationBufferSize"]=>
98 int(16384)
99 ["tempBufferSize"]=>
100 int(16384)
101 ["skipCharacterValidation"]=>
102 bool(true)
103 }
104 object(ion\Reader\Options)#%d (9) {
105 ["catalog"]=>
106 object(ion\Catalog)#%d (1) {
107 ["symbolTables":"ion\Catalog":private]=>
108 array(0) {
109 }
110 }
111 ["decimalContext"]=>
112 object(ion\Decimal\Context)#%d (5) {
113 ["digits"]=>
114 int(7)
115 ["eMax"]=>
116 int(96)
117 ["eMin"]=>
118 int(-95)
119 ["round"]=>
120 int(3)
121 ["clamp"]=>
122 bool(true)
123 }
124 ["onContextChange"]=>
125 object(Closure)#%d (1) {
126 ["parameter"]=>
127 array(1) {
128 ["$r"]=>
129 string(10) "<required>"
130 }
131 }
132 ["returnSystemValues"]=>
133 bool(true)
134 ["maxContainerDepth"]=>
135 int(10)
136 ["maxAnnotations"]=>
137 int(10)
138 ["annotationBufferSize"]=>
139 int(16384)
140 ["tempBufferSize"]=>
141 int(16384)
142 ["skipCharacterValidation"]=>
143 bool(true)
144 }
145 DONE