1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-24 03:54:10 +01:00
php-phpbb/tests/network/checkdnsrr_test.php
Erik Frèrejean 14891cdf4e [ticket/10011] Tests don't work on PHP < 5.3
Due to the usage of `__DIR__` for the file includes the tests can't
be ran on systems with PHP < 5.3. Replace all occurances of
`__DIR__` with `dirname(__FILE__)`.

PHPBB3-10011
2011-01-31 12:58:18 +01:00

66 lines
1.4 KiB
PHP

<?php
/**
*
* @package testing
* @copyright (c) 2010 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
/**
* @group slow
*/
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));
}
}