PropertyGraphTest.php 695 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. use Fhaculty\Graph\Graph;
  3. use Graphp\Algorithms\Property\GraphProperty;
  4. class PropertyGraphTest extends TestCase
  5. {
  6. public function testEmptyIsEdgeless()
  7. {
  8. $graph = new Graph();
  9. $alg = new GraphProperty($graph);
  10. $this->assertTrue($alg->isNull());
  11. $this->assertTrue($alg->isEdgeless());
  12. $this->assertFalse($alg->isTrivial());
  13. }
  14. public function testSingleVertexIsTrivial()
  15. {
  16. $graph = new Graph();
  17. $graph->createVertex(1);
  18. $alg = new GraphProperty($graph);
  19. $this->assertFalse($alg->isNull());
  20. $this->assertTrue($alg->isEdgeless());
  21. $this->assertTrue($alg->isTrivial());
  22. }
  23. }