Skip to content

Commit 8134c61

Browse files
author
Christian Lück
committed
Add tests for Algorithm\Directed (100% coverage)
1 parent fdafb56 commit 8134c61

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

tests/DirectedTest.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ public function testGraphEmpty()
1111

1212
$alg = new AlgorithmDirected($graph);
1313

14-
$this->assertFalse($alg->isDirected());
14+
$this->assertFalse($alg->hasDirected());
15+
$this->assertFalse($alg->hasUndirected());
16+
$this->assertFalse($alg->isMixed());
1517
}
1618

1719
public function testGraphUndirected()
@@ -22,7 +24,9 @@ public function testGraphUndirected()
2224

2325
$alg = new AlgorithmDirected($graph);
2426

25-
$this->assertFalse($alg->isDirected());
27+
$this->assertFalse($alg->hasDirected());
28+
$this->assertTrue($alg->hasUndirected());
29+
$this->assertFalse($alg->isMixed());
2630
}
2731

2832
public function testGraphDirected()
@@ -33,7 +37,9 @@ public function testGraphDirected()
3337

3438
$alg = new AlgorithmDirected($graph);
3539

36-
$this->assertTrue($alg->isDirected());
40+
$this->assertTrue($alg->hasDirected());
41+
$this->assertFalse($alg->hasUndirected());
42+
$this->assertFalse($alg->isMixed());
3743
}
3844

3945
public function testGraphMixed()
@@ -45,6 +51,8 @@ public function testGraphMixed()
4551

4652
$alg = new AlgorithmDirected($graph);
4753

48-
$this->assertTrue($alg->isDirected());
54+
$this->assertTrue($alg->hasDirected());
55+
$this->assertTrue($alg->hasUndirected());
56+
$this->assertTrue($alg->isMixed());
4957
}
5058
}

0 commit comments

Comments
 (0)