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

Commit 11b796e

Browse files
committed
Modernize package and QA toolchain
- Use PSR-4 directory structure - Use zend-coding-standard for CS checks - Use phpunit 5/6/7 insted of 4/5 - No custom bootstrap necessary - use namespaced TestCase - migrate `setExpectedException` to `expectException` - migrate `getMock` to `createMock` - use `::class` notation everywhere - Use consistent license docblock everywhere - Adopt lowest/locked/latest test matrix
1 parent be574a5 commit 11b796e

File tree

96 files changed

+2127
-1531
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+2127
-1531
lines changed

.travis.yml

Lines changed: 65 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,80 @@
1+
sudo: false
2+
13
language: php
24

5+
cache:
6+
directories:
7+
- $HOME/.composer/cache
8+
39
services:
410
- redis-server
511
- rabbitmq
612

7-
sudo: false
8-
9-
cache:
10-
directories:
11-
- $HOME/.composer/cache
13+
env:
14+
global:
15+
- COMPOSER_ARGS="--no-interaction"
16+
- COVERAGE_DEPS="php-coveralls/php-coveralls"
1217

13-
php:
14-
- 5.6
15-
- 7.0
16-
- 7.1
17-
- 7.2
18+
matrix:
19+
include:
20+
- php: 5.6
21+
env:
22+
- DEPS=lowest
23+
- php: 5.6
24+
env:
25+
- DEPS=locked
26+
- LEGACY_DEPS="phpunit/phpunit"
27+
- php: 5.6
28+
env:
29+
- DEPS=latest
30+
- php: 7
31+
env:
32+
- DEPS=lowest
33+
- php: 7
34+
env:
35+
- DEPS=locked
36+
- LEGACY_DEPS="phpunit/phpunit"
37+
- php: 7
38+
env:
39+
- DEPS=latest
40+
- php: 7.1
41+
env:
42+
- DEPS=lowest
43+
- php: 7.1
44+
env:
45+
- DEPS=locked
46+
- CS_CHECK=true
47+
- TEST_COVERAGE=true
48+
- php: 7.1
49+
env:
50+
- DEPS=latest
51+
- php: 7.2
52+
env:
53+
- DEPS=lowest
54+
- php: 7.2
55+
env:
56+
- DEPS=locked
57+
- php: 7.2
58+
env:
59+
- DEPS=latest
1860

1961
before_install:
20-
- composer self-update
21-
- phpenv config-rm xdebug.ini
22-
- composer require --no-update fabpot/php-cs-fixer:1.9.*
62+
- if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
2363

24-
install: composer update $COMPOSER_FLAGS --prefer-dist
64+
install:
65+
- travis_retry composer install $COMPOSER_ARGS --ignore-platform-reqs
66+
- if [[ $LEGACY_DEPS != '' ]]; then travis_retry composer update $COMPOSER_ARGS --with-dependencies $LEGACY_DEPS ; fi
67+
- if [[ $DEPS == 'latest' ]]; then travis_retry composer update $COMPOSER_ARGS ; fi
68+
- if [[ $DEPS == 'lowest' ]]; then travis_retry composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi
69+
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $COVERAGE_DEPS ; fi
70+
- stty cols 120 && composer show
2571

2672
script:
27-
- ./vendor/bin/phpunit -c ./tests/ --coverage-text
28-
- ./vendor/bin/php-cs-fixer fix -v --dry-run --level=psr2 .
73+
- if [[ $TEST_COVERAGE == 'true' ]]; then composer run-script test-coverage -- --verbose ; else composer run-script test -- --verbose ; fi
74+
- if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; fi
75+
76+
after_script:
77+
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry vendor/bin/php-coveralls -v ; fi
2978

3079
notifications:
31-
irc: "irc.freenode.org#zftalk.dev"
3280
email: false

composer.json

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,17 @@
2121
"php": "^5.6 || ^7.0"
2222
},
2323
"require-dev": {
24-
"zendframework/zend-loader": "^2.0",
25-
"sensiolabs/security-checker": "^1.3",
26-
"symfony/yaml": "^2.7|^3.0|^4.0",
24+
"doctrine/migrations": "^1.0",
2725
"guzzle/http": "^3.0",
2826
"guzzle/plugin-mock": "^3.0",
27+
"mikey179/vfsStream": "^1.6",
2928
"php-amqplib/php-amqplib": "^2.0",
29+
"phpunit/phpunit": "^5.7.27 || 6.5.8 || ^7.1.2",
3030
"predis/predis": "^1.0",
31-
"phpunit/phpunit": "^4.7|^5.0",
32-
"doctrine/migrations": "^1.0",
33-
"mikey179/vfsStream": "^1.6"
31+
"sensiolabs/security-checker": "^1.3",
32+
"symfony/yaml": "^2.7 || ^3.0 || ^4.0",
33+
"zendframework/zend-coding-standard": "~1.0.0",
34+
"zendframework/zend-loader": "^2.0"
3435
},
3536
"suggest": {
3637
"ext-bcmath": "Required by Check\\CpuPerformance",
@@ -42,9 +43,13 @@
4243
"doctrine/migrations": "Required by Check\\DoctrineMigration"
4344
},
4445
"autoload": {
45-
"psr-0": {
46-
"ZendDiagnostics\\": "src/",
47-
"ZendDiagnosticsTest\\": "tests/"
46+
"psr-4": {
47+
"ZendDiagnostics\\": "src/"
48+
}
49+
},
50+
"autoload-dev": {
51+
"psr-4": {
52+
"ZendDiagnosticsTest\\": "test/"
4853
}
4954
},
5055
"config": {

0 commit comments

Comments
 (0)