Skip to content

Commit 08ce05a

Browse files
committed
PHPUnit 6
1 parent 7da0f4f commit 08ce05a

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

lib/ErrorHandler.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,10 @@ public function setLogErrors(bool $logErrors)
118118
public function logErrors() : bool
119119
{
120120
if ($this->logErrors === null) {
121-
$this->setLogErrors(! interface_exists(\PHPUnit_Framework_Test::class));
121+
$this->setLogErrors(
122+
! interface_exists(\PHPUnit_Framework_Test::class)
123+
and ! interface_exists(\PHPUnit\Framework\Test::class)
124+
);
122125
}
123126

124127
return $this->logErrors;

tests/ErrorHandlerTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66

77
use ErrorException;
88
use Slam\ErrorHandler\ErrorHandler;
9+
use PHPUnit\Framework\TestCase;
910

10-
final class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
11+
final class ErrorHandlerTest extends TestCase
1112
{
1213
private $backupErrorLog;
1314
private $errorLog;
@@ -76,7 +77,7 @@ public function testRegisterBuiltinHandlers()
7677

7778
@ $arrayPerVerificaErrori['no_exception_thrown_on_undefined_index_now'];
7879

79-
$this->setExpectedException(ErrorException::class);
80+
$this->expectException(ErrorException::class);
8081
$arrayPerVerificaErrori['undefined_index'];
8182
}
8283

0 commit comments

Comments
 (0)