@@ -14,7 +14,10 @@ class EdgeAttributesTest extends TestCase
1414 */
1515 private $ edge ;
1616
17- public function setUp ()
17+ /**
18+ * @before
19+ */
20+ public function setUpGraph ()
1821 {
1922
2023 $ graph = new Graph ();
@@ -40,61 +43,49 @@ public function testCanSetFlowBeforeCapacity()
4043 $ this ->assertEquals (null , $ this ->edge ->getCapacityRemaining ());
4144 }
4245
43- /**
44- * @expectedException RangeException
45- */
4646 public function testFlowMustNotExceedCapacity ()
4747 {
4848 $ this ->edge ->setCapacity (20 );
49+
50+ $ this ->setExpectedException ('RangeException ' );
4951 $ this ->edge ->setFlow (100 );
5052 }
5153
52- /**
53- * @expectedException RangeException
54- */
5554 public function testCapacityMustBeGreaterThanFlow ()
5655 {
5756 $ this ->edge ->setFlow (100 );
57+
58+ $ this ->setExpectedException ('RangeException ' );
5859 $ this ->edge ->setCapacity (20 );
5960 }
6061
61- /**
62- * @expectedException InvalidArgumentException
63- */
6462 public function testWeightMustBeNumeric ()
6563 {
64+ $ this ->setExpectedException ('InvalidArgumentException ' );
6665 $ this ->edge ->setWeight ("10 " );
6766 }
6867
69- /**
70- * @expectedException InvalidArgumentException
71- */
7268 public function testCapacityMustBeNumeric ()
7369 {
70+ $ this ->setExpectedException ('InvalidArgumentException ' );
7471 $ this ->edge ->setCapacity ("10 " );
7572 }
7673
77- /**
78- * @expectedException InvalidArgumentException
79- */
8074 public function testCapacityMustBePositive ()
8175 {
76+ $ this ->setExpectedException ('InvalidArgumentException ' );
8277 $ this ->edge ->setCapacity (-10 );
8378 }
8479
85- /**
86- * @expectedException InvalidArgumentException
87- */
8880 public function testFlowMustBeNumeric ()
8981 {
82+ $ this ->setExpectedException ('InvalidArgumentException ' );
9083 $ this ->edge ->setFlow ("10 " );
9184 }
9285
93- /**
94- * @expectedException InvalidArgumentException
95- */
9686 public function testFlowMustBePositive ()
9787 {
88+ $ this ->setExpectedException ('InvalidArgumentException ' );
9889 $ this ->edge ->setFlow (-10 );
9990 }
10091}
0 commit comments