Passed
Push — master ( 31d695...c567f3 )
by Max
02:55
created

ManagerTest::testClassExistence()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
declare(strict_types=1);
4
5
namespace EasyDictionary;
6
7
use PHPUnit\Framework\TestCase;
8
9
class ManagerTest extends TestCase
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class ManagerTest
Loading history...
10
{
11
    public function testClassExistence()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function testClassExistence()
Loading history...
12
    {
13
        $this->assertTrue(class_exists('\EasyDictionary\Manager'));
14
    }
15
16
    public function testCheckPublicAttributes()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function testCheckPublicAttributes()
Loading history...
17
    {
18
        $this->assertClassHasAttribute('defaultDictionary', \EasyDictionary\Manager::class);
19
        $this->assertClassHasAttribute('defaultDataProvider', \EasyDictionary\Manager::class);
20
        $this->assertClassHasAttribute('config', \EasyDictionary\Manager::class);
21
    }
22
23
    public function testDefaultValues()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function testDefaultValues()
Loading history...
24
    {
25
        $manager = new \EasyDictionary\Manager();
26
        $this->assertEquals('EasyDictionary\Dictionary\Simple', $manager->defaultDictionary);
27
        $this->assertEquals('EasyDictionary\DataProvider\Simple', $manager->defaultDataProvider);
28
        $this->assertEquals([], $manager->config);
29
    }
30
31
    public function testSettersAndGetters()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function testSettersAndGetters()
Loading history...
32
    {
33
        $manager = new \EasyDictionary\Manager();
34
        $manager->setDefaultDataProvider('defaultDataProvider');
35
        $this->assertEquals('defaultDataProvider', $manager->getDefaultDataProvider());
36
37
        $manager->setDefaultDictionary('defaultDictionary');
38
        $this->assertEquals('defaultDictionary', $manager->getDefaultDictionary());
39
40
        $manager->setConfig([1, 2, 3]);
41
        $this->assertEquals([1, 2, 3], $manager->getConfig());
42
    }
43
}
44