mirror of
https://github.com/egulias/EmailValidator.git
synced 2026-08-28 11:07:55 +00:00
chore: update phpunit 9 = 10 and psalm 4 = 5 (#368)
Co-authored-by: Christopher Georg <christopher.georg@sr-travel.de>
This commit is contained in:
+2
-2
@@ -18,8 +18,8 @@
|
||||
"symfony/polyfill-intl-idn": "^1.26"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^9.5.27",
|
||||
"vimeo/psalm": "^4.30"
|
||||
"phpunit/phpunit": "^10.2",
|
||||
"vimeo/psalm": "^5.12"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation"
|
||||
|
||||
+19
-9
@@ -1,17 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" backupGlobals="false" backupStaticAttributes="false" bootstrap="vendor/autoload.php" colors="true" convertDeprecationsToExceptions="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" executionOrder="defects" processIsolation="false" stopOnFailure="false">
|
||||
<coverage>
|
||||
<include>
|
||||
<directory>./src/</directory>
|
||||
</include>
|
||||
<exclude>
|
||||
<directory suffix=".php">./src/Result/Reason</directory>
|
||||
</exclude>
|
||||
</coverage>
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
|
||||
bootstrap="vendor/autoload.php"
|
||||
colors="true"
|
||||
executionOrder="defects"
|
||||
cacheDirectory=".phpunit.cache"
|
||||
>
|
||||
<coverage/>
|
||||
|
||||
<testsuites>
|
||||
<testsuite name="EmailValidator Test Suite">
|
||||
<directory>./tests/EmailValidator</directory>
|
||||
<exclude>./vendor/</exclude>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
<source>
|
||||
<include>
|
||||
<directory>./src/</directory>
|
||||
</include>
|
||||
<exclude>
|
||||
<directory suffix=".php">./src/Result/Reason</directory>
|
||||
</exclude>
|
||||
</source>
|
||||
|
||||
</phpunit>
|
||||
|
||||
@@ -51,11 +51,11 @@ class EmailLexerTest extends TestCase
|
||||
$this->assertEquals(EmailLexer::INVALID, $lexer->current->type);
|
||||
}
|
||||
|
||||
public function invalidUTF8CharsProvider()
|
||||
public static function invalidUTF8CharsProvider()
|
||||
{
|
||||
$chars = array();
|
||||
for ($i = 0; $i < 0x100; ++$i) {
|
||||
$c = $this->utf8Chr($i);
|
||||
$c = self::utf8Chr($i);
|
||||
if (preg_match('/(?=\p{Cc})(?=[^\t\n\n\r])/u', $c) && !preg_match('/\x{0000}/u', $c)) {
|
||||
$chars[] = array($c);
|
||||
}
|
||||
@@ -64,7 +64,7 @@ class EmailLexerTest extends TestCase
|
||||
return $chars;
|
||||
}
|
||||
|
||||
protected function utf8Chr($code_point)
|
||||
protected static function utf8Chr($code_point)
|
||||
{
|
||||
|
||||
if ($code_point < 0 || 0x10FFFF < $code_point || (0xD800 <= $code_point && $code_point <= 0xDFFF)) {
|
||||
@@ -123,7 +123,7 @@ class EmailLexerTest extends TestCase
|
||||
$this->assertTrue($lexer->find(EmailLexer::S_HTAB));
|
||||
}
|
||||
|
||||
public function getTokens()
|
||||
public static function getTokens()
|
||||
{
|
||||
return array(
|
||||
array("foo", EmailLexer::GENERIC),
|
||||
|
||||
@@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase;
|
||||
|
||||
class EmailParserTest extends TestCase
|
||||
{
|
||||
public function emailPartsProvider()
|
||||
public static function emailPartsProvider()
|
||||
{
|
||||
return [
|
||||
['test@foo.com', 'test', 'foo.com'],
|
||||
|
||||
@@ -16,7 +16,7 @@ use PHPUnit\Framework\TestCase;
|
||||
|
||||
class DNSCheckValidationTest extends TestCase
|
||||
{
|
||||
public function validEmailsProvider()
|
||||
public static function validEmailsProvider()
|
||||
{
|
||||
return [
|
||||
// dot-atom
|
||||
@@ -37,7 +37,7 @@ class DNSCheckValidationTest extends TestCase
|
||||
];
|
||||
}
|
||||
|
||||
public function localOrReservedEmailsProvider()
|
||||
public static function localOrReservedEmailsProvider()
|
||||
{
|
||||
return [
|
||||
// Reserved Top Level DNS Names
|
||||
|
||||
@@ -25,7 +25,7 @@ class SpoofCheckValidationTest extends TestCase
|
||||
$this->assertFalse($validation->isValid("Кириллица"."latin漢字"."ひらがな"."カタカナ", new EmailLexer()));
|
||||
}
|
||||
|
||||
public function validUTF8EmailsProvider()
|
||||
public static function validUTF8EmailsProvider()
|
||||
{
|
||||
return [
|
||||
// Cyrillic
|
||||
|
||||
@@ -19,7 +19,7 @@ class MessageIDValidationTest extends TestCase
|
||||
$this->assertTrue($validator->isValid($messageID, new EmailLexer()));
|
||||
}
|
||||
|
||||
public function validMessageIDs() : array
|
||||
public static function validMessageIDs() : array
|
||||
{
|
||||
return [
|
||||
['a@b.c+&%$.d'],
|
||||
@@ -38,7 +38,7 @@ class MessageIDValidationTest extends TestCase
|
||||
$this->assertFalse($validator->isValid($messageID, new EmailLexer()));
|
||||
}
|
||||
|
||||
public function invalidMessageIDs() : array
|
||||
public static function invalidMessageIDs() : array
|
||||
{
|
||||
return [
|
||||
['example'],
|
||||
|
||||
@@ -38,7 +38,7 @@ class NoRFCWarningsValidationTest extends TestCase
|
||||
$this->assertNull($validation->getError());
|
||||
}
|
||||
|
||||
public function getValidEmailsWithoutWarnings()
|
||||
public static function getValidEmailsWithoutWarnings()
|
||||
{
|
||||
return [
|
||||
['example@example.com',],
|
||||
|
||||
@@ -62,7 +62,7 @@ class RFCValidationDomainPartTest extends TestCase
|
||||
$this->assertTrue($this->validator->isValid($email, $this->lexer));
|
||||
}
|
||||
|
||||
public function getValidEmails()
|
||||
public static function getValidEmails()
|
||||
{
|
||||
return array(
|
||||
['fabien@symfony.com'],
|
||||
@@ -88,7 +88,7 @@ class RFCValidationDomainPartTest extends TestCase
|
||||
$this->assertFalse($this->validator->isValid($email, $this->lexer));
|
||||
}
|
||||
|
||||
public function getInvalidEmails()
|
||||
public static function getInvalidEmails()
|
||||
{
|
||||
return [
|
||||
['test@example.com test'],
|
||||
@@ -161,7 +161,7 @@ class RFCValidationDomainPartTest extends TestCase
|
||||
$this->assertEquals($error, $this->validator->getError());
|
||||
}
|
||||
|
||||
public function getInvalidEmailsWithErrors()
|
||||
public static function getInvalidEmailsWithErrors()
|
||||
{
|
||||
return [
|
||||
[new InvalidEmail(new NoDomainPart(), ''), 'example@'],
|
||||
@@ -203,7 +203,7 @@ class RFCValidationDomainPartTest extends TestCase
|
||||
}
|
||||
}
|
||||
|
||||
public function getValidEmailsWithWarnings()
|
||||
public static function getValidEmailsWithWarnings()
|
||||
{
|
||||
return [
|
||||
//Check if this is actually possible
|
||||
@@ -232,7 +232,7 @@ class RFCValidationDomainPartTest extends TestCase
|
||||
];
|
||||
}
|
||||
|
||||
public function invalidUTF16Chars()
|
||||
public static function invalidUTF16Chars()
|
||||
{
|
||||
return [
|
||||
['example@symƒony.com'],
|
||||
|
||||
@@ -54,7 +54,7 @@ class RFCValidationTest extends TestCase
|
||||
$this->assertTrue($this->validator->isValid($email, $this->lexer));
|
||||
}
|
||||
|
||||
public function getValidEmails()
|
||||
public static function getValidEmails()
|
||||
{
|
||||
return array(
|
||||
['â@iana.org'],
|
||||
@@ -91,7 +91,7 @@ class RFCValidationTest extends TestCase
|
||||
$this->assertEquals($expectedWarnings, $this->validator->getWarnings());
|
||||
}
|
||||
|
||||
public function getValidEmailsWithWarnings()
|
||||
public static function getValidEmailsWithWarnings()
|
||||
{
|
||||
return [
|
||||
['a5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@example.com', [new LocalTooLong()]],
|
||||
@@ -120,7 +120,7 @@ class RFCValidationTest extends TestCase
|
||||
$this->assertFalse($this->validator->isValid($email, $this->lexer));
|
||||
}
|
||||
|
||||
public function getInvalidEmails()
|
||||
public static function getInvalidEmails()
|
||||
{
|
||||
return [
|
||||
['user name@example.com'],
|
||||
@@ -164,7 +164,7 @@ class RFCValidationTest extends TestCase
|
||||
$this->assertEquals($error, $this->validator->getError());
|
||||
}
|
||||
|
||||
public function getInvalidEmailsWithErrors()
|
||||
public static function getInvalidEmailsWithErrors()
|
||||
{
|
||||
return [
|
||||
[new InvalidEmail(new NoLocalPart(), "@"), '@example.co.uk'],
|
||||
|
||||
Reference in New Issue
Block a user