Passed
Push — add-extend-config ( f39ef4 )
by Chema
03:24
created

FeatureTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 13
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A test_binding_class() 0 11 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GacelaTest\Feature\Framework\ExtendConfig;
6
7
use Gacela\Framework\Bootstrap\GacelaConfig;
8
use Gacela\Framework\Gacela;
9
use GacelaTest\Feature\Framework\ExtendConfig\Module\Infrastructure\BindingStringValue;
10
use GacelaTest\Fixtures\StringValue;
11
use PHPUnit\Framework\TestCase;
12
13
final class FeatureTest extends TestCase
14
{
15
    public function test_binding_class(): void
16
    {
17
        Gacela::bootstrap(__DIR__, static function (GacelaConfig $config): void {
18
            $config->resetInMemoryCache();
19
            $config->extendConfig(BindingStringValue::class);
20
        });
21
22
        /** @var StringValue $singleton */
23
        $singleton = Gacela::get(StringValue::class);
24
25
        self::assertSame('Set from BindingStringValue', $singleton->value());
26
    }
27
}
28