Skip to content

Commit 8750c3f

Browse files
authored
Merge pull request #10 from php-api-clients/update-test-utilities-to-4.1
Updated to test utilities 4.1
2 parents 65f3f5d + db1ff42 commit 8750c3f

15 files changed

+1193
-209
lines changed

.php_cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php declare(strict_types=1);
2+
3+
use ApiClients\Tools\TestUtilities\PhpCsFixerConfig;
4+
use PhpCsFixer\Config;
5+
6+
return (function (): Config
7+
{
8+
$paths = [
9+
__DIR__ . DIRECTORY_SEPARATOR . 'src',
10+
__DIR__ . DIRECTORY_SEPARATOR . 'tests',
11+
];
12+
13+
return PhpCsFixerConfig::create()
14+
->setFinder(
15+
PhpCsFixer\Finder::create()
16+
->in($paths)
17+
->append($paths)
18+
)
19+
->setUsingCache(false)
20+
;
21+
})();

.travis.yml

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,55 @@
11
language: php
2-
sudo: false
32

43
## Cache composer bits
54
cache:
65
directories:
7-
- $HOME/.composer/cache
8-
9-
## PHP versions we test against
10-
php:
11-
- 7.0
12-
- 7.1
13-
- nightly
14-
15-
## Environment variables
16-
env:
17-
- coverage=true
6+
- $HOME/.composer/cache/files
187

198
## Build matrix for lowest and highest possible targets
209
matrix:
2110
include:
11+
- php: 7.0
12+
env:
13+
- qaExtended=true
14+
- php: 7.1
15+
- php: nightly
16+
env:
17+
- dropPlatform=false
2218
- php: 7.0
2319
env:
2420
- dependencies=lowest
25-
- coverage=false
2621
- php: 7.1
2722
env:
2823
- dependencies=lowest
29-
- coverage=false
3024
- php: nightly
3125
env:
3226
- dependencies=lowest
33-
- coverage=false
27+
- dropPlatform=false
3428
- php: 7.0
3529
env:
3630
- dependencies=highest
37-
- coverage=false
3831
- php: 7.1
3932
env:
4033
- dependencies=highest
41-
- coverage=false
4234
- php: nightly
4335
env:
4436
- dependencies=highest
45-
- coverage=false
37+
- dropPlatform=false
4638

4739
## Install or update dependencies
4840
install:
4941
- composer validate
50-
- if [ "$coverage" = "false" ]; then phpenv config-rm xdebug.ini || :; fi;
42+
- if [ -z "$dropPlatform" ]; then composer config --unset platform.php; fi;
43+
- if [ -z "$qaExtended" ]; then phpenv config-rm xdebug.ini || :; fi;
5144
- if [ -z "$dependencies" ]; then composer install --prefer-dist; fi;
5245
- if [ "$dependencies" = "lowest" ]; then composer update --prefer-lowest --prefer-dist -n; fi;
5346
- if [ "$dependencies" = "highest" ]; then composer update --prefer-dist -n; fi;
5447
- composer show
5548

5649
## Run the actual test
5750
script:
58-
- if [ "$coverage" = "false" ]; then make ci; fi;
59-
- if [ "$coverage" = "true" ]; then make ci-with-coverage; fi;
51+
- if [ -z "$qaExtended" ]; then make ci; fi;
52+
- if [ "$qaExtended" = "true" ]; then make ci-extended; fi;
6053

6154
## Gather coverage and set it to coverage servers
62-
after_script: make ci-coverage
55+
after_script: if [ "$qaExtended" = "true" ]; then make ci-coverage; fi;

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ all-coverage:
77
ci:
88
composer run-script qa-ci --timeout=0
99

10-
ci-with-coverage:
11-
composer run-script qa-ci-coverage --timeout=0
10+
ci-extended:
11+
composer run-script qa-ci-extended --timeout=0
1212

1313
contrib:
1414
composer run-script qa-contrib --timeout=0
@@ -19,6 +19,9 @@ init:
1919
cs:
2020
composer cs
2121

22+
cs-fix:
23+
composer cs-fix
24+
2225
unit:
2326
composer run-script unit --timeout=0
2427

composer.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"react/promise": "^2.4"
1717
},
1818
"require-dev": {
19-
"api-clients/test-utilities": "^3.0",
19+
"api-clients/test-utilities": "^4.1",
2020
"guzzlehttp/psr7": "^1.3",
2121
"psr/container": "^1.0"
2222
},
@@ -38,13 +38,20 @@
3838
}
3939
},
4040
"config": {
41-
"sort-packages": true
41+
"sort-packages": true,
42+
"platform": {
43+
"php": "7.0"
44+
}
4245
},
4346
"scripts": {
4447
"ensure-installed": "composer install --ansi -n -q",
4548
"cs": [
4649
"@ensure-installed",
47-
"phpcs --standard=PSR2 src/"
50+
"php-cs-fixer fix --config=.php_cs --ansi --dry-run --diff --verbose --allow-risky=yes --show-progress=estimating"
51+
],
52+
"cs-fix": [
53+
"@ensure-installed",
54+
"php-cs-fixer fix --config=.php_cs --ansi --verbose --allow-risky=yes --show-progress=estimating"
4855
],
4956
"unit": [
5057
"@ensure-installed",
@@ -74,9 +81,9 @@
7481
"@unit"
7582
],
7683
"qa-ci": [
77-
"@qa-all"
84+
"@unit"
7885
],
79-
"qa-ci-coverage": [
86+
"qa-ci-extended": [
8087
"@qa-all-coverage"
8188
],
8289
"qa-ci-windows": [

0 commit comments

Comments
 (0)