Skip to content

Commit 9525b83

Browse files
committed
Updated QA config files to the new test utilities set up
1 parent 0625f75 commit 9525b83

File tree

8 files changed

+143
-87
lines changed

8 files changed

+143
-87
lines changed

.php_cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php declare(strict_types=1);
2+
3+
use ApiClients\Tools\CsFixerConfig\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+
})();
22+

.travis.yml

Lines changed: 18 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,51 @@
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:
22-
- php: 7.0
11+
- php: 7.2
2312
env:
24-
- dependencies=lowest
25-
- coverage=false
26-
- php: 7.1
13+
- qaExtended=true
14+
- dropPlatform=false
15+
- php: nightly
16+
env:
17+
- dropPlatform=false
18+
- php: 7.2
2719
env:
2820
- dependencies=lowest
29-
- coverage=false
21+
- dropPlatform=false
3022
- php: nightly
3123
env:
3224
- dependencies=lowest
33-
- coverage=false
34-
- php: 7.0
35-
env:
36-
- dependencies=highest
37-
- coverage=false
38-
- php: 7.1
25+
- dropPlatform=false
26+
- php: 7.2
3927
env:
4028
- dependencies=highest
41-
- coverage=false
29+
- dropPlatform=false
4230
- php: nightly
4331
env:
4432
- dependencies=highest
45-
- coverage=false
33+
- dropPlatform=false
4634

4735
## Install or update dependencies
4836
install:
4937
- composer validate
50-
- if [ "$coverage" = "false" ]; then phpenv config-rm xdebug.ini || :; fi;
38+
- if [ -z "$dropPlatform" ]; then composer config --unset platform.php; fi;
39+
- if [ -z "$qaExtended" ]; then phpenv config-rm xdebug.ini || :; fi;
5140
- if [ -z "$dependencies" ]; then composer install --prefer-dist; fi;
5241
- if [ "$dependencies" = "lowest" ]; then composer update --prefer-lowest --prefer-dist -n; fi;
5342
- if [ "$dependencies" = "highest" ]; then composer update --prefer-dist -n; fi;
5443
- composer show
5544

5645
## Run the actual test
5746
script:
58-
- if [ "$coverage" = "false" ]; then make ci; fi;
59-
- if [ "$coverage" = "true" ]; then make ci-with-coverage; fi;
47+
- if [ -z "$qaExtended" ]; then make ci; fi;
48+
- if [ "$qaExtended" = "true" ]; then make ci-extended; fi;
6049

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

Makefile

Lines changed: 6 additions & 3 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,11 +19,14 @@ 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

2528
unit-coverage:
2629
composer run-script unit-coverage --timeout=0
2730

2831
ci-coverage: init
29-
composer ci-coverage
32+
composer ci-coverage

appveyor.yml

Lines changed: 31 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,45 @@ clone_folder: c:\projects\php-project-workspace
66
## Build matrix for lowest and highest possible targets
77
environment:
88
matrix:
9-
- dependencies: lowest
10-
php_ver_target: 7.0
11-
- dependencies: lowest
12-
php_ver_target: 7.1
13-
- dependencies: current
14-
php_ver_target: 7.0
15-
- dependencies: current
16-
php_ver_target: 7.1
17-
- dependencies: highest
18-
php_ver_target: 7.0
19-
- dependencies: highest
20-
php_ver_target: 7.1
9+
- dependencies: lowest
10+
php_ver_target: 7.2
11+
- dependencies: current
12+
php_ver_target: 7.2
13+
- dependencies: highest
14+
php_ver_target: 7.2
2115

22-
## Cache composer bits
16+
## Cache composer file
2317
cache:
24-
- '%LOCALAPPDATA%\Composer\files -> composer.lock'
18+
- '%LOCALAPPDATA%\Composer\files -> composer.lock'
2519

2620
## Set up environment varriables
2721
init:
28-
- SET PATH=C:\Program Files\OpenSSL;c:\tools\php;%PATH%
29-
- SET COMPOSER_NO_INTERACTION=1
30-
- SET PHP=1
31-
- SET ANSICON=121x90 (121x90)
22+
- SET PATH=C:\Program Files\OpenSSL;c:\tools\php;%PATH%
23+
- SET COMPOSER_NO_INTERACTION=1
24+
- SET PHP=1
25+
- SET ANSICON=121x90 (121x90)
3226

3327
## Install PHP and composer, and run the appropriate composer command
3428
install:
35-
- IF EXIST c:\tools\php (SET PHP=0)
36-
- ps: appveyor-retry cinst -y php --ignore-checksums --version ((choco search php --exact --all-versions -r | select-string -pattern $Env:php_ver_target | Select-Object -first 1) -replace '[php|]','')
37-
- cd c:\tools\php
38-
- IF %PHP%==1 copy php.ini-production php.ini /Y
39-
- IF %PHP%==1 echo date.timezone="UTC" >> php.ini
40-
- IF %PHP%==1 echo extension_dir=ext >> php.ini
41-
- IF %PHP%==1 echo extension=php_openssl.dll >> php.ini
42-
- IF %PHP%==1 echo extension=php_mbstring.dll >> php.ini
43-
- IF %PHP%==1 echo extension=php_fileinfo.dll >> php.ini
44-
- IF %PHP%==1 echo @php %%~dp0composer.phar %%* > composer.bat
45-
- appveyor-retry appveyor DownloadFile https://getcomposer.org/composer.phar
46-
- cd c:\projects\php-project-workspace
47-
- IF %dependencies%==lowest appveyor-retry composer update --prefer-lowest --no-progress --profile -n
48-
- IF %dependencies%==current appveyor-retry composer install --no-progress --profile
49-
- IF %dependencies%==highest appveyor-retry composer update --no-progress --profile -n
50-
- composer show
29+
- IF EXIST c:\tools\php (SET PHP=0)
30+
- ps: appveyor-retry cinst --params '""/InstallDir:C:\tools\php""' --ignore-checksums -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $env:php_ver_target | sort { [version]($_ -split '\|' | select -last 1) } -Descending | Select-Object -first 1) -replace '[php|]','')
31+
- cd c:\tools\php
32+
- IF %PHP%==1 copy php.ini-production php.ini /Y
33+
- IF %PHP%==1 echo date.timezone="UTC" >> php.ini
34+
- IF %PHP%==1 echo extension_dir=ext >> php.ini
35+
- IF %PHP%==1 echo extension=php_openssl.dll >> php.ini
36+
- IF %PHP%==1 echo extension=php_mbstring.dll >> php.ini
37+
- IF %PHP%==1 echo extension=php_fileinfo.dll >> php.ini
38+
- IF %PHP%==1 echo @php %%~dp0composer.phar %%* > composer.bat
39+
- appveyor-retry appveyor DownloadFile https://getcomposer.org/composer.phar
40+
- cd c:\projects\php-project-workspace
41+
- composer config --unset platform.php
42+
- IF %dependencies%==lowest appveyor-retry composer update --prefer-lowest --no-progress --profile -n
43+
- IF %dependencies%==current appveyor-retry composer install --no-progress --profile
44+
- IF %dependencies%==highest appveyor-retry composer update --no-progress --profile -n
45+
#- composer show
5146

5247
## Run the actual test
5348
test_script:
54-
- cd c:\projects\php-project-workspace
55-
- vendor/bin/phpunit -c phpunit.xml.dist
49+
- cd c:\projects\php-project-workspace
50+
- vendor/bin/phpunit -c phpunit.xml.dist

composer.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313
}
1414
],
1515
"require": {
16-
"php": "^7.0",
16+
"php": "^7.2",
1717
"api-clients/middleware": "^4.0"
1818
},
1919
"require-dev": {
20+
"api-clients/cs-fixer-config": "^1.1",
2021
"api-clients/test-utilities": "^4.3.0",
2122
"ringcentral/psr7": "^1.2"
2223
},
@@ -33,14 +34,18 @@
3334
"config": {
3435
"sort-packages": true,
3536
"platform": {
36-
"php": "7.0.9"
37+
"php": "7.2"
3738
}
3839
},
3940
"scripts": {
4041
"ensure-installed": "composer install --ansi -n -q",
4142
"cs": [
4243
"@ensure-installed",
43-
"phpcs --standard=PSR2 src/"
44+
"php-cs-fixer fix --config=.php_cs --ansi --dry-run --diff --verbose --allow-risky=yes --show-progress=estimating"
45+
],
46+
"cs-fix": [
47+
"@ensure-installed",
48+
"php-cs-fixer fix --config=.php_cs --ansi --verbose --allow-risky=yes --show-progress=estimating"
4449
],
4550
"unit": [
4651
"@ensure-installed",
@@ -70,9 +75,9 @@
7075
"@unit"
7176
],
7277
"qa-ci": [
73-
"@qa-all"
78+
"@unit"
7479
],
75-
"qa-ci-coverage": [
80+
"qa-ci-extended": [
7681
"@qa-all-coverage"
7782
],
7883
"qa-ci-windows": [

composer.lock

Lines changed: 43 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/PersonalAuthorizationHeaderMiddleware.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace ApiClients\Middleware\PersonalAuthorization;
44

5-
use ApiClients\Foundation\Middleware\DefaultPriorityTrait;
65
use ApiClients\Foundation\Middleware\ErrorTrait;
76
use ApiClients\Foundation\Middleware\MiddlewareInterface;
87
use ApiClients\Foundation\Middleware\PostTrait;
@@ -19,8 +18,8 @@ class PersonalAuthorizationHeaderMiddleware implements MiddlewareInterface
1918
use ErrorTrait;
2019

2120
/**
22-
* @param RequestInterface $request
23-
* @param array $options
21+
* @param RequestInterface $request
22+
* @param array $options
2423
* @return CancellablePromiseInterface
2524
*/
2625
public function pre(

0 commit comments

Comments
 (0)