ReadmeTest   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 17
dl 0
loc 48
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A testMinimal() 0 5 1
A setUp() 0 3 1
A prepare() 0 7 1
A tearDown() 0 3 1
A testMore() 0 7 1
1
<?php
2
/**
3
 * README plugin for HiDev
4
 *
5
 * @link      https://github.com/hiqdev/hidev-readme
6
 * @package   hidev-readme
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hidev\readme\tests\functional;
12
13
use hidev\tests\functional\Tester;
14
15
class ReadmeTest extends \PHPUnit\Framework\TestCase
0 ignored issues
show
Bug introduced by
The type PHPUnit\Framework\TestCase was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
16
{
17
    /**
18
     * @var Tester
19
     */
20
    protected $tester;
21
22
    public $clean = false;
23
24
    protected function setUp()
25
    {
26
        $this->tester = new Tester($this);
27
    }
28
29
    protected function tearDown()
30
    {
31
        $this->tester = null;
32
    }
33
34
    protected function prepare($subdir)
35
    {
36
        $dir = __DIR__ . DIRECTORY_SEPARATOR . $subdir;
37
        $this->tester->setAlias('@hidev/readme', dirname(dirname(__DIR__)) . '/src');
38
        $this->tester->config($dir . '/.hidev/config.yml');
39
40
        return $dir;
41
    }
42
43
    /**
44
     * Test defaults.
45
     */
46
    public function testMinimal()
47
    {
48
        $dir = $this->prepare('minimal');
49
        $this->tester->hidev('README.md');
50
        $this->tester->assertFiles($dir, ['.']);
51
    }
52
53
    /**
54
     * Test options: badges, docs and more.
55
     */
56
    public function testMore()
57
    {
58
        $dir = $this->prepare('more');
59
        $this->tester->writeFile('docs/readme/Usage.md', $dir);
60
        $this->tester->writeFile('docs/readme/Installation.md', $dir);
61
        $this->tester->hidev('README.md');
62
        $this->tester->assertFiles($dir, ['.']);
63
    }
64
}
65