FeatureTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 10
c 0
b 0
f 0
dl 0
loc 29
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A test_missing_provider_module() 0 6 1
A test_missing_config_module() 0 5 1
A test_missing_factory_module() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GacelaTest\Feature\Framework\MissingFile;
6
7
use Gacela\Framework\AbstractConfig;
8
use Gacela\Framework\AbstractFactory;
9
use Gacela\Framework\Bootstrap\GacelaConfig;
10
use Gacela\Framework\ClassResolver\Provider\ProviderNotFoundException;
11
use Gacela\Framework\Gacela;
12
use PHPUnit\Framework\TestCase;
13
14
final class FeatureTest extends TestCase
15
{
16
    protected function setUp(): void
17
    {
18
        Gacela::bootstrap(__DIR__, static function (GacelaConfig $config): void {
19
            $config->resetInMemoryCache();
20
        });
21
    }
22
23
    public function test_missing_factory_module(): void
24
    {
25
        $facade = new MissingFactoryFile\Facade();
26
27
        self::assertInstanceOf(AbstractFactory::class, $facade->getFactory());
28
    }
29
30
    public function test_missing_config_module(): void
31
    {
32
        $facade = new MissingConfigFile\Facade();
33
34
        self::assertInstanceOf(AbstractConfig::class, $facade->getConfig());
35
    }
36
37
    public function test_missing_provider_module(): void
38
    {
39
        $this->expectException(ProviderNotFoundException::class);
40
41
        $facade = new MissingProviderFile\Facade();
42
        $facade->error();
43
    }
44
}
45