Skip to content

Commit

Permalink
添加测试
Browse files Browse the repository at this point in the history
  • Loading branch information
zhichao-poper committed Dec 5, 2014
1 parent 146b47b commit f318d80
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
language: php

php:
# using major version aliases

# aliased to a recent 5.4.x version
- 5.4
# aliased to a recent 5.5.x version
- 5.5
# aliased to a recent 5.6.x version
- 5.6
# hhvm
- hhvm

before_script:
- composer self-update
- composer install --prefer-source --no-interaction --dev

script: phpunit ./tests/*.php

matrix:
fast_finish: true
10 changes: 10 additions & 0 deletions tests/TestIp.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
require __DIR__.'/../vendor/autoload.php';
use Zhuzhichao\IpLocationZh\Ip;

class TestIp extends PHPUnit_Framework_TestCase {
public function testIpLocation() {
$this->assertEquals(['中国', '河南', '郑州', ''], Ip::find('1.192.94.203'));
$this->assertEquals(['中国', '浙江', '杭州', ''], Ip::find('110.75.115.70'));
}
}

0 comments on commit f318d80

Please sign in to comment.