for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the GitElephant package.
*
* (c) Matteo Giachino <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
* Just for fun...
*/
namespace GitElephant\Command;
use GitElephant\TestCase;
* DiffTreeCommandTest
* @author Matteo Giachino <[email protected]>
class LogCommandTest extends TestCase
{
* set up
public function setUp(): void
$this->initRepository();
$this->getRepository()->init();
$this->addFile('foo');
$this->addFolder('test-folder');
$this->addFile('test-file', 'test-folder', 'test');
$this->getRepository()->commit('first commit', true);
}
* testShowObjectLog
public function testShowObjectLog(): void
$branch = $this->getRepository()->getBranch('master');
$obj = $this->getRepository()->getTree('HEAD', 'test-folder/test-file')->getBlob();
$lc = LogCommand::getInstance();
$this->assertEquals(
"log '-s' '--pretty=raw' '--no-color' -- 'test-folder/test-file'",
$lc->showObjectLog($obj)
);
"log '-s' '--pretty=raw' '--no-color' 'master' -- 'test-folder/test-file'",
$lc->showObjectLog($obj, $branch)