Completed
Push — master ( d38252...509746 )
by Harry
03:13
created

ValidateTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 4
lcom 0
cbo 4
dl 0
loc 32
rs 10
c 1
b 1
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testArr() 0 7 1
A testObject() 0 7 1
A testArrayUnspecified() 0 6 1
A testObjectUnspecified() 0 6 1
1
<?php
2
3
namespace Graze\ConfigValidation\Test\Unit;
4
5
use Graze\ConfigValidation\ArrayValidator;
6
use Graze\ConfigValidation\ConfigValidatorInterface;
7
use Graze\ConfigValidation\ObjectValidator;
8
use Graze\ConfigValidation\Test\TestCase;
9
use Graze\ConfigValidation\Validate;
10
11
class ValidateTest extends TestCase
12
{
13
    public function testArr()
14
    {
15
        $validator = Validate::arr();
16
17
        $this->assertInstanceOf(ArrayValidator::class, $validator);
18
        $this->assertInstanceOf(ConfigValidatorInterface::class, $validator);
19
    }
20
21
    public function testObject()
22
    {
23
        $validator = Validate::object();
24
25
        $this->assertInstanceOf(ObjectValidator::class, $validator);
26
        $this->assertInstanceOf(ConfigValidatorInterface::class, $validator);
27
    }
28
29
    public function testArrayUnspecified()
30
    {
31
        $validator = Validate::arr(false);
32
33
        $this->assertFalse($validator->isAllowUnspecified());
34
    }
35
36
    public function testObjectUnspecified()
37
    {
38
        $validator = Validate::object(false);
39
40
        $this->assertFalse($validator->isAllowUnspecified());
41
    }
42
}
43