HasPlacesTest::test_addPlaces()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 8
c 0
b 0
f 0
dl 0
loc 12
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace ByTIC\Models\SmartProperties\Tests\Definitions\Traits;
4
5
use ByTIC\Models\SmartProperties\Definitions\Definition;
6
use ByTIC\Models\SmartProperties\Tests\AbstractTest;
7
8
/**
9
 * Class HasPlacesTest
10
 * @package ByTIC\Models\SmartProperties\Tests\Definitions\Traits
11
 */
12
class HasPlacesTest extends AbstractTest
13
{
14
    public function test_getPlaces()
15
    {
16
        $definition = new Definition();
17
18
        $places = ['pending', 'active'];
19
        $definition->setPlaces($places);
20
        self::assertSame($places, $definition->getPlaces());
21
    }
22
23
    public function test_addPlaces()
24
    {
25
        $definition = new Definition();
26
27
        $places = ['pending', 'active'];
28
        $definition->addPlace(...$places);
29
        $definition->addPlace('active');
30
        self::assertSame($places, $definition->getPlaces());
31
32
        $definition->addPlace('canceled');
33
        $places[] = 'canceled';
34
        self::assertSame($places, $definition->getPlaces());
35
    }
36
}