Passed
Push — master ( 6a73f4...298deb )
by Chema
02:27 queued 12s
created

DTMDateTimePeriodTest::missingSubSegmentKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace EdifactParser\Tests\Unit\Segments;
6
7
use EdifactParser\Exception\MissingSubSegmentKey;
8
use EdifactParser\Segments\CNTControl;
9
use EdifactParser\Segments\DTMDateTimePeriod;
10
use PHPUnit\Framework\TestCase;
11
12
final class DTMDateTimePeriodTest extends TestCase
13
{
14
    /** @test */
15
    public function segmentValues(): void
16
    {
17
        $rawValues = ['DTM', ['10', '20191002', '102']];
18
        $segment = new DTMDateTimePeriod($rawValues);
19
20
        self::assertEquals(DTMDateTimePeriod::class, $segment->name());
21
        self::assertEquals('10', $segment->subSegmentKey());
22
        self::assertEquals($rawValues, $segment->rawValues());
23
    }
24
25
    /** @test */
26
    public function missingSubSegmentKey(): void
27
    {
28
        $segment = new DTMDateTimePeriod(['DTM']);
29
        self::expectException(MissingSubSegmentKey::class);
0 ignored issues
show
Bug Best Practice introduced by
The method PHPUnit\Framework\TestCase::expectException() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

29
        self::/** @scrutinizer ignore-call */ 
30
              expectException(MissingSubSegmentKey::class);
Loading history...
30
        $segment->subSegmentKey();
31
    }
32
}
33