refactor(run_id): 提炼RunId::short用于warning短展示并加单测
This commit is contained in:
19
tests/Unit/RunIdShortTest.php
Normal file
19
tests/Unit/RunIdShortTest.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit;
|
||||
|
||||
use App\Support\RunId;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class RunIdShortTest extends TestCase
|
||||
{
|
||||
public function test_short_should_keep_original_when_not_long_enough(): void
|
||||
{
|
||||
$this->assertSame('BAS123456', RunId::short('BAS123456', 6, 4));
|
||||
}
|
||||
|
||||
public function test_short_should_shorten_with_ellipsis(): void
|
||||
{
|
||||
$this->assertSame('BAS202…0001', RunId::short('BAS202603171234560001', 6, 4));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user