MessageInterpolationTraitTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 11
dl 0
loc 25
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A interpolateMessageBasic() 0 13 1
1
<?php
2
3
namespace SubjectivePHPTest\Psr\Log;
4
5
use SubjectivePHP\Psr\Log\MessageInterpolationTrait;
6
7
/**
8
 * @coversDefaultClass \SubjectivePHP\Psr\Log\MessageInterpolationTrait
9
 */
10
final class MessageInterpolationTraitTest extends \PHPUnit\Framework\TestCase
11
{
12
    use MessageInterpolationTrait;
13
14
    /**
15
     * Verify basic behavior of interpolateMessage().
16
     *
17
     * @test
18
     * @covers ::interpolateMessage
19
     *
20
     * @return void
21
     */
22
    public function interpolateMessageBasic()
23
    {
24
        $message = 'The {0} brown {1} jumped over the {3} {1}';
25
        $context = [
26
            'quick',
27
            'fox',
28
            new \StdClass(), //not usable as replacement will be skipped
29
            'lazy',
30
        ];
31
32
        $this->assertSame(
33
            'The quick brown fox jumped over the lazy fox',
34
            $this->interpolateMessage($message, $context)
35
        );
36
    }
37
}
38