Completed
Pull Request — master (#467)
by
unknown
19:23
created

GanttSectionTest::testCanConstruct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Sebastian
5
 * Date: 30.01.2019
6
 * Time: 13:47
7
 */
8
9
namespace SRF\Tests\Mermaid;
10
11
use SRF\Mermaid\GanttSection;
12
13
14
class GanttSectionTest extends \PHPUnit_Framework_TestCase{
15
16
	public function testCanConstruct() {
17
18
		$this->assertInstanceOf(
19
			GanttSection::class,
20
			new GanttSection( [] )
21
		);
22
	}
23
24
	public function testPropertyAccess() {
25
26
		$instance = new GanttSection();
27
28
		$instance->setTitle('GanttSection');
29
		$this->assertEquals( $instance->getTitle(), 'GanttSection' );
30
31
		$instance->setID('mermaid-no-section#21780240');
32
		$this->assertEquals( $instance->getID(), 'mermaid-no-section#21780240' );
33
34
		$instance->setTasks( array( 'task1', 'task2' ));
35
		$this->assertEquals( $instance->getTasks(), array( 'task1', 'task2' ) );
36
37
		$instance->addTask( 'task3' );
38
		$this->assertEquals( $instance->getTasks(), array( 'task1', 'task2', 'task3' ) );
39
40
		$instance->setEarliestStartDate( '2019-02-01' );
41
		$this->assertEquals( $instance->getEarliestStartDate(), '2019-02-01' );
42
43
		$instance->setLatestEndDate( '2019-02-28' );
44
		$this->assertEquals( $instance->getLatestEndDate(), '2019-02-28' );
45
	}
46
47
48
}