TagAppendingTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
cbo 1
dl 0
loc 30
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A appendStringValueUnderSpecifiedIndex() 0 11 1
A stringValuesWithIndexesDataProvider() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Dziki\MonologSentryBundle\Tests\Unit\Processor;
6
7
use Dziki\MonologSentryBundle\Processor\TagAppending;
8
use PHPUnit\Framework\TestCase;
9
10
/**
11
 * @covers \Dziki\MonologSentryBundle\Processor\TagAppending
12
 */
13
class TagAppendingTest extends TestCase
14
{
15
    /**
16
     * @dataProvider stringValuesWithIndexesDataProvider
17
     * @test
18
     *
19
     * @param string $index
20
     * @param string $tagValue
21
     */
22
    public function appendStringValueUnderSpecifiedIndex(string $index, string $tagValue): void
23
    {
24
        $tagAppendingProcessor = new TagAppending($index, $tagValue);
25
26
        $resultRecord = $tagAppendingProcessor([]);
27
28
        $tags = $resultRecord['extra']['tags'];
29
30
        $this->assertArrayHasKey($index, $tags);
31
        $this->assertEquals($tagValue, $tags[$index]);
32
    }
33
34
    public function stringValuesWithIndexesDataProvider(): array
35
    {
36
        return [
37
            ['1', 'one'],
38
            ['', 'one'],
39
            ['', ''],
40
        ];
41
    }
42
}
43