Passed
Push — master ( 3bddf7...37f0e3 )
by Max
07:30
created

SimpleTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 46
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testClassExistence() 0 4 1
A testSetDataFromConfig() 0 12 1
A testSetEmptyDataFromBadConfig() 0 12 1
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace EasyDictionary\DataProvider;
4
5
use PHPUnit\Framework\TestCase;
6
7
/**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
8
 * @coversDefaultClass \EasyDictionary\DataProvider\Simple
9
 */
0 ignored issues
show
Coding Style introduced by
Missing @category tag in class comment
Loading history...
Coding Style introduced by
Missing @package tag in class comment
Loading history...
Coding Style introduced by
Missing @author tag in class comment
Loading history...
Coding Style introduced by
Missing @license tag in class comment
Loading history...
Coding Style introduced by
Missing @link tag in class comment
Loading history...
10
class SimpleTest extends TestCase
11
{
12
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
13
     * @covers \EasyDictionary\DataProvider\Simple
14
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
15
    public function testClassExistence()
16
    {
17
        self::assertTrue(class_exists('\EasyDictionary\DataProvider\Simple'));
18
    }
19
20
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
21
     * @covers ::__construct
22
     * @covers ::setData
23
     * @covers ::getData
24
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
25
    public function testSetDataFromConfig()
26
    {
27
        $config = [
28
            'items' => [
29
                1, 2, 3
30
            ]
31
        ];
32
33
        $dataProvider = new Simple($config);
34
35
        self::assertEquals([1, 2, 3], $dataProvider->getData());
36
    }
37
38
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
39
     * @covers ::__construct
40
     * @covers ::setData
41
     * @covers ::getData
42
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
43
    public function testSetEmptyDataFromBadConfig()
44
    {
45
        $config = [
46
            'items2' => [
47
                1, 2, 3
48
            ]
49
        ];
50
51
        $dataProvider = new Simple($config);
52
53
        self::assertEquals([], $dataProvider->getData());
54
    }
55
}
56