Completed
Push — master ( dc30b6...cc4a0b )
by João Felipe Magro
03:10
created

DateUtilTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 10
dl 0
loc 28
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 5 1
A testIsValidDate() 0 5 1
A testIsValidDateFalse() 0 9 1
1
<?php
2
3
namespace Tests\Classes;
4
5
use Ipag\Classes\Util\DateUtil;
6
use PHPUnit\Framework\TestCase;
7
8
class DateUtilTest extends TestCase
9
{
10
    private $dateUtil;
11
12
    public function setUp()
13
    {
14
        parent::setUp();
15
16
        $this->dateUtil = new DateUtil();
17
18
    }
19
20
    public function testIsValidDate()
21
    {
22
        $response = $this->dateUtil->isValid('10/10/1994');
23
24
        $this->assertTrue($response);
25
    }
26
27
    public function testIsValidDateFalse()
28
    {
29
        $response = $this->dateUtil->isValid('1994/10/39');
30
31
        $this->assertFalse($response);
32
33
        $response = $this->dateUtil->isValid('40/40/1900');
34
35
        $this->assertFalse($response);
36
    }
37
}
38