NotificationTest::testSetCreated()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 2 Features 1
Metric Value
cc 1
eloc 8
c 2
b 2
f 1
nc 1
nop 0
dl 0
loc 14
rs 10
1
<?php
2
3
namespace Azine\EmailBundle\Tests\Entity;
4
5
use Azine\EmailBundle\Entity\Notification;
6
7
class NotificationTest extends \PHPUnit\Framework\TestCase
8
{
9
    public function testSetCreated()
10
    {
11
        $n = new Notification();
12
        $c1 = $n->getCreated();
13
14
        $n->setCreatedValue();
15
16
        $c2 = $n->getCreated();
17
18
        sleep(1);
19
20
        $this->assertNull($c1);
21
        $this->assertNotNull($c2);
22
        $this->assertGreaterThanOrEqual($c2, new \DateTime());
23
    }
24
}
25