Passed
Pull Request — master (#15)
by Dmitriy
13:06
created

ConfigTest::testConfig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 4
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Composer\Config\Tests\Integration\Tests\Config;
6
7
use Yiisoft\Composer\Config\Tests\Integration\Tests\PluginTestCase;
8
9
abstract class ConfigTest extends PluginTestCase
10
{
11
    protected function setUp(): void
12
    {
13
        $this->registerConfig($this->getConfigName());
14
    }
15
16
    /**
17
     * @dataProvider configProvider()
18
     * @param string $name
19
     * @param $expectedValue
20
     */
21
    public function testConfig(string $name, $expectedValue): void
22
    {
23
        $actualValue = $this->getConfigValue($name);
24
        $this->assertEquals($expectedValue, $actualValue);
25
    }
26
27
    protected function getConfigValue(string $name)
28
    {
29
        return $this->getFromConfig($this->getConfigName(), $name);
30
    }
31
32
    abstract protected function getConfigName(): string;
33
}
34