|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace ByTIC\Models\SmartProperties\Tests\RecordsTraits\HasStatus; |
|
4
|
|
|
|
|
5
|
|
|
use ByTIC\Models\SmartProperties\Tests\Fixtures\RecordsTraits\HasStatus\Records; |
|
6
|
|
|
use ByTIC\Models\SmartProperties\Tests\Fixtures\RecordsTraits\HasStatus\Statuses\Allocated; |
|
7
|
|
|
use ByTIC\Models\SmartProperties\Tests\Fixtures\RecordsTraits\HasStatus\Statuses\Applicant; |
|
8
|
|
|
use ByTIC\Models\SmartProperties\Tests\AbstractTest; |
|
9
|
|
|
|
|
10
|
|
|
/** |
|
11
|
|
|
* Class TraitsTest |
|
12
|
|
|
* @package ByTIC\Models\SmartProperties\Tests\Payments\Methods |
|
13
|
|
|
*/ |
|
14
|
|
|
class RecordsTraitTest extends AbstractTest |
|
15
|
|
|
{ |
|
16
|
|
|
/** |
|
17
|
|
|
* @var Records |
|
18
|
|
|
*/ |
|
19
|
|
|
private $object; |
|
20
|
|
|
|
|
21
|
|
|
public function testGetSmartPropertiesDefinitions() |
|
22
|
|
|
{ |
|
23
|
|
|
$definitions = $this->object->getSmartPropertiesDefinitions(); |
|
24
|
|
|
self::assertCount(1, $definitions); |
|
25
|
|
|
} |
|
26
|
|
|
|
|
27
|
|
|
public function testGetStatuses() |
|
28
|
|
|
{ |
|
29
|
|
|
$statuses = $this->object->getStatuses(); |
|
30
|
|
|
self::assertCount(2, $statuses); |
|
31
|
|
|
self::assertInstanceOf(Allocated::class, $statuses['allocated']); |
|
32
|
|
|
self::assertInstanceOf(Applicant::class, $statuses['applicant']); |
|
33
|
|
|
} |
|
34
|
|
|
|
|
35
|
|
|
public function testGetStatusProperty() |
|
36
|
|
|
{ |
|
37
|
|
|
$values = $this->object->getStatusProperty('name'); |
|
38
|
|
|
self::assertSame(['allocated', 'applicant'], $values); |
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
|
|
public function testGetStatus() |
|
42
|
|
|
{ |
|
43
|
|
|
$status = $this->object->getStatus('allocated'); |
|
44
|
|
|
self::assertInstanceOf(Allocated::class, $status); |
|
45
|
|
|
} |
|
46
|
|
|
|
|
47
|
|
|
|
|
48
|
|
|
protected function setUp(): void |
|
49
|
|
|
{ |
|
50
|
|
|
parent::setUp(); |
|
51
|
|
|
$this->object = new Records(); |
|
52
|
|
|
} |
|
53
|
|
|
} |
|
54
|
|
|
|