for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Moodle component manager.
*
* @author Luke Carrier <[email protected]>
* @copyright 2016 Luke Carrier
* @license GPL-3.0+
*/
namespace ComponentManager\Test\VersionControl\Git\Command;
use ComponentManager\VersionControl\Git\Command\FetchCommand;
use PHPUnit\Framework\TestCase;
class FetchCommandTest extends TestCase {
public function testGetCommandLine() {
$command = new FetchCommand();
$this->assertEquals(['fetch'], $command->getCommandLine());
$command = new FetchCommand('upstream');
$this->assertEquals(['fetch', 'upstream'], $command->getCommandLine());
}
public function testGetCommandLineWithTags() {
$command->setTags(true);
$this->assertEquals(['fetch', '--tags'], $command->getCommandLine());
$command->setTags(false);
$this->assertEquals(
['fetch', '--no-tags', 'upstream'],
$command->getCommandLine());