Skip to content

Commit 2aadb35

Browse files
committed
v1.1
1 parent 1d37592 commit 2aadb35

File tree

3 files changed

+7
-15
lines changed

3 files changed

+7
-15
lines changed

phpunit.xml.dist

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" bootstrap="vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
3-
<coverage>
4-
<include>
5-
<directory suffix=".php">./src/</directory>
6-
</include>
7-
</coverage>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" bootstrap="vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.0/phpunit.xsd">
83
<testsuites>
94
<testsuite name="Phrity Util/Accessor tests">
105
<directory>./tests/</directory>
116
</testsuite>
127
</testsuites>
8+
<source>
9+
<include>
10+
<directory suffix=".php">./src/</directory>
11+
</include>
12+
</source>
1313
</phpunit>

src/Phrity/Util/ErrorHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ public function withAll(callable $callback, $handling = null, int $levels = E_AL
8383
$errors[] = $e;
8484
}, $levels);
8585
$result = $callback();
86-
$error = empty($errors) ? null : $this->handle($handling, $errors, $result);
8786
$this->restore();
87+
$error = empty($errors) ? null : $this->handle($handling, $errors, $result);
8888
return $error ?: $result;
8989
}
9090

tests/ErrorHandlerTest.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ public function testSetNull(): void
4242
$this->assertNull($e->getPrevious());
4343
}
4444

45-
// Verify that exception is thrown
46-
$this->expectException('ErrorException');
47-
trigger_error('Another error');
48-
4945
// Restore handler
5046
$this->assertTrue($handler->restore());
5147
}
@@ -69,10 +65,6 @@ public function testSetThrowable(): void
6965
$this->assertNull($prev->getPrevious());
7066
}
7167

72-
// Verify that exception is thrown
73-
$this->expectException('RuntimeException');
74-
trigger_error('Another error');
75-
7668
// Restore handler
7769
$this->assertTrue($handler->restore());
7870
}

0 commit comments

Comments
 (0)