Use a safe way to execute dns_get_record (v3) (#286)

* #256 Bypass a PHP warning generated by @dns_get_record

The idea is to create a custom error handler for dns_get_record(), call dns_get_record and then restore the original error handler.
This way we can catch PHP warnings (e.g. "Warning: dns_get_record(): DNS Query failed" or "dns_get_record(): A temporary server error occurred." [ErrorException])

* #256 Make `UnableToGetDNSRecord` reason more testable

* #256 Suppress psalm’s false-positive error

see https://github.com/vimeo/psalm/issues/5134#issuecomment-782937791

* #256 Speed up tests: start from previously failed

* #256 Suppress psalm’s false-positive error

We don’t have a control over AbstractLexer and can’t specify array shape in this parent class
This commit is contained in:
Alies Lapatsin
2021-02-28 17:27:57 +03:00
committed by GitHub
parent 04cad1a5ec
commit 451b438902
7 changed files with 75 additions and 12 deletions
+5 -2
View File
@@ -1,14 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
executionOrder="defects"
processIsolation="false"
stopOnFailure="false"
bootstrap="vendor/autoload.php"
>
<testsuites>
<testsuite name="EmailValidator Test Suite">