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

UNHMessageHeaderTest::missingSubSegmentKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
rs 10
c 1
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\UNHMessageHeader;
9
use PHPUnit\Framework\TestCase;
10
11
final class UNHMessageHeaderTest extends TestCase
12
{
13
    /** @test */
14
    public function segmentValues(): void
15
    {
16
        $rawValues = ['UNH', '1', ['IFTMIN', 'S', '93A', 'UN', 'PN001']];
17
        $segment = new UNHMessageHeader($rawValues);
18
19
        self::assertEquals(UNHMessageHeader::class, $segment->name());
20
        self::assertEquals('1', $segment->subSegmentKey());
21
        self::assertEquals($rawValues, $segment->rawValues());
22
    }
23
24
    /** @test */
25
    public function missingSubSegmentKey(): void
26
    {
27
        $segment = new UNHMessageHeader(['UNH']);
28
        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

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