forked from shitoudev/phone-location
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
language: php | ||
php: | ||
- 5.3 | ||
- 5.4 | ||
- 5.5 | ||
- 5.6 | ||
- hhvm | ||
install: | ||
- composer self-update | ||
- composer install --no-dev --quiet | ||
script: phpunit -c phpunit.xml --coverage-text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,5 +18,8 @@ | |
"psr-4": { | ||
"Shitoudev\\Phone\\": "src/" | ||
} | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^5.7" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<phpunit bootstrap="tests/bootstrap.php" colors="true"> | ||
<testsuites> | ||
<testsuite name="Phone Location Suite"> | ||
<directory>tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<filter> | ||
<whitelist> | ||
<directory suffix=".php">src/</directory> | ||
</whitelist> | ||
</filter> | ||
|
||
<php> | ||
<ini name="date.timezone" value="UTC"/> | ||
</php> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
// require dirname(__DIR__) . '/src/PhoneLocation.php'; | ||
use Shitoudev\Phone\PhoneLocation; | ||
|
||
/** | ||
* Phone Test | ||
*/ | ||
class PhoneTest extends PHPUnit_Framework_TestCase | ||
{ | ||
protected $phone = null; | ||
|
||
public function setUp() | ||
{ | ||
$this->phone = new PhoneLocation(); | ||
} | ||
|
||
public function testFileHandle() | ||
{ | ||
$this->assertAttributeNotEquals(null, '_fileHandle', $this->phone); | ||
} | ||
|
||
public function testPhoneInfo() | ||
{ | ||
$info = function () { | ||
return $this->phone->phoneInfo('上海|上海|200000|021', 1); | ||
}; | ||
$this->assertNotEmpty($info); | ||
} | ||
|
||
public function testPhoneFind() | ||
{ | ||
$info = $this->phone->find(18621281566); | ||
$this->assertNotEmpty($info); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?php | ||
|
||
date_default_timezone_set('UTC'); | ||
require dirname(__DIR__).'/vendor/autoload.php'; |