aboutsummaryrefslogtreecommitdiffstats
path: root/library/kzykhys/git/test/PHPGit/Command/ShortlogCommandTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'library/kzykhys/git/test/PHPGit/Command/ShortlogCommandTest.php')
-rw-r--r--library/kzykhys/git/test/PHPGit/Command/ShortlogCommandTest.php71
1 files changed, 0 insertions, 71 deletions
diff --git a/library/kzykhys/git/test/PHPGit/Command/ShortlogCommandTest.php b/library/kzykhys/git/test/PHPGit/Command/ShortlogCommandTest.php
deleted file mode 100644
index 48967cab1..000000000
--- a/library/kzykhys/git/test/PHPGit/Command/ShortlogCommandTest.php
+++ /dev/null
@@ -1,71 +0,0 @@
-<?php
-
-use PHPGit\Git;
-use Symfony\Component\Filesystem\Filesystem;
-
-require_once __DIR__ . '/../BaseTestCase.php';
-
-class ShortlogCommandTest extends BaseTestCase
-{
-
- public function testShortlog()
- {
- $filesystem = new Filesystem();
-
- $git = new Git();
- $git->init($this->directory);
- $git->setRepository($this->directory);
- $git->config->set('user.name', 'Name One');
- $git->config->set('user.email', 'one@example.com');
- $filesystem->dumpFile($this->directory . '/test.txt', '');
- $git->add('test.txt');
- $git->commit('1');
- $filesystem->dumpFile($this->directory . '/test2.txt', '');
- $git->add('test2.txt');
- $git->commit('2');
-
- $git->config->set('user.name', 'Name Two');
- $git->config->set('user.email', 'two@example.com');
- $filesystem->dumpFile($this->directory . '/test3.txt', '');
- $git->add('test3.txt');
- $git->commit('3');
-
- $shortlog = $git->shortlog();
-
- $this->assertCount(2, $shortlog);
- $this->assertCount(2, $shortlog['Name One <one@example.com>']);
- $this->assertCount(1, $shortlog['Name Two <two@example.com>']);
- $this->assertEquals('1', $shortlog['Name One <one@example.com>'][0]['subject']);
- }
-
- public function testShortlogSummary()
- {
- $filesystem = new Filesystem();
-
- $git = new Git();
- $git->init($this->directory);
- $git->setRepository($this->directory);
- $git->config->set('user.name', 'Name One');
- $git->config->set('user.email', 'one@example.com');
- $filesystem->dumpFile($this->directory . '/test.txt', '');
- $git->add('test.txt');
- $git->commit('1');
- $filesystem->dumpFile($this->directory . '/test2.txt', '');
- $git->add('test2.txt');
- $git->commit('2');
-
- $git->config->set('user.name', 'Name Two');
- $git->config->set('user.email', 'two@example.com');
- $filesystem->dumpFile($this->directory . '/test3.txt', '');
- $git->add('test3.txt');
- $git->commit('3');
-
- $summary = $git->shortlog->summary();
-
- $this->assertEquals(array(
- 'Name One <one@example.com>' => 2,
- 'Name Two <two@example.com>' => 1
- ), $summary);
- }
-
-} \ No newline at end of file