Skip to content

Commit fcb8b98

Browse files
committed
Increase code coverage.
1 parent 6fafadb commit fcb8b98

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

spec/drupol/phptree/tests/TestGraphVizSpec.php

+22
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,28 @@ public function it_is_initializable()
2424
$this->shouldHaveType(TestGraphViz::class);
2525
}
2626

27+
public function it_can_generate_a_graph()
28+
{
29+
$visitor = new BreadthFirstVisitor();
30+
$graph = new Graph();
31+
$graphviz = new GraphViz();
32+
33+
$this->beConstructedWith($visitor, $graph, $graphviz);
34+
35+
$tree = new ValueNode('root', 2);
36+
37+
$nodes = [];
38+
foreach (\range('A', 'F') as $letter) {
39+
$nodes[] = new ValueNode($letter, 2);
40+
}
41+
42+
$tree->add(...$nodes);
43+
44+
$this
45+
->getGraph($tree)
46+
->shouldReturnAnInstanceOf(Graph::class);
47+
}
48+
2749
public function it_can_create_a_graph()
2850
{
2951
$visitor = new BreadthFirstVisitor();

0 commit comments

Comments
 (0)