File: terminal.php

package info (click to toggle)
php-nunomaduro-termwind 2.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,172 kB
  • sloc: php: 3,969; makefile: 34
file content (25 lines) | stat: -rw-r--r-- 466 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php

use function Termwind\terminal;

it('can get the width of the terminal', function () {
    putenv('COLUMNS=100');

    $width = terminal()->width();

    expect($width)->toBe(100);
});

it('can get the height of the terminal', function () {
    putenv('LINES=30');

    $height = terminal()->height();

    expect($height)->toBe(30);
});

it('can clear the screen', function () {
    terminal()->clear();

    expect($this->output->fetch())->toBe("\ec");
});