Passed
Pull Request — master (#389)
by Valentin
04:52
created

ConfigsTest::testDep()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 11
rs 10
1
<?php
2
3
/**
4
 * Spiral Framework.
5
 *
6
 * @license   MIT
7
 * @author    Anton Titov (Wolfy-J)
8
 */
9
10
declare(strict_types=1);
11
12
namespace Spiral\Tests\Boot;
13
14
use PHPUnit\Framework\TestCase;
15
use Spiral\Config\ConfiguratorInterface;
16
use Spiral\Tests\Boot\Fixtures\TestConfig;
17
use Spiral\Tests\Boot\Fixtures\TestConfigurationCore;
0 ignored issues
show
Bug introduced by
The type Spiral\Tests\Boot\Fixtures\TestConfigurationCore 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...
18
use Spiral\Tests\Boot\Fixtures\TestCore;
19
20
class ConfigsTest extends TestCase
21
{
22
    public function testDirectories(): void
23
    {
24
        $core = TestCore::init([
25
            'root'   => __DIR__,
26
            'config' => __DIR__ . '/config'
27
        ]);
28
29
        /** @var TestConfig $config */
30
        $config = $core->getContainer()->get(TestConfig::class);
31
32
        $this->assertSame(['key' => 'value'], $config->toArray());
33
    }
34
35
    public function testDep(): void
36
    {
37
        $core = TestCore::init([
38
            'root'   => __DIR__,
39
            'config' => __DIR__ . '/config',
40
        ]);
41
42
        /** @var ConfiguratorInterface $config */
43
        $configurator = $core->getContainer()->get(ConfiguratorInterface::class);
44
45
        $this->assertSame(['test-key' => 'test value'], $configurator->getConfig('yaml'));
46
    }
47
}
48