Skip to content

Commit 4756ddf

Browse files
committed
up: update some unit tests
1 parent b656353 commit 4756ddf

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

Diff for: test/BaseCliTest.php

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace Toolkit\CliTest;
4+
5+
use PHPUnit\Framework\TestCase;
6+
7+
abstract class BaseCliTest extends TestCase
8+
{
9+
10+
}

Diff for: test/ColorTagTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
use PHPUnit\Framework\TestCase;
1313
use Toolkit\Cli\Color;
14-
use Toolkit\Cli\ColorTag;
14+
use Toolkit\Cli\Color\ColorTag;
1515
use function strpos;
1616
use function vdump;
1717
use const PHP_EOL;

Diff for: test/Util/ClogTest.php

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace Toolkit\CliTest\Util;
4+
5+
use Toolkit\Cli\Util\Clog;
6+
use Toolkit\CliTest\BaseCliTest;
7+
8+
/**
9+
* class ClogTest
10+
*
11+
* @author inhere
12+
*/
13+
class ClogTest extends BaseCliTest
14+
{
15+
public function testClog_basic(): void
16+
{
17+
Clog::info("info message");
18+
Clog::error("error message");
19+
Clog::emerg("emerg message");
20+
Clog::log('warning', 'warning message');
21+
22+
$this->assertNotEmpty(Clog::std());
23+
$this->assertNotEmpty(Clog::getLevelNames());
24+
}
25+
}

0 commit comments

Comments
 (0)