File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -229,6 +229,16 @@ public function moveCursorToColumn(int $column) : void
229
229
$ this ->output ->write (sprintf ("\033[%dC " , $ column ));
230
230
}
231
231
232
+ public function showSecondaryScreen () : void
233
+ {
234
+ $ this ->output ->write ("\033[?47h " );
235
+ }
236
+
237
+ public function showPrimaryScreen () : void
238
+ {
239
+ $ this ->output ->write ("\033[?47l " );
240
+ }
241
+
232
242
/**
233
243
* Read bytes from the input stream
234
244
*/
Original file line number Diff line number Diff line change @@ -229,6 +229,28 @@ public function testMoveCursorToColumn() : void
229
229
self ::assertEquals ("\033[10C " , $ output ->fetch ());
230
230
}
231
231
232
+ public function testShowAlternateScreen () : void
233
+ {
234
+ $ input = $ this ->createMock (InputStream::class);
235
+ $ output = new BufferedOutput ;
236
+
237
+ $ terminal = new UnixTerminal ($ input , $ output );
238
+ $ terminal ->showSecondaryScreen ();
239
+
240
+ self ::assertEquals ("\033[?47h " , $ output ->fetch ());
241
+ }
242
+
243
+ public function testShowMainScreen () : void
244
+ {
245
+ $ input = $ this ->createMock (InputStream::class);
246
+ $ output = new BufferedOutput ;
247
+
248
+ $ terminal = new UnixTerminal ($ input , $ output );
249
+ $ terminal ->showPrimaryScreen ();
250
+
251
+ self ::assertEquals ("\033[?47l " , $ output ->fetch ());
252
+ }
253
+
232
254
public function testRead () : void
233
255
{
234
256
$ tempStream = fopen ('php://temp ' , 'r+ ' );
You can’t perform that action at this time.
0 commit comments