Skip to content

Commit 0b2d8e8

Browse files
committed
Code enhancements.
1 parent bf205bb commit 0b2d8e8

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

test/FallenExceptionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function testName(): void
2323
{
2424
self::assertStringContainsString('foo', $e->getMessage());
2525
self::assertStringContainsString('bar', $e->getMessage());
26-
self::assertInstanceOf('\RuntimeException', $e);
26+
self::assertInstanceOf(\RuntimeException::class, $e);
2727
}
2828
}
2929

test/FormattedExceptionTestBase.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,18 @@
1414
class FormattedExceptionTestBase extends TestCase
1515
{
1616
//--------------------------------------------------------------------------------------------------------------------
17+
/**
18+
* The class being tested.
19+
*
20+
* @var string
21+
*/
1722
static $class;
1823

24+
/**
25+
* The name of the exception.
26+
*
27+
* @var string
28+
*/
1929
static $name;
2030

2131
//--------------------------------------------------------------------------------------------------------------------

test/LogicFormattedExceptionTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
namespace SetBased\Exception\Test;
55

6+
use SetBased\Exception\LogicException;
7+
68
/**
79
* Test case for class LogicException.
810
*/
@@ -13,7 +15,7 @@ public function setUp(): void
1315
{
1416
parent::setUp();
1517

16-
self::$class = '\SetBased\Exception\LogicException';
18+
self::$class = LogicException::class;
1719
self::$name = 'Programming Error';
1820
}
1921

test/RuntimeFormattedExceptionTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
namespace SetBased\Exception\Test;
55

6+
use SetBased\Exception\RuntimeException;
7+
68
/**
79
* Test cases for class RuntimeException.
810
*/
@@ -13,7 +15,7 @@ public function setUp(): void
1315
{
1416
parent::setUp();
1517

16-
self::$class = '\SetBased\Exception\RuntimeException';
18+
self::$class = RuntimeException::class;
1719
self::$name = 'Error';
1820
}
1921

0 commit comments

Comments
 (0)