HasNameTest::date_infer_name_from_field()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 2
c 1
b 0
f 1
dl 0
loc 4
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\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