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

MessageInterpolationTraitTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A interpolateMessageBasic() 0 15 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
 * @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