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

SetLocationTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 22
rs 10
c 1
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testLocationProperty() 0 3 1
A testTypeIdProperty() 0 3 1
A testWireSizeProperty() 0 3 1
A setUp() 0 3 1
1
<?php
2
3
namespace DaveRandom\LibLifxLan\Tests\Messages\Device\Commands;
4
5
use DaveRandom\LibLifxLan\DataTypes\Label;
6
use DaveRandom\LibLifxLan\DataTypes\Location;
7
use DaveRandom\LibLifxLan\Messages\Device\Commands\SetLocation;
8
use PHPUnit\Framework\TestCase;
9
use Ramsey\Uuid\Uuid;
10
11
final class SetLocationTest extends TestCase
12
{
13
    private $location;
14
15
    protected function setUp(): void
16
    {
17
        $this->location = new Location(Uuid::getFactory()->uuid4(), new Label('Test'), new \DateTime);
18
    }
19
20
    public function testLocationProperty(): void
21
    {
22
        $this->assertSame((new SetLocation($this->location))->getLocation(), $this->location);
23
    }
24
25
    public function testTypeIdProperty(): void
26
    {
27
        $this->assertSame((new SetLocation($this->location))->getTypeId(), SetLocation::MESSAGE_TYPE_ID);
28
    }
29
30
    public function testWireSizeProperty(): void
31
    {
32
        $this->assertSame((new SetLocation($this->location))->getWireSize(), SetLocation::WIRE_SIZE);
33
    }
34
}
35