mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Remove setExpectedException wrapper
This commit is contained in:
parent
32dcb93f24
commit
6ed3aeb343
44 changed files with 98 additions and 101 deletions
|
@ -37,9 +37,11 @@ class ErrorHandlerTest extends TestCase
|
|||
public function testErrorHandlerCaptureNotice()
|
||||
{
|
||||
if (PHP_VERSION_ID >= 80000) {
|
||||
$this->setExpectedException('\ErrorException', 'Undefined array key "baz"');
|
||||
self::expectException('\ErrorException');
|
||||
self::expectExceptionMessage('Undefined array key "baz"');
|
||||
} else {
|
||||
$this->setExpectedException('\ErrorException', 'Undefined index: baz');
|
||||
self::expectException('\ErrorException');
|
||||
self::expectExceptionMessage('Undefined index: baz');
|
||||
}
|
||||
|
||||
$array = array('foo' => 'bar');
|
||||
|
@ -53,9 +55,11 @@ class ErrorHandlerTest extends TestCase
|
|||
public function testErrorHandlerCaptureWarning()
|
||||
{
|
||||
if (PHP_VERSION_ID >= 80000) {
|
||||
$this->setExpectedException('TypeError', 'array_merge');
|
||||
self::expectException('TypeError');
|
||||
self::expectExceptionMessage('array_merge');
|
||||
} else {
|
||||
$this->setExpectedException('ErrorException', 'array_merge');
|
||||
self::expectException('ErrorException');
|
||||
self::expectExceptionMessage('array_merge');
|
||||
}
|
||||
|
||||
// @phpstan-ignore-next-line
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue