@@ -283,11 +283,10 @@ public function testDeleteNode() {
283283
284284 /**
285285 * Tests deleting a node with missing values.
286- *
287- * @expectedException \InvalidArgumentException
288286 */
289287 public function testDeleteNodeInvalid () {
290288 $ node = new Node (1 , 1 );
289+ $ this ->setExpectedException (\InvalidArgumentException::class);
291290 $ this ->nestedSet ->deleteNode ($ node );
292291 }
293292
@@ -415,28 +414,25 @@ public function testAddRootNode() {
415414
416415 /**
417416 * Test table name validation, max length.
418- *
419- * @expectedException \InvalidArgumentException
420417 */
421418 public function testValidateTableNameTooLong () {
419+ $ this ->setExpectedException (\InvalidArgumentException::class);
422420 $ this ->nestedSet = new DbalNestedSet ($ this ->connection , "" );
423421 }
424422
425423 /**
426424 * Test table name validation, invalid chars.
427- *
428- * @expectedException \InvalidArgumentException
429425 */
430426 public function testValidateTableInvalidChars () {
427+ $ this ->setExpectedException (\InvalidArgumentException::class);
431428 $ this ->nestedSet = new DbalNestedSet ($ this ->connection , "Robert;)DROP TABLE students;-- " );
432429 }
433430
434431 /**
435432 * Test table name validation, first char.
436- *
437- * @expectedException \InvalidArgumentException
438433 */
439434 public function testValidateTableInvalidFirstChars () {
435+ $ this ->setExpectedException (\InvalidArgumentException::class);
440436 $ this ->nestedSet = new DbalNestedSet ($ this ->connection , "1abc " );
441437 }
442438
0 commit comments