Skip to content

Commit ecc3afd

Browse files
committed
Improve assertions and testing class name
1 parent 1e6c5af commit ecc3afd

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

tests/FlowTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Graphp\Algorithms\Flow as AlgorithmFlow;
66
use Graphp\Graph\Graph;
77

8-
class FlowaTest extends TestCase
8+
class FlowTest extends TestCase
99
{
1010
public function testGraphEmpty()
1111
{

tests/Property/WalkPropertyTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ public function testTrivialGraph()
1616

1717
$walk = Walk::factoryFromEdges(array(), $v1);
1818

19-
$this->assertEquals(1, \count($walk->getVertices()));
20-
$this->assertEquals(0, \count($walk->getEdges()));
19+
$this->assertCount(1, $walk->getVertices());
20+
$this->assertCount(0, $walk->getEdges());
2121

2222
$alg = new WalkProperty($walk);
2323

@@ -69,8 +69,8 @@ public function testCycle()
6969

7070
$walk = Walk::factoryFromEdges(array($e1, $e2), $v1);
7171

72-
$this->assertEquals(3, \count($walk->getVertices()));
73-
$this->assertEquals(2, \count($walk->getEdges()));
72+
$this->assertCount(3, $walk->getVertices());
73+
$this->assertCount(2, $walk->getEdges());
7474

7575
$alg = new WalkProperty($walk);
7676

@@ -172,8 +172,8 @@ public function testSimplePathWithinGraph()
172172
// only use "2 -- 2" part
173173
$walk = Walk::factoryFromEdges(array($e2), $v2);
174174

175-
$this->assertEquals(2, \count($walk->getVertices()));
176-
$this->assertEquals(1, \count($walk->getEdges()));
175+
$this->assertCount(2, $walk->getVertices());
176+
$this->assertCount(1, $walk->getEdges());
177177

178178
$alg = new WalkProperty($walk);
179179

tests/Search/BreadthFirstTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use Graphp\Graph\Graph;
77
use Graphp\Tests\Algorithms\TestCase;
88

9-
class BreadthFirstSearchTest extends TestCase
9+
class BreadthFirstTest extends TestCase
1010
{
1111
public function providerMaxDepth()
1212
{
@@ -55,4 +55,4 @@ public function testMaxDepth(array $edges, $subject, $maxDepth, array $expected)
5555
}
5656
$this->assertSame($expected, $v->getIds());
5757
}
58-
}
58+
}

tests/ShortestPath/BaseShortestPathTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function testGraphCycle()
8282
$this->assertEquals($expectedWeight, $alg->getDistance($v1));
8383

8484
$walk = $alg->getWalkTo($v1);
85-
$this->assertEquals(2, \count($walk->getEdges()));
85+
$this->assertCount(2, $walk->getEdges());
8686
}
8787

8888
public function testIsolatedVertexIsNotReachable()

0 commit comments

Comments
 (0)