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

DateUtilTest::testIsValidDate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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