Completed
Push — master ( 3e6e05...cbeae7 )
by Chad
9s
created

interpolateMessageBasic()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 9.7666
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
 * @covers ::<private>
10
 */
11
final class MessageInterpolationTraitTest extends \PHPUnit\Framework\TestCase
12
{
13
    use MessageInterpolationTrait;
14
15
    /**
16
     * Verify basic behavior of interpolateMessage().
17
     *
18
     * @test
19
     * @covers ::interpolateMessage
20
     *
21
     * @return void
22
     */
23
    public function interpolateMessageBasic()
24
    {
25
        $message = 'The {0} brown {1} jumped over the {3} {1}';
26
        $context = [
27
            'quick',
28
            'fox',
29
            new \StdClass(), //not usable as replacement will be skipped
30
            'lazy',
31
        ];
32
33
        $this->assertSame(
34
            'The quick brown fox jumped over the lazy fox',
35
            $this->interpolateMessage($message, $context)
36
        );
37
    }
38
}
39