@@ -233,9 +233,12 @@ public function test256ColoursCodes() : void
233233 {
234234 $ terminal = static ::createMock (Terminal::class);
235235 $ terminal
236- ->expects ($ this ->any ())
236+ ->method ('getWidth ' )
237+ ->willReturn (100 );
238+
239+ $ terminal
237240 ->method ('getColourSupport ' )
238- ->will ( $ this -> returnValue ( 256 ) );
241+ ->willReturn ( 256 );
239242
240243 $ builder = new CliMenuBuilder ($ terminal );
241244 $ builder ->setBackgroundColour (16 , 'white ' );
@@ -248,9 +251,12 @@ public function test256ColoursCodes() : void
248251
249252 $ terminal = static ::createMock (Terminal::class);
250253 $ terminal
251- ->expects ($ this ->any ())
254+ ->method ('getWidth ' )
255+ ->willReturn (100 );
256+
257+ $ terminal
252258 ->method ('getColourSupport ' )
253- ->will ( $ this -> returnValue ( 8 ) );
259+ ->willReturn ( 8 );
254260
255261 $ builder = new CliMenuBuilder ($ terminal );
256262 $ builder ->setBackgroundColour (16 , 'white ' );
@@ -269,9 +275,11 @@ public function testSetFgThrowsExceptionWhenColourCodeIsNotInRange() : void
269275
270276 $ terminal = static ::createMock (Terminal::class);
271277 $ terminal
272- ->expects ($ this ->any ())
278+ ->method ('getWidth ' )
279+ ->willReturn (100 );
280+ $ terminal
273281 ->method ('getColourSupport ' )
274- ->will ( $ this -> returnValue ( 256 ) );
282+ ->willReturn ( 256 );
275283
276284 $ builder = new CliMenuBuilder ($ terminal );
277285 $ builder ->setForegroundColour (512 , 'white ' );
@@ -284,9 +292,11 @@ public function testSetBgThrowsExceptionWhenColourCodeIsNotInRange() : void
284292
285293 $ terminal = static ::createMock (Terminal::class);
286294 $ terminal
287- ->expects ($ this ->any ())
295+ ->method ('getWidth ' )
296+ ->willReturn (100 );
297+ $ terminal
288298 ->method ('getColourSupport ' )
289- ->will ( $ this -> returnValue ( 256 ) );
299+ ->willReturn ( 256 );
290300
291301 $ builder = new CliMenuBuilder ($ terminal );
292302 $ builder ->setBackgroundColour (257 , 'white ' );
0 commit comments