mirror of
https://github.com/PGYER/codefever.git
synced 2026-05-08 14:36:58 +08:00
32 lines
1.5 KiB
PHP
Executable File
32 lines
1.5 KiB
PHP
Executable File
<?php
|
|
namespace Git;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
use service\Git\Command;
|
|
|
|
class CommandTest extends TestCase {
|
|
public function testGetCommitList()
|
|
{
|
|
$expected = 'log master --skip 0 -20 --pretty="{sha:%H,log:%s,body:%b,email:%ae,time:%at}"';
|
|
$actual = Command::getCommitList('master');
|
|
|
|
$this->assertSame($expected, $actual);
|
|
}
|
|
|
|
public function testGetCommitList_Keyword()
|
|
{
|
|
$expected = 'log master --grep=fix --skip 20 -20 --pretty="{sha:%H,log:%s,body:%b,email:%ae,time:%at}"';
|
|
$actual = Command::getCommitList('master', '', 'fix', 2);
|
|
|
|
$this->assertSame($expected, $actual);
|
|
}
|
|
|
|
public function testGetCommitList_Path()
|
|
{
|
|
$expected = 'log master --skip 20 -20 --pretty="{sha:%H,log:%s,body:%b,email:%ae,time:%at}" -- .gitignrore';
|
|
$actual = Command::getCommitList('master', '.gitignrore', '', 2);
|
|
|
|
$this->assertSame($expected, $actual);
|
|
}
|
|
}
|