Test Failed
Push — rename-plugins-to-after-plugin... ( 2b0a51 )
by Chema
02:52
created

BeforeFeatureTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

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

1 Method

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