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

GanttSectionTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 35
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testCanConstruct() 0 7 1
A testPropertyAccess() 0 22 1
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
}