php-kilo/tests/TermiosTest.php

35 lines
856 B
PHP
Raw Permalink Normal View History

2019-11-19 17:01:45 -05:00
<?php declare(strict_types=1);
2021-04-14 13:24:13 -04:00
namespace Aviat\Kilo\Tests;
2019-11-19 17:01:45 -05:00
use Aviat\Kilo\{Terminal\Termios, Terminal\TermiosException};
2019-11-19 17:01:45 -05:00
use PHPUnit\Framework\TestCase;
class TermiosTest extends TestCase {
public function testEnableRawMode(): void
{
2021-03-03 16:35:58 -05:00
$this->markTestSkipped();
2019-11-19 17:01:45 -05:00
// There will be an exception, due to the way the test suite is run
$this->expectException(TermiosException::class);
$this->assertNotEquals(NULL, Termios::enableRawMode());
}
/**
* @depends testEnableRawMode
*/
public function testEnableRowModeTwice(): void
{
$this->assertNull(Termios::enableRawMode());
}
/**
* @depends testEnableRawMode
*/
public function testDisableRawMode(): void
{
// There will be an exception, due to the way the test suite is run
$this->expectException(TermiosException::class);
$this->assertFalse(Termios::disableRawMode());
}
}