interpolateMessageBasic()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 13
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 0
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