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

Refactor and improve tests #109

Merged
merged 26 commits into from
Sep 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b81fd41
Add error handler test
geerteltink Aug 27, 2016
6e124bd
Refactor test case and populate the installer from the parsed compose…
geerteltink Aug 27, 2016
067f755
Remove unused response property
geerteltink Aug 27, 2016
375088e
Refactor dev dependencies removal and add a test
geerteltink Aug 27, 2016
f6db55a
Test all packages in one go
geerteltink Aug 28, 2016
b3d997f
The answer should be saved after the question is processed
geerteltink Aug 28, 2016
ed1aba1
Refactor removing installer from composer and add a test
geerteltink Aug 28, 2016
0197fa2
Add missing docblock
geerteltink Aug 29, 2016
04f6490
Add testing different types of answers
geerteltink Aug 29, 2016
62b7154
Remove install package method from the test case
geerteltink Aug 29, 2016
35721d4
Update Travis CI config and enable Coveralls
geerteltink Aug 29, 2016
e6f9088
Remove coveralls src_dir from config
geerteltink Aug 29, 2016
31b3d54
Use the correct coverall badge and url
geerteltink Aug 29, 2016
65ccd5f
Use the correct travis globals please :D
geerteltink Aug 29, 2016
38acc3b
Exclude the installer resources for coverage
geerteltink Aug 29, 2016
3b85069
Don't process uncovered files from whitelist
geerteltink Aug 29, 2016
311101d
Properly exclude the resources directory
geerteltink Aug 29, 2016
ae10a75
Exclude some parts which can't be tested without modifying source files
geerteltink Aug 29, 2016
4e329d7
Skip locked dependency tests since there is no composer.lock file inc…
geerteltink Aug 29, 2016
c38c5ba
Send travis notifications to irc and disable email notifications
geerteltink Aug 29, 2016
d270c0b
The scripts section in composer.json is never empty so it doesn't nee…
geerteltink Aug 29, 2016
7b96d1f
Remove branch-alias
geerteltink Aug 29, 2016
7552f93
Lets not test removing the installer source code :)
geerteltink Aug 29, 2016
658cefa
Add addPackage tests
geerteltink Aug 29, 2016
2ea211b
Add test for minimal install request
geerteltink Aug 29, 2016
071291d
Add highest and lowest test for php 5.5
geerteltink Sep 1, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we do this for master, we need to keep 5.5 in here; if we do it for develop, and the 1.1 release, we can leave as-is. I'm going to leave it to you, @xtreamwayz , to decide which you want to target.


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>