Completed
Push — master ( 8d38b3...065629 )
by Andrii
02:12
created

GitLogParserTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 1
cbo 4
dl 0
loc 26
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 5 1
A tearDown() 0 3 1
A testParsePath() 0 8 1
1
<?php
2
/**
3
 * Changelog keeper
4
 *
5
 * @link      https://github.com/hiqdev/chkipper
6
 * @package   chkipper
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2016-2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\chkipper\tests\unit\lib;
12
13
use hiqdev\chkipper\lib\parsers\GitLogParser;
14
use hiqdev\chkipper\lib\renderers\MarkdownRenderer;
15
16
/**
17
 * Git log history parser test case.
18
 *
19
 * @author Andrii Vasyliev <[email protected]>
20
 */
21
class GitLogParserTest extends \PHPUnit_Framework_TestCase
22
{
23
    /**
24
     * @var GitLogParser
25
     */
26
    protected $object;
27
28
    protected function setUp()
29
    {
30
        $config = new Config();
31
        $this->object = new GitLogParser($config);
32
    }
33
34
    protected function tearDown()
35
    {
36
    }
37
38
    public function testParsePath()
39
    {
40
        $this->object->parsePath(__DIR__ . '/big-git-log.txt');
41
        $this->object->getHistory()->setProject('hiqdev/chkipper');
42
        $renderer = new MarkdownRenderer($this->object->getConfig());
43
        $text = $renderer->render($this->object->getHistory());
44
        $this->assertEquals(file_get_contents(__DIR__ . '/big-git-log.md'), $text);
45
    }
46
}
47