diff --git a/tests/FunctionsTest.php b/tests/FunctionsTest.php index b37f3f4..7635f2e 100644 --- a/tests/FunctionsTest.php +++ b/tests/FunctionsTest.php @@ -3,6 +3,7 @@ namespace ipl\Tests\Stdlib; use ArrayIterator; +use InvalidArgumentException; use stdClass; use ipl\Stdlib; @@ -54,11 +55,10 @@ public function testArrayvalWithTraversable() $this->assertSame($array, Stdlib\arrayval($traversable)); } - /** - * @expectedException \InvalidArgumentException - */ public function testArrayvalException() { + $this->expectException(InvalidArgumentException::class); + Stdlib\arrayval(null); } diff --git a/tests/PropertiesTest.php b/tests/PropertiesTest.php index 2577edd..73b0d04 100644 --- a/tests/PropertiesTest.php +++ b/tests/PropertiesTest.php @@ -6,23 +6,21 @@ class PropertiesTest extends \PHPUnit\Framework\TestCase { - /** - * @expectedException OutOfBoundsException - */ public function testGetPropertyThrowsOutOfBoundsExceptionIfUnset() { $subject = new TestClassUsingThePropertiesTrait(); + $this->expectException(OutOfBoundsException::class); + $subject->foo; } - /** - * @expectedException OutOfBoundsException - */ public function testArrayAccessThrowsOutOfBoundsExceptionIfUnset() { $subject = new TestClassUsingThePropertiesTrait(); + $this->expectException(OutOfBoundsException::class); + $subject['foo']; }