Passed
Pull Request — master (#15)
by Dmitriy
10:54
created

PluginTestCase   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 6
c 2
b 0
f 0
dl 0
loc 15
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getParam() 0 5 1
A setUp() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Composer\Config\Tests\Integration\Tests;
6
7
use PHPUnit\Framework\TestCase;
8
use Yiisoft\Composer\Config\Builder;
9
10
abstract class PluginTestCase extends TestCase
11
{
12
    private const BASE_DIRECTORY = __DIR__ . '/../Environment';
13
    private const OUTPUT_DIRECTORY = self::BASE_DIRECTORY . '/vendor/yiisoft/composer-config-plugin-output';
14
15
    final protected function setUp(): void
16
    {
17
        Builder::rebuild(self::OUTPUT_DIRECTORY);
18
    }
19
20
    protected function getParam(string $name)
21
    {
22
        $config = require Builder::path('params', self::BASE_DIRECTORY);
23
24
        return $config[$name];
25
    }
26
}
27