Skip to content

Commit 702c7d7

Browse files
committed
Changes the test to leverage failing on warnings.
Signed-off-by: Alexandre Lemaire <saeven@saeven.net>
1 parent 1768e71 commit 702c7d7

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

phpunit.xml.dist

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
bootstrap="./vendor/autoload.php"
55
beStrictAboutOutputDuringTests="true"
66
beStrictAboutTestsThatDoNotTestAnything="true"
7+
failOnWarning="true"
78
colors="true">
89
<testsuites>
910
<testsuite name="laminas-validator Test Suite">

test/EmailAddressTest.php

+1-12
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@
1818
use function implode;
1919
use function next;
2020
use function preg_replace;
21-
use function restore_error_handler;
2221
use function set_error_handler;
2322
use function sprintf;
2423
use function str_repeat;
2524
use function strstr;
2625

2726
use const E_USER_NOTICE;
28-
use const E_WARNING;
2927

3028
/**
3129
* @group Laminas_Validator
@@ -934,15 +932,6 @@ public function testWillNotCheckEmptyDeepMxChecks(): void
934932
'useDeepMxCheck' => true,
935933
]);
936934

937-
$called = false;
938-
/** @psalm-suppress InvalidArgument **/
939-
set_error_handler(static function () use (&$called) {
940-
$called = true;
941-
}, E_WARNING);
942-
943-
$validator->isValid('jon@example.com');
944-
945-
restore_error_handler();
946-
$this->assertFalse($called);
935+
$this->assertFalse($validator->isValid('jon@example.com'));
947936
}
948937
}

0 commit comments

Comments
 (0)