@@ -39,7 +39,7 @@ public function shouldNotConvertToStringWhenRawValueIsNotAnArray(): void
3939 ->expects ($ this ->never ())
4040 ->method ('quote ' );
4141
42- $ arrayStringifier = new ArrayStringifier ($ stringifierMock , 3 , 5 );
42+ $ arrayStringifier = new ArrayStringifier ($ stringifierMock , $ quoterMock , 3 , 5 );
4343
4444 self ::assertNull ($ arrayStringifier ->stringify ($ raw , $ depth ));
4545 }
@@ -65,7 +65,7 @@ public function shouldReturnAPlaceHolderWhenDepthIsEqualsToMaximumDepth(): void
6565 ->expects ($ this ->never ())
6666 ->method ('quote ' );
6767
68- $ arrayStringifier = new ArrayStringifier ($ stringifierMock , $ maximumDepth , 5 );
68+ $ arrayStringifier = new ArrayStringifier ($ stringifierMock , $ quoterMock , $ maximumDepth , 5 );
6969
7070 self ::assertSame ($ expected , $ arrayStringifier ->stringify ($ raw , $ depth ));
7171 }
@@ -91,7 +91,7 @@ public function shouldReturnAPlaceHolderWhenDepthIsBiggerThanMaximumDepth(): voi
9191 ->expects ($ this ->never ())
9292 ->method ('quote ' );
9393
94- $ arrayStringifier = new ArrayStringifier ($ stringifierMock , $ maximumDepth , 5 );
94+ $ arrayStringifier = new ArrayStringifier ($ stringifierMock , $ quoterMock , $ maximumDepth , 5 );
9595
9696 self ::assertSame ($ expected , $ arrayStringifier ->stringify ($ raw , $ depth ));
9797 }
@@ -111,7 +111,14 @@ public function shouldReturnAPlaceHolderWhenRawValueIsAnEmptyArray(): void
111111 ->expects ($ this ->never ())
112112 ->method ('stringify ' );
113113
114- $ arrayStringifier = new ArrayStringifier ($ stringifierMock , 3 , 5 );
114+ $ quoterMock = $ this ->createMock (Quoter::class);
115+ $ quoterMock
116+ ->expects ($ this ->once ())
117+ ->method ('quote ' )
118+ ->with ($ expected , $ depth )
119+ ->willReturn ($ expected );
120+
121+ $ arrayStringifier = new ArrayStringifier ($ stringifierMock , $ quoterMock , 3 , 5 );
115122
116123 self ::assertSame ($ expected , $ arrayStringifier ->stringify ($ raw , $ depth ));
117124 }
@@ -131,7 +138,14 @@ public function shouldReturnAPlaceHolderWhenRawValueIsAnEmptyArrayEvenThenReache
131138 ->expects ($ this ->never ())
132139 ->method ('stringify ' );
133140
134- $ arrayStringifier = new ArrayStringifier ($ stringifierMock , $ depth , 5 );
141+ $ quoterMock = $ this ->createMock (Quoter::class);
142+ $ quoterMock
143+ ->expects ($ this ->once ())
144+ ->method ('quote ' )
145+ ->with ($ expected , $ depth )
146+ ->willReturn ($ expected );
147+
148+ $ arrayStringifier = new ArrayStringifier ($ stringifierMock , $ quoterMock , $ depth , 5 );
135149
136150 self ::assertSame ($ expected , $ arrayStringifier ->stringify ($ raw , $ depth ));
137151 }
@@ -154,7 +168,14 @@ public function shouldConvertToStringWhenRawValueIsAnArray(): void
154168 return (string ) $ raw ;
155169 });
156170
157- $ arrayStringifier = new ArrayStringifier ($ stringifierMock , 3 , 5 );
171+ $ quoterMock = $ this ->createMock (Quoter::class);
172+ $ quoterMock
173+ ->expects ($ this ->once ())
174+ ->method ('quote ' )
175+ ->with ($ expected , $ depth )
176+ ->willReturn ($ expected );
177+
178+ $ arrayStringifier = new ArrayStringifier ($ stringifierMock , $ quoterMock , 3 , 5 );
158179
159180 self ::assertSame ($ expected , $ arrayStringifier ->stringify ($ raw , $ depth ));
160181 }
@@ -181,7 +202,14 @@ public function shouldConvertToStringWhenRawValueIsNested(): void
181202 return (string ) $ raw ;
182203 });
183204
184- $ arrayStringifier = new ArrayStringifier ($ stringifierMock , 3 , 5 );
205+ $ quoterMock = $ this ->createMock (Quoter::class);
206+ $ quoterMock
207+ ->expects ($ this ->once ())
208+ ->method ('quote ' )
209+ ->with ($ expected , $ depth )
210+ ->willReturn ($ expected );
211+
212+ $ arrayStringifier = new ArrayStringifier ($ stringifierMock , $ quoterMock , 3 , 5 );
185213
186214 self ::assertSame ($ expected , $ arrayStringifier ->stringify ($ raw , $ depth ));
187215 }
@@ -204,7 +232,14 @@ public function shouldConvertToStringWhenKeysAreNotSequential(): void
204232 return (string ) $ raw ;
205233 });
206234
207- $ arrayStringifier = new ArrayStringifier ($ stringifierMock , 3 , 5 );
235+ $ quoterMock = $ this ->createMock (Quoter::class);
236+ $ quoterMock
237+ ->expects ($ this ->once ())
238+ ->method ('quote ' )
239+ ->with ($ expected , $ depth )
240+ ->willReturn ($ expected );
241+
242+ $ arrayStringifier = new ArrayStringifier ($ stringifierMock , $ quoterMock , 3 , 5 );
208243
209244 self ::assertSame ($ expected , $ arrayStringifier ->stringify ($ raw , $ depth ));
210245 }
@@ -227,7 +262,14 @@ public function shouldConvertToStringWhenKeysAreNotInteger(): void
227262 return (string ) $ raw ;
228263 });
229264
230- $ arrayStringifier = new ArrayStringifier ($ stringifierMock , 3 , 5 );
265+ $ quoterMock = $ this ->createMock (Quoter::class);
266+ $ quoterMock
267+ ->expects ($ this ->once ())
268+ ->method ('quote ' )
269+ ->with ($ expected , $ depth )
270+ ->willReturn ($ expected );
271+
272+ $ arrayStringifier = new ArrayStringifier ($ stringifierMock , $ quoterMock , 3 , 5 );
231273
232274 self ::assertSame ($ expected , $ arrayStringifier ->stringify ($ raw , $ depth ));
233275 }
@@ -252,7 +294,14 @@ public function shouldUseAPlaceholderWhenLimitOfItemsIsReached(): void
252294 return (string ) $ raw ;
253295 });
254296
255- $ arrayStringifier = new ArrayStringifier ($ stringifierMock , 1 , $ itemsLimit );
297+ $ quoterMock = $ this ->createMock (Quoter::class);
298+ $ quoterMock
299+ ->expects ($ this ->once ())
300+ ->method ('quote ' )
301+ ->with ($ expected , $ depth )
302+ ->willReturn ($ expected );
303+
304+ $ arrayStringifier = new ArrayStringifier ($ stringifierMock , $ quoterMock , 1 , $ itemsLimit );
256305
257306 self ::assertSame ($ expected , $ arrayStringifier ->stringify ($ raw , $ depth ));
258307 }
0 commit comments