11<?php
22
33use PHPHtmlParser \Dom \MockNode as Node ;
4+ use PHPHtmlParser \Exceptions \ChildNotFoundException ;
5+ use PHPHtmlParser \Exceptions \ParentNotFoundException ;
6+ use PHPUnit \Framework \TestCase ;
47
5- class NodeChildTest extends PHPUnit_Framework_TestCase {
8+ class NodeChildTest extends TestCase {
69
710 public function testGetParent ()
811 {
@@ -32,22 +35,20 @@ public function testNextSibling()
3235 $ this ->assertEquals ($ child2 ->id (), $ child ->nextSibling ()->id ());
3336 }
3437
35- /**
36- * @expectedException PHPHtmlParser\Exceptions\ChildNotFoundException
37- */
3838 public function testNextSiblingNotFound ()
3939 {
40+ $ this ->expectException (ChildNotFoundException::class);
41+
4042 $ parent = new Node ;
4143 $ child = new Node ;
4244 $ child ->setParent ($ parent );
4345 $ child ->nextSibling ();
4446 }
4547
46- /**
47- * @expectedException PHPHtmlParser\Exceptions\ParentNotFoundException
48- */
4948 public function testNextSiblingNoParent ()
5049 {
50+ $ this ->expectException (ParentNotFoundException::class);
51+
5152 $ child = new Node ;
5253 $ child ->nextSibling ();
5354 }
@@ -62,22 +63,20 @@ public function testPreviousSibling()
6263 $ this ->assertEquals ($ child ->id (), $ child2 ->previousSibling ()->id ());
6364 }
6465
65- /**
66- * @expectedException PHPHtmlParser\Exceptions\ChildNotFoundException
67- */
6866 public function testPreviousSiblingNotFound ()
6967 {
68+ $ this ->expectException (ChildNotFoundException::class);
69+
7070 $ parent = new Node ;
7171 $ node = new Node ;
7272 $ node ->setParent ($ parent );
7373 $ node ->previousSibling ();
7474 }
7575
76- /**
77- * @expectedException PHPHtmlParser\Exceptions\ParentNotFoundException
78- */
7976 public function testPreviousSiblingNoParent ()
8077 {
78+ $ this ->expectException (ParentNotFoundException::class);
79+
8180 $ child = new Node ;
8281 $ child ->previousSibling ();
8382 }
0 commit comments