D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
cpanel
/
ea-php83
/
root
/
usr
/
share
/
tests
/
pear
/
Validate
/
tests
/
Filename :
uri_domaincheck.phpt
back
Copy
--TEST-- domaincheck.phpt: Unit tests for uri validation with dns check --SKIPIF-- <?php if (!function_exists('checkdnsrr') || !checkdnsrr('php.net', 'A')) { echo 'skip Missing checkdnsrr()'; } ?> --FILE-- <?php // $Id: $ // Validate test script $noYes = array('NO', 'YES'); require 'Validate.php'; echo "Test Validate::uri()\n"; $uris = array( // Try dns lookup array('//php.net', 'domain_check' => true), // OK array('//example.gor', 'domain_check' => true), // NOK // Try schemes lookup array('http://php.net', 'allowed_schemes' => array('ftp', 'http'), 'domain_check' => true) // OK ); foreach ($uris as $uri) { if (is_array($uri)) { $options = $uri; unset($options[0]); echo "{$uri[0]}: schemes(" . (isset($options['allowed_schemes']) ? implode(',', $options['allowed_schemes']) : '') .") with". (isset($options['domain_check']) && $options['domain_check'] ? '' : 'out') . ' domain check : '. (isset($options['strict']) ? "(strict : {$options['strict']}) " : '') . $noYes[Validate::uri($uri[0], $options )]."\n"; } else { echo "{$uri}: ". $noYes[Validate::uri($uri)]."\n"; } } ?> --EXPECT-- Test Validate::uri() //php.net: schemes() with domain check : YES //example.gor: schemes() with domain check : NO http://php.net: schemes(ftp,http) with domain check : YES
Name
Size
Last Modified
Owner
Permissions
Actions
email.phpt
4.563
KB
May 20 2024 4:33:40
root
0644
email_domaincheck.phpt
1.331
KB
May 20 2024 4:33:40
root
0644
multicard.phpt
1.669
KB
May 20 2024 4:33:40
root
0644
multiple.phpt
1.436
KB
May 20 2024 4:33:40
root
0644
number.phpt
1.497
KB
May 20 2024 4:33:40
root
0644
testdate.phpt
3.059
KB
May 20 2024 4:33:40
root
0644
testdate_minmax.phpt
1.664
KB
May 20 2024 4:33:40
root
0644
uri.phpt
3.375
KB
May 20 2024 4:33:40
root
0644
uri_domaincheck.phpt
1.469
KB
May 20 2024 4:33:40
root
0644
2017 © D7net | D704T team