BaseValidatorTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 33
rs 10
c 1
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A itShouldAssertFalse() 0 5 1
A itShouldAssertTrue() 0 5 1
1
<?php
2
/**
3
 * Author: Nil Portugués Calderó <[email protected]>
4
 * Date: 12/30/14
5
 * Time: 1:15 AM
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Tests\NilPortugues\Validator;
12
13
/**
14
 * Class BaseValidatorTest
15
 * @package Tests\NilPortugues\Validator
16
 */
17
class BaseValidatorTest extends \PHPUnit_Framework_TestCase
18
{
19
    /**
20
     * @var DummyValidator
21
     */
22
    protected $validator;
23
24
    /**
25
     *
26
     */
27
    protected function setUp()
28
    {
29
        $this->validator = new DummyValidator();
30
    }
31
32
    /**
33
     * @test
34
     */
35
    public function itShouldAssertFalse()
36
    {
37
        $this->assertFalse($this->validator->validate('email', 'not-an-email'));
38
        $this->assertNotEmpty($this->validator->getErrors());
39
    }
40
41
    /**
42
     * @test
43
     */
44
    public function itShouldAssertTrue()
45
    {
46
        $this->assertTrue($this->validator->validate('email', '[email protected]'));
47
        $this->assertEmpty($this->validator->getErrors());
48
    }
49
}
50