@@ -233,9 +233,12 @@ public function test256ColoursCodes() : void
233
233
{
234
234
$ terminal = static ::createMock (Terminal::class);
235
235
$ terminal
236
- ->expects ($ this ->any ())
236
+ ->method ('getWidth ' )
237
+ ->willReturn (100 );
238
+
239
+ $ terminal
237
240
->method ('getColourSupport ' )
238
- ->will ( $ this -> returnValue ( 256 ) );
241
+ ->willReturn ( 256 );
239
242
240
243
$ builder = new CliMenuBuilder ($ terminal );
241
244
$ builder ->setBackgroundColour (16 , 'white ' );
@@ -248,9 +251,12 @@ public function test256ColoursCodes() : void
248
251
249
252
$ terminal = static ::createMock (Terminal::class);
250
253
$ terminal
251
- ->expects ($ this ->any ())
254
+ ->method ('getWidth ' )
255
+ ->willReturn (100 );
256
+
257
+ $ terminal
252
258
->method ('getColourSupport ' )
253
- ->will ( $ this -> returnValue ( 8 ) );
259
+ ->willReturn ( 8 );
254
260
255
261
$ builder = new CliMenuBuilder ($ terminal );
256
262
$ builder ->setBackgroundColour (16 , 'white ' );
@@ -269,9 +275,11 @@ public function testSetFgThrowsExceptionWhenColourCodeIsNotInRange() : void
269
275
270
276
$ terminal = static ::createMock (Terminal::class);
271
277
$ terminal
272
- ->expects ($ this ->any ())
278
+ ->method ('getWidth ' )
279
+ ->willReturn (100 );
280
+ $ terminal
273
281
->method ('getColourSupport ' )
274
- ->will ( $ this -> returnValue ( 256 ) );
282
+ ->willReturn ( 256 );
275
283
276
284
$ builder = new CliMenuBuilder ($ terminal );
277
285
$ builder ->setForegroundColour (512 , 'white ' );
@@ -284,9 +292,11 @@ public function testSetBgThrowsExceptionWhenColourCodeIsNotInRange() : void
284
292
285
293
$ terminal = static ::createMock (Terminal::class);
286
294
$ terminal
287
- ->expects ($ this ->any ())
295
+ ->method ('getWidth ' )
296
+ ->willReturn (100 );
297
+ $ terminal
288
298
->method ('getColourSupport ' )
289
- ->will ( $ this -> returnValue ( 256 ) );
299
+ ->willReturn ( 256 );
290
300
291
301
$ builder = new CliMenuBuilder ($ terminal );
292
302
$ builder ->setBackgroundColour (257 , 'white ' );
0 commit comments