Skip to content

Commit 4016d9f

Browse files
authored
Merge pull request #6 from sirn-se/v1.1
v1.1 ready
2 parents 1d37592 + 6087b1c commit 4016d9f

File tree

4 files changed

+9
-17
lines changed

4 files changed

+9
-17
lines changed

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
],
1515
"autoload": {
1616
"psr-4": {
17-
"": "src/"
17+
"Phrity\\Util\\": "src/"
1818
}
1919
},
2020
"autoload-dev": {
2121
"psr-4": {
22-
"": "tests/"
22+
"Phrity\\Util\\Tests\\": "tests/"
2323
}
2424
},
2525
"require": {

phpunit.xml.dist

+6-6
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 src/ErrorHandler.php

+1-1
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

-8
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)