Skip to content

Commit c3037b2

Browse files
committed
Add FunctionalTest to test both Exporter and Loader
1 parent 63e3cf1 commit c3037b2

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

tests/FunctionalTest.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
use Fhaculty\Graph\Graph;
4+
use Graphp\GraphML\Exporter;
5+
use Graphp\GraphML\Loader;
6+
7+
class FunctionalTest extends TestCase
8+
{
9+
public function testMixed()
10+
{
11+
// 1 -- 2 -> 3
12+
$graph = new Graph();
13+
$v1 = $graph->createVertex(1);
14+
$v2 = $graph->createVertex(2);
15+
$v3 = $graph->createVertex(3);
16+
$v1->createEdge($v2);
17+
$v2->createEdgeTo($v3);
18+
19+
$exporter = new Exporter();
20+
$output = $exporter->getOutput($graph);
21+
22+
$loader = new Loader();
23+
$new = $loader->loadContents($output);
24+
25+
$this->assertGraphEquals($graph, $new);
26+
}
27+
}

0 commit comments

Comments
 (0)