Completed
Push — develop ( 8a0cb6...d5d9d0 )
by Tom
04:26
created

JUnitSessionTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A creation() 0 14 1
1
<?php
2
/*
3
 * @author Tom Klingenberg <https://github.com/ktomk>
4
 */
5
6
namespace N98\Util;
7
8
use N98\JUnitXml\Document;
9
10
/**
11
 * Class JUnitSessionTest
12
 *
13
 * @package N98\Util
14
 * @covers N98\Util\JUnitSession
15
 */
16
class JUnitSessionTest extends \PHPUnit_Framework_TestCase
17
{
18
    /**
19
     * @test
20
     */
21
    public function creation()
22
    {
23
        $session = new JUnitSession("name");
24
        $this->assertInstanceOf(JUnitSession::class, $session);
25
        $this->assertSame('name', $session->getName());
26
        $this->assertSame(0, $session->save(null));
27
        $document = $session->getDocument();
28
        $this->assertInstanceOf(Document::class, $document);
29
        $this->assertSame($document, $session->getDocument());
30
        $this->assertFalse(@$session->save(null));
31
        $this->assertNotNull($session->addTestSuite());
32
        usleep(1000);
33
        $this->assertGreaterThan(0.001, $session->getDuration());
34
    }
35
}
36