AbstractDefinitionTestCase   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 7
c 0
b 0
f 0
dl 0
loc 16
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A newDefinitionWithManager() 0 8 1
A newDefinition() 0 4 1
1
<?php
2
3
namespace ByTIC\Models\SmartProperties\Tests\Definitions;
4
5
use ByTIC\Models\SmartProperties\Definitions\Definition;
6
use ByTIC\Models\SmartProperties\Tests\AbstractTest;
7
use ByTIC\Models\SmartProperties\Tests\Fixtures\RecordsTraits\HasTypes\Records;
8
9
/**
10
 * Class AbstractDefinitionTest
11
 * @package ByTIC\Models\SmartProperties\Tests\Definitions
12
 */
13
abstract class AbstractDefinitionTestCase extends AbstractTest
14
{
15
    protected function newDefinitionWithManager(): Definition
16
    {
17
        $definition = $this->newDefinition();
18
19
        $manager = \Mockery::mock(Records::class)->shouldAllowMockingProtectedMethods()->makePartial();
20
        $definition->setManager($manager);
21
22
        return $definition;
23
    }
24
25
    protected function newDefinition(): Definition
26
    {
27
        $definition = new Definition();
28
        return $definition;
29
    }
30
}
31