DateUtilTest::testIsValidDateFalse()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 9
rs 10
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
    public function testIsValidDate()
20
    {
21
        $response = $this->dateUtil->isValid('10/10/1994');
22
23
        $this->assertTrue($response);
24
    }
25
26
    public function testIsValidDateFalse()
27
    {
28
        $response = $this->dateUtil->isValid('1994/10/39');
29
30
        $this->assertFalse($response);
31
32
        $response = $this->dateUtil->isValid('40/40/1900');
33
34
        $this->assertFalse($response);
35
    }
36
}
37