1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-04-14 04:42:04 +02:00

[ticket/16508] Fix WhoIs lookup

PHPBB3-16508
This commit is contained in:
3D-I 2020-06-02 15:19:38 +02:00 committed by Marc Alexander
parent 642b774530
commit 481ca6190e
No known key found for this signature in database
GPG Key ID: 50E0D2423696F995

View File

@ -1,45 +0,0 @@
<?php
/**
*
* @package testing
* @copyright (c) 2020 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
class phpbb_functions_user_whois_test extends phpbb_test_case
{
protected function setUp()
{
global $config, $phpbb_dispatcher, $user, $request, $symfony_request, $phpbb_root_path, $phpEx;
$lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx);
$lang = new \phpbb\language\language($lang_loader);
$user = new \phpbb\user($lang, '\phpbb\datetime');
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
$config = new \phpbb\config\config([]);
$request = new phpbb_mock_request();
$symfony_request = new \phpbb\symfony_request($request);
}
public function ips_data()
{
return [
['2001:4860:4860::8888'], // Google public DNS
['64.233.161.139'], // google.com
];
}
/**
* @dataProvider ips_data
*/
public function test_ip_whois($ip)
{
$ip_whois = user_ipwhois($ip);
$this->assertNotContains('Query terms are ambiguous', $ip_whois);
$this->assertNotContains('no entries found', $ip_whois);
$this->assertNotContains('ERROR', $ip_whois);
}
}