Added GitHub workflow file, removed Travis CI file. Changed how email DNS validation works to only check MX record.

This commit is contained in:
Euan Torano 2021-06-17 11:04:14 +01:00
parent f7e662e3c0
commit 5deb47049a
5 changed files with 78 additions and 45 deletions

73
.github/workflows/test.yml vendored Normal file
View File

@ -0,0 +1,73 @@
name: Run Tests
on: [push, pull_request]
jobs:
test:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: ['ubuntu-latest']
php-versions:
- '5.4'
- '5.5'
- '5.6'
- '7.0'
- '7.1'
- '7.2'
- '7.3'
- '7.4'
# - '8.0'
# - '8.1'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- name: Cache composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php-versions }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php-versions }}-
- name: Validate composer configuration
run: |
composer validate
- name: Install dependencies
run: |
composer install --no-progress
- name: Run tests
run: |
composer run-script test
# test-hhvm:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: Setup HHVM
# uses: azjezz/setup-hhvm@v1
# with:
# version: latest
# debug: false
# - name: Cache composer packages
# id: composer-cache
# uses: actions/cache@v2
# with:
# path: vendor
# key: ${{ runner.os }}-hhvm-${{ hashFiles('**/composer.lock') }}
# restore-keys: |
# ${{ runner.os }}-hhvm-
# - name: Validate composer configuration
# run: |
# composer validate
# - name: Install dependencies
# run: |
# composer install --no-progress
# - name: Run tests
# run: |
# composer run-script test

View File

@ -1,32 +0,0 @@
#see https://travis-ci.community/t/php-5-4-and-5-5-archives-missing/3723
dist: trusty
# see http://about.travis-ci.org/docs/user/languages/php/ for more hints
language: php
# list any PHP version you want to test against
php:
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- 7.4
- nightly
- hhvm
matrix:
allow_failures:
- php: hhvm
- php: nightly
include:
- php: 5.3
dist: precise
before_script:
- composer install
# Script to run tests
script: composer test

View File

@ -3,20 +3,20 @@
"type": "library",
"description": "Simple, elegant, stand-alone validation library with NO dependencies",
"keywords": ["validation", "validator", "valid"],
"homepage": "http://github.com/vlucas/valitron",
"homepage": "https://github.com/vlucas/valitron",
"license": "BSD-3-Clause",
"authors": [
{
"name": "Vance Lucas",
"email": "vance@vancelucas.com",
"homepage": "http://www.vancelucas.com"
"homepage": "https://www.vancelucas.com"
}
],
"require": {
"php": ">=5.3.2"
},
"require-dev": {
"phpunit/phpunit": "^4.8.35 || ^5.5 || ^6.5"
"phpunit/phpunit": ">=4.8.35 <8"
},
"suggest": {
"ext-mbstring": "It can support the multiple bytes string length."

View File

@ -7,7 +7,6 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="tests/bootstrap.php"
>
<testsuites>
@ -15,12 +14,4 @@
<directory suffix="Test.php">tests/Valitron</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
</whitelist>
<blacklist>
<directory suffix=".php">vendor/</directory>
</blacklist>
</filter>
</phpunit>

View File

@ -627,7 +627,8 @@ class Validator
if (function_exists('idn_to_ascii') && defined('INTL_IDNA_VARIANT_UTS46')) {
$domain = idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46);
}
return checkdnsrr($domain, 'ANY');
return checkdnsrr($domain, 'MX');
}
return false;