Passed
Push — develop ( 49a79e...3c29f3 )
by Mathieu
01:43
created

ValidatorTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 12
dl 0
loc 17
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testValidateTrueFalse() 0 15 1
1
<?php
2
class ValidatorTest extends \PHPUnit\Framework\TestCase
3
{
4
    public function testValidateTrueFalse()
5
    {
6
        $test = true;
7
        $validator = new \Suricate\Validator($test);
8
9
        $validator->true("Not true");
0 ignored issues
show
Bug introduced by
The method true() does not exist on Suricate\Validator. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

9
        $validator->/** @scrutinizer ignore-call */ 
10
                    true("Not true");
Loading history...
10
        $this->assertSame(0, count($validator->getErrors()));
11
        $this->assertTrue($validator->pass());
12
        $this->assertFalse($validator->fails());
13
14
        $validator->false("Not false");
0 ignored issues
show
Bug introduced by
The method false() does not exist on Suricate\Validator. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

14
        $validator->/** @scrutinizer ignore-call */ 
15
                    false("Not false");
Loading history...
15
        $this->assertSame(1, count($validator->getErrors()));
16
        $this->assertFalse($validator->pass());
17
        $this->assertTrue($validator->fails());
18
        $this->assertSame("Not false", $validator->getErrors()[0]);
19
        
20
    }
21
}