Skip to content

Commit c17417a

Browse files
authored
Merge pull request #2 from Graychen/master
添加单元测试
2 parents e0cde0b + 06991e3 commit c17417a

File tree

10 files changed

+2849
-2
lines changed

10 files changed

+2849
-2
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
.idea/
2-
/vendor/
2+
/vendor/
3+
/node_modules/
4+
package.json

.scrutinizer.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
imports:
2+
- php
3+
4+
tools:
5+
external_code_coverage:
6+
timeout: 1800 # Timeout in seconds.
7+
# disable copy paste detector and similarity analyzer as they have no real value
8+
# and a huge bunch of false-positives
9+
php_sim: false
10+
php_cpd: false

.travis.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
language: php
2+
3+
matrix:
4+
fast_finish: true
5+
6+
php:
7+
- 7.1
8+
9+
cache:
10+
directories:
11+
- $HOME/.composer/cache
12+
- vendor
13+
14+
services:
15+
- mysql
16+
17+
install:
18+
- travis_retry composer self-update
19+
- composer config -g github-oauth.github.com 5125faee43aee49964bdef63ebd8f9f3bc5ad0a9
20+
- travis_retry composer install --prefer-dist --no-interaction
21+
- travis_retry mysql -e 'CREATE DATABASE test;'
22+
23+
before_script:
24+
- travis_retry composer self-update
25+
- travis_retry composer install --no-interaction --prefer-source --dev
26+
27+
script:
28+
- ./vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
29+
30+
after_script:
31+
- wget https://scrutinizer-ci.com/ocular.phar
32+
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,39 @@
11
# yii2-post
22
yii2 post module
3+
[![StyleCI](https://styleci.io/repos/99547471/shield?branch=master)](https://styleci.io/repos/99547471)
4+
[![Build Status](https://travis-ci.org/Graychen/yii2-post.svg?branch=master)](https://travis-ci.org/Graychen/yii2-post)
5+
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Graychen/yii2-post/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/Graychen/yii2-post/?branch=master)
6+
[![Code Coverage](https://scrutinizer-ci.com/g/Graychen/yii2-post/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/Graychen/yii2-post/?branch=master)
7+
8+
=============
9+
Yii2 Database post
10+
11+
Installation
12+
------------
13+
14+
The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
15+
16+
Either run
17+
18+
```
19+
php composer.phar require --prefer-dist zacksleo/yii2-post "*"
20+
```
21+
22+
or add
23+
24+
```
25+
"zacksleo/yii2-post": "*"
26+
```
27+
28+
to the require section of your `composer.json` file.
29+
30+
Subsequently, run
31+
32+
```php
33+
./yii migrate/up --migrationPath=@vendor/zacksleo/yii2-post/migrations
34+
```
35+
36+
in order to create the settings table in your database.
37+
38+
39+
```

composer.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@
2020
},
2121
"autoload": {
2222
"psr-4": {
23-
"zacksleo\\yii2\\post\\": "src"
23+
"zacksleo\\yii2\\post\\": "src",
24+
"zacksleo\\yii2\\post\\tests\\": "tests"
2425
}
26+
},
27+
"require-dev": {
28+
"phpunit/phpunit": "~4.0",
29+
"fzaninotto/faker": "^1.6"
2530
}
2631
}

0 commit comments

Comments
 (0)