mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-07 08:45:40 +08:00
Refactor shell utilities: reorganize namespaces and introduce Shell base class
This commit is contained in:
@@ -48,17 +48,17 @@ abstract class TestBase extends TestCase
|
||||
/**
|
||||
* Create a UnixShell instance with debug disabled to suppress logs
|
||||
*/
|
||||
protected function createUnixShell(): \SPC\util\UnixShell
|
||||
protected function createUnixShell(): \SPC\util\shell\UnixShell
|
||||
{
|
||||
return new \SPC\util\UnixShell(false);
|
||||
return new \SPC\util\shell\UnixShell(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a WindowsCmd instance with debug disabled to suppress logs
|
||||
*/
|
||||
protected function createWindowsCmd(): \SPC\util\WindowsCmd
|
||||
protected function createWindowsCmd(): \SPC\util\shell\WindowsCmd
|
||||
{
|
||||
return new \SPC\util\WindowsCmd(false);
|
||||
return new \SPC\util\shell\WindowsCmd(false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,8 +4,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace SPC\Tests\util;
|
||||
|
||||
use SPC\exception\RuntimeException;
|
||||
use SPC\util\UnixShell;
|
||||
use SPC\exception\EnvironmentException;
|
||||
use SPC\util\shell\UnixShell;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
@@ -18,7 +18,7 @@ final class UnixShellTest extends TestBase
|
||||
$this->markTestSkipped('This test is for Windows systems only');
|
||||
}
|
||||
|
||||
$this->expectException(RuntimeException::class);
|
||||
$this->expectException(EnvironmentException::class);
|
||||
$this->expectExceptionMessage('Windows cannot use UnixShell');
|
||||
|
||||
new UnixShell();
|
||||
|
||||
@@ -4,8 +4,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace SPC\Tests\util;
|
||||
|
||||
use SPC\exception\RuntimeException;
|
||||
use SPC\util\WindowsCmd;
|
||||
use SPC\exception\SPCInternalException;
|
||||
use SPC\util\shell\WindowsCmd;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
@@ -18,7 +18,7 @@ final class WindowsCmdTest extends TestBase
|
||||
$this->markTestSkipped('This test is for Unix systems only');
|
||||
}
|
||||
|
||||
$this->expectException(RuntimeException::class);
|
||||
$this->expectException(SPCInternalException::class);
|
||||
$this->expectExceptionMessage('Only windows can use WindowsCmd');
|
||||
|
||||
new WindowsCmd();
|
||||
|
||||
Reference in New Issue
Block a user