Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revamp testing framework #162

Merged
merged 15 commits into from
Oct 20, 2017
Merged
2 changes: 2 additions & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
coverage_clover: tests/_output/coverage.xml
json_path: tests/_output/coveralls_upload.json
15 changes: 9 additions & 6 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# This is the top-most .editorconfig file; do not search in parent directories.
# PSR-1/2 standard.
root = true

# All files.
[*]
end_of_line = LF
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_size = 4
indent_style = space

# Markdown customizations
[*.md]
trim_trailing_whitespace = false
39 changes: 39 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
language: php
sudo: false
dist: trusty

php:
- '7.1'
- nightly

env:
- PATCHES_TEST_SUITE=unit
- PATCHES_TEST_SUITE=acceptance

matrix:
fast_finish: true
allow_failures:
- php: nightly
include:
- php: 5.6
env: PATCHES_TEST_SUITE=lint
- php: 7.0
env: PATCHES_TEST_SUITE=lint

cache:
directories:
- ./vendor

install:
- composer self-update --no-interaction
- if [ "${PATCHES_TEST_SUITE}" != "lint" ]; then composer install --dev --no-interaction; fi;

script:
- echo "${PATCHES_TEST_SUITE}"
- if [ "${PATCHES_TEST_SUITE}" != "lint" ]; then ./vendor/bin/grumphp run; fi;
- if [ "${PATCHES_TEST_SUITE}" == "lint" ]; then find ./src -name "*.php" -exec php -l {} \;; fi;
- if [ "${TRAVIS_PHP_VERSION}" != "7.1" ] && [ "${PATCHES_TEST_SUITE}" != "lint" ]; then ./vendor/bin/codecept run "${PATCHES_TEST_SUITE}"; fi;
- if [ "${TRAVIS_PHP_VERSION}" == "7.1" ] && [ "${PATCHES_TEST_SUITE}" != "lint" ]; then ./vendor/bin/codecept run "${PATCHES_TEST_SUITE}" --coverage-xml; fi;

after_success:
- if [ -f ./tests/_output/coverage.xml ]; then travis_retry ./vendor/bin/coveralls -v; fi;
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

Simple patches plugin for Composer. Applies a patch from a local or remote file to any package required with composer.

## Support notes

* If you need PHP 5.3, 5.4, or 5.5 support, you should probably use a 1.x release.
* 1.x is mostly unsupported, but bugfixes and security fixes will still be accepted.
1.7.0 will be the last minor release in the 1.x series.
* Beginning in 2.x, the automated tests will not allow us to use language features
that will cause syntax errors in PHP 5.6 and later. The unit/acceptance tests do
not run on anything earlier than PHP 7.1, so while pull requests will be accepted
for those versions, support is on a best-effort basis.


## Usage

Example composer.json:
Expand Down
19 changes: 19 additions & 0 deletions codeception.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
actor: Tester
paths:
tests: tests
data: tests/_data
log: tests/_output
support: tests/_support
envs: tests/_envs
settings:
bootstrap: _bootstrap.php
colors: true
memory_limit: 1024M
extensions:
enabled:
- Codeception\Extension\RunFailed
coverage:
enabled: true
whitelist:
include:
- src/*
10 changes: 7 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "cweagans/composer-patches",
"description": "Provides a way to patch Composer packages.",
"minimum-stability": "dev",
"license": "BSD-2-Clause",
"type": "composer-plugin",
"extra": {
Expand All @@ -14,12 +13,17 @@
}
],
"require": {
"php": ">=5.3.0",
"php": ">=5.6.0",
"composer-plugin-api": "^1.0"
},
"require-dev": {
"composer/composer": "~1.0",
"phpunit/phpunit": "~4.6"
"codeception/codeception": "~2.0",
"satooshi/php-coveralls": "~1.0",
"phpro/grumphp": "^0.11.6",
"jakub-onderka/php-parallel-lint": "^0.9.2",
"sebastian/phpcpd": "^3.0",
"squizlabs/php_codesniffer": "^3.0"
},
"autoload": {
"psr-4": {"cweagans\\Composer\\": "src"}
Expand Down
Loading