-
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
5 changed files
with
99 additions
and
2 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,31 @@ | ||
language: php | ||
|
||
php: | ||
- '5.4' | ||
- '5.5' | ||
- '5.6' | ||
- '7.0' | ||
- hhvm | ||
- nightly | ||
|
||
matrix: | ||
fast_finish: true | ||
allow_failures: | ||
- php: hhvm | ||
- php: nightly | ||
|
||
before_install: | ||
- phpenv config-add tests/travis.ini | ||
|
||
install: | ||
- composer require satooshi/php-coveralls --no-interaction | ||
|
||
before_script: | ||
- mysql -e 'CREATE DATABASE IF NOT EXISTS test;' | ||
- mysql -e 'CREATE DATABASE IF NOT EXISTS app;' | ||
|
||
script: | ||
- phpunit --verbose --stderr --coverage-clover build/logs/clover.xml | ||
|
||
after_success: | ||
- travis_retry php vendor/bin/coveralls -v |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<phpunit backupGlobals="false" | ||
colors="true" | ||
bootstrap="vendor/miaoxing/plugin/tests/bootstrap.php" | ||
> | ||
|
||
<testsuites> | ||
<testsuite name="Default Test Suite"> | ||
<directory>./tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<filter> | ||
<whitelist> | ||
<directory>.</directory> | ||
<exclude> | ||
<directory>./data</directory> | ||
<directory>./docs</directory> | ||
<directory>./tests</directory> | ||
<directory>./vendor</directory> | ||
</exclude> | ||
</whitelist> | ||
</filter> | ||
</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,33 @@ | ||
<?php | ||
|
||
namespace MiaoxingTest\Stat\Stests\Service; | ||
|
||
use Miaoxing\Plugin\Test\BaseTestCase; | ||
|
||
/** | ||
* 统计服务 | ||
*/ | ||
class StatTest extends BaseTestCase | ||
{ | ||
/** | ||
* 记录一条日志 | ||
*/ | ||
public function testLog() | ||
{ | ||
$db = $this->getServiceMock('db', ['insert']); | ||
wei()->stat->db = $db; | ||
|
||
$db->expects($this->once()) | ||
->method('insert') | ||
->with('test', $this->logicalAnd( | ||
$this->arrayHasKey('a'), | ||
$this->arrayHasKey('appId'), | ||
$this->arrayHasKey('createTime'), | ||
$this->arrayHasKey('createDate') | ||
)); | ||
|
||
wei()->stat->log('test', [ | ||
'a' => 1, | ||
]); | ||
} | ||
} |
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 @@ | ||
extension="memcached.so" |