ValidateTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 30
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testArrayUnspecified() 0 5 1
A testObjectUnspecified() 0 5 1
A testObject() 0 6 1
A testArr() 0 6 1
1
<?php
2
/**
3
 * This file is part of graze/config-validation.
4
 *
5
 * Copyright (c) 2017 Nature Delivered Ltd. <https://www.graze.com>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @license https://github.com/graze/config-validation/blob/master/LICENSE.md
11
 * @link    https://github.com/graze/config-validation
12
 */
13
14
namespace Graze\ConfigValidation\Test\Unit;
15
16
use Graze\ConfigValidation\ArrayValidator;
17
use Graze\ConfigValidation\ConfigValidatorInterface;
18
use Graze\ConfigValidation\ObjectValidator;
19
use Graze\ConfigValidation\Test\TestCase;
20
use Graze\ConfigValidation\Validate;
21
22
class ValidateTest extends TestCase
23
{
24
    public function testArr()
25
    {
26
        $validator = Validate::arr();
27
28
        $this->assertInstanceOf(ArrayValidator::class, $validator);
29
        $this->assertInstanceOf(ConfigValidatorInterface::class, $validator);
30
    }
31
32
    public function testObject()
33
    {
34
        $validator = Validate::object();
35
36
        $this->assertInstanceOf(ObjectValidator::class, $validator);
37
        $this->assertInstanceOf(ConfigValidatorInterface::class, $validator);
38
    }
39
40
    public function testArrayUnspecified()
41
    {
42
        $validator = Validate::arr(false);
43
44
        $this->assertFalse($validator->isAllowUnspecified());
45
    }
46
47
    public function testObjectUnspecified()
48
    {
49
        $validator = Validate::object(false);
50
51
        $this->assertFalse($validator->isAllowUnspecified());
52
    }
53
}
54