GenericTest::test_toString()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 3
c 1
b 0
f 1
dl 0
loc 6
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace ByTIC\Models\SmartProperties\Tests\Properties\AbstractProperty;
4
5
use ByTIC\Models\SmartProperties\Tests\AbstractTest;
6
use ByTIC\Models\SmartProperties\Tests\Fixtures\RecordsTraits\HasTypes\Types\Relay;
7
8
/**
9
 * Class GenericTest
10
 * @package ByTIC\Models\SmartProperties\Tests\Properties\AbstractProperty
11
 */
12
class GenericTest extends AbstractTest
13
{
14
    public function test_toString()
15
    {
16
        $type = new Relay();
17
18
        self::assertSame('relay', (string)$type);
19
        self::assertSame('N: relay', 'N: ' . $type);
20
    }
21
22
    public function test_compare_different_objects()
23
    {
24
        $object1 = new \stdClass();
25
        $object1->id = 1;
26
        $type1 = new Relay();
27
        $type1->setItem($object1);
28
29
        $object2 = new \stdClass();
30
        $object1->id = 2;
31
        $type2 = new Relay();
32
        $type2->setItem($object2);
33
34
        self::assertTrue((string) $type2 == (string) $type1);
35
    }
36
}
37