HasNameTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
eloc 6
c 1
b 0
f 1
dl 0
loc 18
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A test_infer_name_from_field() 0 5 1
A date_infer_name_from_field() 0 4 1
1
<?php
2
3
namespace ByTIC\Models\SmartProperties\Tests\Definitions\Traits;
4
5
use ByTIC\Models\SmartProperties\Properties\Definitions\Definition;
6
use ByTIC\Models\SmartProperties\Tests\AbstractTest;
7
8
/**
9
 * Class HasNameTest
10
 * @package ByTIC\Models\SmartProperties\Tests\Definitions\Traits
11
 */
12
class HasNameTest extends AbstractTest
13
{
14
    /**
15
     * @param $field
16
     * @param $name
17
     * @dataProvider date_infer_name_from_field
18
     */
19
    public function test_infer_name_from_field($field, $name)
20
    {
21
        $definition = new Definition();
0 ignored issues
show
Deprecated Code introduced by
The class ByTIC\Models\SmartProper...\Definitions\Definition has been deprecated: use \ByTIC\Models\SmartProperties\Definitions\Definition ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

21
        $definition = /** @scrutinizer ignore-deprecated */ new Definition();
Loading history...
22
        $definition->setField($field);
23
        self::assertSame($name, $definition->getName());
24
    }
25
26
    public function date_infer_name_from_field(): array
27
    {
28
        return [
29
            ['status','Status'],
30
        ];
31
    }
32
}
33