Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Commit

Permalink
Merge pull request #109 from xtreamwayz/feature/improve-tests
Browse files Browse the repository at this point in the history
Refactor and improve tests
  • Loading branch information
weierophinney committed Sep 1, 2016
2 parents 9bed6c9 + 071291d commit 4ea0eba
Show file tree
Hide file tree
Showing 17 changed files with 823 additions and 166 deletions.
2 changes: 2 additions & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
coverage_clover: clover.xml
json_path: coveralls-upload.json
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
.idea
composer.phar
composer.lock

clover.xml
coveralls-upload.json
phpunit.xml
vendor/
48 changes: 41 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,61 @@ sudo: false

language: php

cache:
directories:
- $HOME/.composer/cache
- vendor

env:
global:
- COMPOSER_ARGS="--no-interaction --ignore-platform-reqs --no-scripts"

notifications:
irc: "irc.freenode.org#zftalk.dev"
email: false

matrix:
fast_finish: true
include:
- php: 5.5
env:
- DEPS=lowest
- php: 5.5
env:
- DEPS=latest
- php: 5.6
env:
- EXECUTE_CS_CHECK=true
- DEPS=lowest
- php: 5.6
env:
- DEPS=latest
- TEST_COVERAGE=true
- php: 7
env:
- DEPS=lowest
- php: 7
env:
- DEPS=latest
- CHECK_CS=true
- php: hhvm
allow_failures:
- php: hhvm

before_install:
- composer self-update
- if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
- travis_retry composer self-update

install:
- travis_retry composer install --no-interaction --ignore-platform-reqs --prefer-source --no-scripts
- if [[ $DEPS == 'latest' ]]; then travis_retry composer update $COMPOSER_ARGS ; fi
- if [[ $DEPS == 'lowest' ]]; then travis_retry composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS satooshi/php-coveralls:^1.0 ; fi
- travis_retry composer install $COMPOSER_ARGS
- composer show --installed

script:
- composer test
- if [[ $EXECUTE_CS_CHECK == 'true' ]]; then composer cs ; fi
- if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; fi
- if [[ $TEST_COVERAGE != 'true' ]]; then composer test ; fi
- if [[ $CHECK_CS == 'true' ]]; then composer cs ; fi

notifications:
email: true
after_script:
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer upload-coverage ; fi
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Expressive Skeleton and Installer

[![Build Status](https://secure.travis-ci.org/zendframework/zend-expressive-skeleton.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-expressive-skeleton)
[![Coverage Status](https://coveralls.io/repos/github/zendframework/zend-expressive-skeleton/badge.svg?branch=master)](https://coveralls.io/github/zendframework/zend-expressive-skeleton?branch=master)

*Begin developing PSR-7 middleware applications in seconds!*

Expand Down
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
"cs": "phpcs",
"cs-fix": "phpcbf",
"serve": "php -S 0.0.0.0:8080 -t public/ public/index.php",
"test": "phpunit"
"test": "phpunit",
"test-coverage": "phpunit --coverage-clover clover.xml",
"upload-coverage": "coveralls -v"
}
}
13 changes: 10 additions & 3 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
<phpunit bootstrap="./vendor/autoload.php" colors="true">
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true">
<testsuites>
<testsuite name="App\\Tests">
<directory>./test</directory>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
<whitelist>
<directory suffix=".php">./src</directory>
<exclude>
<directory suffix=".php">./src/ExpressiveInstaller/Resources</directory>
</exclude>
</whitelist>
</filter>
</phpunit>

0 comments on commit 4ea0eba

Please sign in to comment.