-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
type/enhancementA new idea that should be implementedA new idea that should be implemented
Milestone
Description
The following methods should be added to TestCase:
expectDeprecation()forE_DEPRECATEDandE_USER_DEPRECATEDexpectNotice()forE_NOTICE,E_USER_NOTICE, andE_STRICTexpectWarning()forE_WARNINGandE_USER_WARNINGexpectError()for everything else
Then
<?php declare(strict_types=1);
use PHPUnit\Framework\TestCase;
final class Test extends TestCase
{
public function testOne()
{
$this->expectNotice();
$a = $b;
}
}can be used instead of
<?php declare(strict_types=1);
use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\Error\Notice;
final class Test extends TestCase
{
public function testOne()
{
$this->expectException(Notice::class);
$a = $b;
}
}to expect the code to trigger an E_NOTICE, for instance.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type/enhancementA new idea that should be implementedA new idea that should be implemented