Skip to content

Commit

Permalink
2. Implemented first test, to solve the algorithm
Browse files Browse the repository at this point in the history
introducing 2 needed classes, Graph and Vertex,
that have to be created, implemented and tested.
  • Loading branch information
odino committed Nov 15, 2011
1 parent a3a15f3 commit 90c8644
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tests/DijkstraTest.php
Expand Up @@ -18,9 +18,22 @@
*/

use Osidays\Algorithm\ShortestPath\Dijkstra;
use Osidays\Graph;
use Osidays\Graph\Vertex;

class DijkstraTest extends PHPUnit_Framework_TestCase
{

public function testSolvingTheAlgorithm()
{
$bengaluru = new Vertex;
$goa = new Vertex;
$pune = new Vertex;
$hyderabad = new Vertex;
$solapur = new Vertex;
$graph = new Graph(array($bengaluru, $goa, $pune));
$algorithm = new Dijkstra();

$this->assertEquals(array($bengaluru, $goa, $pune), $algorithm->solve());
}
}

0 comments on commit 90c8644

Please sign in to comment.