diff options
| author | Andreas Fischer <bantu@phpbb.com> | 2010-05-14 03:57:17 +0200 |
|---|---|---|
| committer | Andreas Fischer <bantu@phpbb.com> | 2010-08-03 10:50:41 +0200 |
| commit | 4707b0c18e314e3a2a4d58f942d77ff849fb4d3f (patch) | |
| tree | 5f76ae0377210cf478b410417797586e1aae9369 /tests/network/checkdnsrr.php | |
| parent | 3e111bb41ad6a2ea954dd52bcf78b954114c37e9 (diff) | |
| download | forums-4707b0c18e314e3a2a4d58f942d77ff849fb4d3f.tar forums-4707b0c18e314e3a2a4d58f942d77ff849fb4d3f.tar.gz forums-4707b0c18e314e3a2a4d58f942d77ff849fb4d3f.tar.bz2 forums-4707b0c18e314e3a2a4d58f942d77ff849fb4d3f.tar.xz forums-4707b0c18e314e3a2a4d58f942d77ff849fb4d3f.zip | |
[ticket/9599] Adding tests for phpbb_checkdnsrr().
Tests for existing and non-existing records of the types:
MX, A, AAAA, NS, CNAME, TXT
PHPBB3-9599
Diffstat (limited to 'tests/network/checkdnsrr.php')
| -rw-r--r-- | tests/network/checkdnsrr.php | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/tests/network/checkdnsrr.php b/tests/network/checkdnsrr.php new file mode 100644 index 0000000000..57fe2761cc --- /dev/null +++ b/tests/network/checkdnsrr.php @@ -0,0 +1,63 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2010 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +require_once 'test_framework/framework.php'; +require_once '../phpBB/includes/functions.php'; + +class phpbb_network_checkdnsrr_test extends phpbb_test_case +{ + public function data_provider() + { + return array( + // Existing MX record + array('phpbb.com', 'MX', true), + + // Non-existing MX record + array('does-not-exist.phpbb.com', 'MX', false), + + // Existing A record + array('www.phpbb.com', 'A', true), + + // Non-existing A record + array('does-not-exist.phpbb.com', 'A', false), + + // Existing AAAA record + array('www.six.heise.de', 'AAAA', true), + + // Non-existing AAAA record + array('does-not-exist.phpbb.com', 'AAAA', false), + + // Existing CNAME record + array('news.cnet.com', 'CNAME', true), + + // Non-existing CNAME record + array('does-not-exist.phpbb.com', 'CNAME', false), + + // Existing NS record + array('phpbb.com', 'NS', true), + + // Non-existing NS record + array('does-not-exist', 'NS', false), + + // Existing TXT record + array('phpbb.com', 'TXT', true), + + // Non-existing TXT record + array('does-not-exist', 'TXT', false), + ); + } + + /** + * @dataProvider data_provider + */ + public function test_checkdnsrr($host, $type, $expected) + { + $this->assertEquals($expected, phpbb_checkdnsrr($host, $type)); + } +} |
