2929class JsonStreamReaderTest extends TestCase
3030{
3131 private string $ streamReadersDir ;
32- private string $ lazyGhostsDir ;
3332
3433 protected function setUp (): void
3534 {
3635 parent ::setUp ();
3736
3837 $ this ->streamReadersDir = \sprintf ('%s/symfony_json_streamer_test/stream_reader ' , sys_get_temp_dir ());
39- $ this ->lazyGhostsDir = \sprintf ('%s/symfony_json_streamer_test/lazy_ghost ' , sys_get_temp_dir ());
4038
4139 if (is_dir ($ this ->streamReadersDir )) {
4240 array_map ('unlink ' , glob ($ this ->streamReadersDir .'/* ' ));
4341 rmdir ($ this ->streamReadersDir );
4442 }
45-
46- if (is_dir ($ this ->lazyGhostsDir )) {
47- array_map ('unlink ' , glob ($ this ->lazyGhostsDir .'/* ' ));
48- rmdir ($ this ->lazyGhostsDir );
49- }
5043 }
5144
5245 public function testReadScalar ()
5346 {
54- $ reader = JsonStreamReader::create (streamReadersDir: $ this -> streamReadersDir , lazyGhostsDir: $ this ->lazyGhostsDir );
47+ $ reader = JsonStreamReader::create ([], $ this ->streamReadersDir );
5548
5649 $ this ->assertRead ($ reader , null , 'null ' , Type::nullable (Type::int ()));
5750 $ this ->assertRead ($ reader , true , 'true ' , Type::bool ());
@@ -63,7 +56,7 @@ public function testReadScalar()
6356
6457 public function testReadCollection ()
6558 {
66- $ reader = JsonStreamReader::create (streamReadersDir: $ this -> streamReadersDir , lazyGhostsDir: $ this ->lazyGhostsDir );
59+ $ reader = JsonStreamReader::create ([], $ this ->streamReadersDir );
6760
6861 $ this ->assertRead (
6962 $ reader ,
@@ -92,7 +85,7 @@ public function testReadCollection()
9285
9386 public function testReadObject ()
9487 {
95- $ reader = JsonStreamReader::create (streamReadersDir: $ this -> streamReadersDir , lazyGhostsDir: $ this ->lazyGhostsDir );
88+ $ reader = JsonStreamReader::create ([], $ this ->streamReadersDir );
9689
9790 $ this ->assertRead ($ reader , function (mixed $ read ) {
9891 $ this ->assertInstanceOf (ClassicDummy::class, $ read );
@@ -103,7 +96,7 @@ public function testReadObject()
10396
10497 public function testReadObjectWithGenerics ()
10598 {
106- $ reader = JsonStreamReader::create (streamReadersDir: $ this -> streamReadersDir , lazyGhostsDir: $ this ->lazyGhostsDir );
99+ $ reader = JsonStreamReader::create ([], $ this ->streamReadersDir );
107100
108101 $ this ->assertRead ($ reader , function (mixed $ read ) {
109102 $ this ->assertInstanceOf (DummyWithGenerics::class, $ read );
@@ -114,7 +107,7 @@ public function testReadObjectWithGenerics()
114107
115108 public function testReadObjectWithStreamedName ()
116109 {
117- $ reader = JsonStreamReader::create (streamReadersDir: $ this -> streamReadersDir , lazyGhostsDir: $ this ->lazyGhostsDir );
110+ $ reader = JsonStreamReader::create ([], $ this ->streamReadersDir );
118111
119112 $ this ->assertRead ($ reader , function (mixed $ read ) {
120113 $ this ->assertInstanceOf (DummyWithNameAttributes::class, $ read );
@@ -125,12 +118,11 @@ public function testReadObjectWithStreamedName()
125118 public function testReadObjectWithValueTransformer ()
126119 {
127120 $ reader = JsonStreamReader::create (
128- valueTransformers: [
121+ [
129122 StringToBooleanValueTransformer::class => new StringToBooleanValueTransformer (),
130123 DivideStringAndCastToIntValueTransformer::class => new DivideStringAndCastToIntValueTransformer (),
131124 ],
132- streamReadersDir: $ this ->streamReadersDir ,
133- lazyGhostsDir: $ this ->lazyGhostsDir ,
125+ $ this ->streamReadersDir ,
134126 );
135127
136128 $ this ->assertRead ($ reader , function (mixed $ read ) {
@@ -144,7 +136,7 @@ public function testReadObjectWithValueTransformer()
144136
145137 public function testReadObjectWithPhpDoc ()
146138 {
147- $ reader = JsonStreamReader::create (streamReadersDir: $ this -> streamReadersDir , lazyGhostsDir: $ this ->lazyGhostsDir );
139+ $ reader = JsonStreamReader::create ([], $ this ->streamReadersDir );
148140
149141 $ this ->assertRead ($ reader , function (mixed $ read ) {
150142 $ this ->assertInstanceOf (DummyWithPhpDoc::class, $ read );
@@ -156,7 +148,7 @@ public function testReadObjectWithPhpDoc()
156148
157149 public function testReadObjectWithNullableProperties ()
158150 {
159- $ reader = JsonStreamReader::create (streamReadersDir: $ this -> streamReadersDir , lazyGhostsDir: $ this ->lazyGhostsDir );
151+ $ reader = JsonStreamReader::create ([], $ this ->streamReadersDir );
160152
161153 $ this ->assertRead ($ reader , function (mixed $ read ) {
162154 $ this ->assertInstanceOf (DummyWithNullableProperties::class, $ read );
@@ -167,7 +159,7 @@ public function testReadObjectWithNullableProperties()
167159
168160 public function testReadObjectWithDateTimes ()
169161 {
170- $ reader = JsonStreamReader::create (streamReadersDir: $ this -> streamReadersDir , lazyGhostsDir: $ this ->lazyGhostsDir );
162+ $ reader = JsonStreamReader::create ([], $ this ->streamReadersDir );
171163
172164 $ this ->assertRead ($ reader , function (mixed $ read ) {
173165 $ this ->assertInstanceOf (DummyWithDateTimes::class, $ read );
@@ -178,7 +170,7 @@ public function testReadObjectWithDateTimes()
178170
179171 public function testCreateStreamReaderFile ()
180172 {
181- $ reader = JsonStreamReader::create (streamReadersDir: $ this -> streamReadersDir , lazyGhostsDir: $ this ->lazyGhostsDir );
173+ $ reader = JsonStreamReader::create ([], $ this ->streamReadersDir );
182174
183175 $ reader ->read ('true ' , Type::bool ());
184176
@@ -188,7 +180,7 @@ public function testCreateStreamReaderFile()
188180
189181 public function testCreateStreamReaderFileOnlyIfNotExists ()
190182 {
191- $ reader = JsonStreamReader::create (streamReadersDir: $ this -> streamReadersDir , lazyGhostsDir: $ this ->lazyGhostsDir );
183+ $ reader = JsonStreamReader::create ([], $ this ->streamReadersDir );
192184
193185 if (!file_exists ($ this ->streamReadersDir )) {
194186 mkdir ($ this ->streamReadersDir , recursive: true );
0 commit comments