Completed
Push — master ( ac98ee...01982b )
by ANTHONIUS
02:45
created

ConfigurationTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 17
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the dotfiles project.
7
 *
8
 *     (c) Anthonius Munthi <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Dotfiles\Plugins\PHPBrew\Tests;
15
16
use Dotfiles\Core\Config\Config;
17
use Dotfiles\Plugins\PHPBrew\Configuration;
18
use PHPUnit\Framework\TestCase;
19
20
/**
21
 * Class DefinitionTest.
22
 *
23
 * @covers \Dotfiles\Plugins\PHPBrew\Configuration
24
 */
25
class ConfigurationTest extends TestCase
26
{
27
    public function testProcess(): void
28
    {
29
        $cachePath = sys_get_temp_dir().'/dotfiles/test/cache/config.php';
30
        if (is_file($cachePath)) {
31
            unlink($cachePath);
32
        }
33
        $config = new Config();
34
        $config->addDefinition(new Configuration());
35
        $config->addConfigDir(__DIR__.'/fixtures');
36
        $config->setCachePath($cachePath);
37
        $config->loadConfiguration();
38
        $processed = $config->getAll();
39
40
        $this->assertTrue($processed['phpbrew']['set_prompt']);
41
        $this->assertArrayHasKey('machines', $processed['phpbrew']);
42
    }
43
}
44