CodeExplorer warn example
class ErrorCollectionTest extends TestCase
{ public function testErrorTypes(): void
{ $errors =
new ErrorCollection([ TestError::
error(),
TestError::
error(),
TestError::
error(),
TestError::
error(),
TestError::
warn(),
TestError::
warn(),
TestError::
warn(),
TestError::
notice(),
TestError::
notice(),
TestError::
unknown(),
]);
static::
assertCount(4,
$errors->
getErrors());
static::
assertCount(3,
$errors->
getWarnings());
static::
assertCount(2,
$errors->
getNotices());
static::
assertCount(1,
$errors->
filterByErrorLevel(TestError::LEVEL_UNKNOWN
));