Passed
Push — master ( 487089...443b76 )
by Chris
03:30
created

ProtocolHeaderTest::testTypePropertyValueTooLow()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace DaveRandom\LibLifxLan\Tests\Header;
4
5
use DaveRandom\LibLifxLan\Header\ProtocolHeader;
6
use PHPUnit\Framework\TestCase;
7
8
final class ProtocolHeaderTest extends TestCase
9
{
10
    public function testTypePropertyValidValues(): void
11
    {
12
        foreach ([0, 42, 65535] as $value) {
13
            $this->assertSame((new ProtocolHeader($value))->getType(), $value);
14
        }
15
    }
16
17
    /**
18
     * @expectedException \DaveRandom\LibLifxLan\Exceptions\InvalidValueException
19
     */
20
    public function testTypePropertyValueTooLow(): void
21
    {
22
        new ProtocolHeader(-1);
23
    }
24
25
    /**
26
     * @expectedException \DaveRandom\LibLifxLan\Exceptions\InvalidValueException
27
     */
28
    public function testTypePropertyValueTooHigh(): void
29
    {
30
        new ProtocolHeader(65536);
31
    }
32
}
33