mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-21 15:45:36 +08:00
add Terminal related test
This commit is contained in:
33
tests/ZM/Utils/TerminalTest.php
Normal file
33
tests/ZM/Utils/TerminalTest.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\ZM\Utils;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Throwable;
|
||||
use ZM\Console\Console;
|
||||
use ZM\Utils\Terminal;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
class TerminalTest extends TestCase
|
||||
{
|
||||
public function testInit()
|
||||
{
|
||||
Console::setLevel(4);
|
||||
Terminal::init();
|
||||
$this->assertStringContainsString('Initializing Terminal', $this->getActualOutput());
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Throwable
|
||||
*/
|
||||
public function testExecuteCommand()
|
||||
{
|
||||
Console::setLevel(2);
|
||||
Terminal::executeCommand('echo zhamao-framework');
|
||||
$this->assertStringContainsString('zhamao-framework', $this->getActualOutput());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user