CallbackMetadataEnricherTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 9
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testEnrich() 0 7 1
1
<?php declare(strict_types=1);
2
/**
3
 * This file is part of the daikon-cqrs/metadata project.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
namespace Daikon\Tests\Metadata;
10
11
use Daikon\Metadata\CallbackMetadataEnricher;
12
use Daikon\Metadata\Metadata;
13
use PHPUnit\Framework\TestCase;
14
15
final class CallbackMetadataEnricherTest extends TestCase
16
{
17 1
    public function testEnrich(): void
18
    {
19 1
        $metadata = (new CallbackMetadataEnricher(
20 1
            fn(Metadata $metadata): Metadata => $metadata->with('message', 'hello world')
21 1
        ))->enrich(Metadata::makeEmpty());
22
23 1
        $this->assertEquals($metadata->get('message'), 'hello world');
24 1
    }
25
}
26