diff --git a/tests/TestCase.php b/tests/TestCase.php index 7587d89..19d0ac9 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -15,8 +15,6 @@ namespace ip2region\Tests; -use ip2region\XdbSearcher; - class TestCase extends \PHPUnit\Framework\TestCase { public static function now() @@ -24,24 +22,4 @@ class TestCase extends \PHPUnit\Framework\TestCase return microtime(true) * 1000; } - public function test() - { - $ip = '1.2.3.4'; - $xdb = './ip2region.xdb'; - try { - // 1、加载整个 xdb 到内存。 - $cBuff = XdbSearcher::loadContentFromFile($xdb); - if (null === $cBuff) { - throw new \RuntimeException("failed to load content buffer from '$xdb'"); - } - // 2、使用全局的 cBuff 创建带完全基于内存的查询对象。 - $searcher = XdbSearcher::newWithBuffer($cBuff); - // 3、查询 - $region = $searcher->search($ip); - var_dump($region); - } catch (\Exception $e) { - var_dump($e->getMessage()); - } - } - }