Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Commit

Permalink
Merge pull request #105 from localheinz/fix/rename
Browse files Browse the repository at this point in the history
Fix: Rename Command
  • Loading branch information
localheinz committed Feb 14, 2016
2 parents 4cf011a + ee362ba commit f8ac467
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ composer global require localheinz/github-changelog
Create your changelogs anywhere:

```bash
$ github-changelog change-log localheinz github-changelog 0.1.1 0.1.2
$ github-changelog generate localheinz github-changelog 0.1.1 0.1.2
```

Enjoy the changelog:
Expand All @@ -39,7 +39,7 @@ $ composer require --dev --sort-packages localheinz/github-changelog
Create your changelog from within in your project:

```bash
$ vendor/bin/github-changelog pull-request localheinz github-changelog ae63248 master
$ vendor/bin/github-changelog generate localheinz github-changelog ae63248 master
```

Enjoy the changelog:
Expand Down
2 changes: 1 addition & 1 deletion github-changelog
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ use Symfony\Component\Console;

$application = new Console\Application('github-changelog', '0.3.0');

$application->add(new ChangeLog\Console\ChangeLogCommand());
$application->add(new ChangeLog\Console\GenerateCommand());
$application->run();
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
use Symfony\Component\Stopwatch\Stopwatch;
use Symfony\Component\Stopwatch\StopwatchEvent;

class ChangeLogCommand extends Command
class GenerateCommand extends Command
{
/**
* @var Client
Expand Down Expand Up @@ -55,8 +55,8 @@ public function __construct(Client $client = null, Repository\PullRequestReposit
protected function configure()
{
$this
->setName('change-log')
->setDescription('Creates a changelog from pull requests merged between references')
->setName('generate')
->setDescription('Generates a changelog from information found between commit references')
->addArgument(
'owner',
Input\InputArgument::REQUIRED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@
use Symfony\Component\Console\Input;
use Symfony\Component\Console\Tester\CommandTester;

class ChangeLogCommandTest extends PHPUnit_Framework_TestCase
class GenerateCommandTest extends PHPUnit_Framework_TestCase
{
use GeneratorTrait;

public function testHasName()
{
$command = new Console\ChangeLogCommand();
$command = new Console\GenerateCommand();

$this->assertSame('change-log', $command->getName());
$this->assertSame('generate', $command->getName());
}

public function testHasDescription()
{
$command = new Console\ChangeLogCommand();
$command = new Console\GenerateCommand();

$this->assertSame('Creates a changelog from pull requests merged between references', $command->getDescription());
$this->assertSame('Generates a changelog from information found between commit references', $command->getDescription());
}

/**
Expand All @@ -49,7 +49,7 @@ public function testHasDescription()
*/
public function testArgument($name, $required, $description)
{
$command = new Console\ChangeLogCommand();
$command = new Console\GenerateCommand();

$this->assertTrue($command->getDefinition()->hasArgument($name));

Expand Down Expand Up @@ -101,7 +101,7 @@ public function providerArgument()
*/
public function testOption($name, $shortcut, $required, $description, $default)
{
$command = new Console\ChangeLogCommand();
$command = new Console\GenerateCommand();

$this->assertTrue($command->getDefinition()->hasOption($name));

Expand Down Expand Up @@ -140,10 +140,10 @@ public function providerOption()

public function testConstructorCreatesClientWithCachedHttpClientIfNotInjected()
{
$command = new Console\ChangeLogCommand();
$command = new Console\GenerateCommand();

$property = new ReflectionProperty(
Console\ChangeLogCommand::class,
Console\GenerateCommand::class,
'client'
);

Expand Down Expand Up @@ -180,7 +180,7 @@ public function testExecuteAuthenticatesIfTokenOptionIsGiven()
->willReturn($this->getRangeMock())
;

$command = new Console\ChangeLogCommand(
$command = new Console\GenerateCommand(
$client,
$pullRequestRepository
);
Expand All @@ -197,7 +197,7 @@ public function testExecuteAuthenticatesIfTokenOptionIsGiven()

public function testConstructorCreatesPullRequestRepositoryIfNotInjected()
{
$command = new Console\ChangeLogCommand();
$command = new Console\GenerateCommand();

$this->assertAttributeInstanceOf(
Repository\PullRequestRepository::class,
Expand Down Expand Up @@ -229,7 +229,7 @@ public function testExecuteDelegatesToPullRequestRepository()
->willReturn($this->getRangeMock([]))
;

$command = new Console\ChangeLogCommand(
$command = new Console\GenerateCommand(
$this->getClientMock(),
$pullRequestRepository
);
Expand Down Expand Up @@ -263,7 +263,7 @@ public function testExecuteRendersMessageIfNoPullRequestsWereFound()
->willReturn($this->getRangeMock())
;

$command = new Console\ChangeLogCommand(
$command = new Console\GenerateCommand(
$this->getClientMock(),
$pullRequestRepository
);
Expand Down Expand Up @@ -299,7 +299,7 @@ public function testExecuteRendersDifferentMessageIfNoPullRequestsWereFoundAndNo
->willReturn($this->getRangeMock())
;

$command = new Console\ChangeLogCommand(
$command = new Console\GenerateCommand(
$this->getClientMock(),
$pullRequestRepository
);
Expand Down Expand Up @@ -360,7 +360,7 @@ public function testExecuteRendersPullRequestsWithTemplate()
->willReturn($this->getRangeMock($pullRequests))
;

$command = new Console\ChangeLogCommand(
$command = new Console\GenerateCommand(
$this->getClientMock(),
$pullRequestRepository
);
Expand Down Expand Up @@ -406,7 +406,7 @@ public function testExecuteRendersDifferentMessageWhenNoEndReferenceWasGiven()
->willReturn($this->getRangeMock($pullRequests))
;

$command = new Console\ChangeLogCommand(
$command = new Console\GenerateCommand(
$this->getClientMock(),
$pullRequestRepository
);
Expand Down Expand Up @@ -443,7 +443,7 @@ public function testExecuteHandlesExceptionsThrownWhenFetchingPullRequests()
$exception->getMessage()
);

$command = new Console\ChangeLogCommand(
$command = new Console\GenerateCommand(
$this->getClientMock(),
$pullRequestRepository
);
Expand Down

0 comments on commit f8ac467

Please sign in to comment.