Passed
Pull Request — master (#24)
by Dmitriy
37:45 queued 22:43
created

ConfigFactoryTest::checkCreate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 3
1
<?php
2
3
namespace Yiisoft\Composer\Config\Tests\Unit\Config;
4
5
use PHPUnit\Framework\TestCase;
6
use Yiisoft\Composer\Config\Builder;
7
use Yiisoft\Composer\Config\Config\Config;
8
use Yiisoft\Composer\Config\Config\ConfigFactory;
9
use Yiisoft\Composer\Config\Config\Constants;
10
use Yiisoft\Composer\Config\Config\Params;
11
use Yiisoft\Composer\Config\Config\System;
12
13
/**
14
 * ConfigFactoryTest.
15
 */
16
final class ConfigFactoryTest extends TestCase
17
{
18
    public function testCreate(): void
19
    {
20
        $factory = new ConfigFactory();
21
22
        $this->checkCreate($factory, 'common', Config::class);
23
        $this->checkCreate($factory, 'constants', Constants::class);
24
        $this->checkCreate($factory, 'params', Params::class);
25
        $this->checkCreate($factory, '__files', System::class);
26
    }
27
28
    public function checkCreate(ConfigFactory $configFactory, string $name, string $class): void
29
    {
30
        $config = $configFactory->create($this->createMock(Builder::class), $name);
31
        $this->assertInstanceOf($class, $config);
32
    }
33
}
34