Skip to content

Commit 3d1fd6b

Browse files
authored
Merge pull request #162 from cweagans/testing
Revamp testing framework
2 parents cc88ad5 + 89a7b7b commit 3d1fd6b

36 files changed

+5461
-1173
lines changed

.coveralls.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
coverage_clover: tests/_output/coverage.xml
2+
json_path: tests/_output/coveralls_upload.json

.editorconfig

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
# This is the top-most .editorconfig file; do not search in parent directories.
1+
# PSR-1/2 standard.
22
root = true
33

4-
# All files.
54
[*]
6-
end_of_line = LF
7-
indent_style = space
8-
indent_size = 2
95
charset = utf-8
10-
trim_trailing_whitespace = true
6+
end_of_line = lf
117
insert_final_newline = true
8+
trim_trailing_whitespace = true
9+
indent_size = 4
10+
indent_style = space
11+
12+
# Markdown customizations
13+
[*.md]
14+
trim_trailing_whitespace = false

.travis.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
language: php
2+
sudo: false
3+
dist: trusty
4+
5+
php:
6+
- '7.1'
7+
- nightly
8+
9+
env:
10+
- PATCHES_TEST_SUITE=unit
11+
- PATCHES_TEST_SUITE=acceptance
12+
13+
matrix:
14+
fast_finish: true
15+
allow_failures:
16+
- php: nightly
17+
include:
18+
- php: 5.6
19+
env: PATCHES_TEST_SUITE=lint
20+
- php: 7.0
21+
env: PATCHES_TEST_SUITE=lint
22+
23+
cache:
24+
directories:
25+
- ./vendor
26+
27+
install:
28+
- composer self-update --no-interaction
29+
- if [ "${PATCHES_TEST_SUITE}" != "lint" ]; then composer install --dev --no-interaction; fi;
30+
31+
script:
32+
- echo "${PATCHES_TEST_SUITE}"
33+
- if [ "${PATCHES_TEST_SUITE}" != "lint" ]; then ./vendor/bin/grumphp run; fi;
34+
- if [ "${PATCHES_TEST_SUITE}" == "lint" ]; then find ./src -name "*.php" -exec php -l {} \;; fi;
35+
- if [ "${TRAVIS_PHP_VERSION}" != "7.1" ] && [ "${PATCHES_TEST_SUITE}" != "lint" ]; then ./vendor/bin/codecept run "${PATCHES_TEST_SUITE}"; fi;
36+
- if [ "${TRAVIS_PHP_VERSION}" == "7.1" ] && [ "${PATCHES_TEST_SUITE}" != "lint" ]; then ./vendor/bin/codecept run "${PATCHES_TEST_SUITE}" --coverage-xml; fi;
37+
38+
after_success:
39+
- if [ -f ./tests/_output/coverage.xml ]; then travis_retry ./vendor/bin/coveralls -v; fi;

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

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

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

718
Example composer.json:

codeception.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
actor: Tester
2+
paths:
3+
tests: tests
4+
data: tests/_data
5+
log: tests/_output
6+
support: tests/_support
7+
envs: tests/_envs
8+
settings:
9+
bootstrap: _bootstrap.php
10+
colors: true
11+
memory_limit: 1024M
12+
extensions:
13+
enabled:
14+
- Codeception\Extension\RunFailed
15+
coverage:
16+
enabled: true
17+
whitelist:
18+
include:
19+
- src/*

composer.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"name": "cweagans/composer-patches",
33
"description": "Provides a way to patch Composer packages.",
4-
"minimum-stability": "dev",
54
"license": "BSD-2-Clause",
65
"type": "composer-plugin",
76
"extra": {
@@ -14,12 +13,17 @@
1413
}
1514
],
1615
"require": {
17-
"php": ">=5.3.0",
16+
"php": ">=5.6.0",
1817
"composer-plugin-api": "^1.0"
1918
},
2019
"require-dev": {
2120
"composer/composer": "~1.0",
22-
"phpunit/phpunit": "~4.6"
21+
"codeception/codeception": "~2.0",
22+
"satooshi/php-coveralls": "~1.0",
23+
"phpro/grumphp": "^0.11.6",
24+
"jakub-onderka/php-parallel-lint": "^0.9.2",
25+
"sebastian/phpcpd": "^3.0",
26+
"squizlabs/php_codesniffer": "^3.0"
2327
},
2428
"autoload": {
2529
"psr-4": {"cweagans\\Composer\\": "src"}

0 commit comments

Comments
 (0)