Skip to content

Commit 4324809

Browse files
authored
Convert annotations to calling ->setExpectedException (#10)
1 parent b87be8e commit 4324809

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

tests/Functional/DbalNestedSetTest.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)