Skip to content

Commit efc07cb

Browse files
committed
Updated test utilities
1 parent e761c3c commit efc07cb

File tree

11 files changed

+1007
-161
lines changed

11 files changed

+1007
-161
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+
})();

Makefile

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
11
all:
2-
composer qa-all
2+
composer run-script qa-all --timeout=0
3+
4+
all-coverage:
5+
composer run-script qa-all-coverage --timeout=0
36

47
ci:
5-
composer qa-ci
8+
composer run-script qa-ci --timeout=0
9+
10+
ci-extended:
11+
composer run-script qa-ci-extended --timeout=0
612

713
contrib:
8-
composer qa-contrib
14+
composer run-script qa-contrib --timeout=0
915

1016
init:
1117
composer ensure-installed
1218

1319
cs:
1420
composer cs
1521

22+
cs-fix:
23+
composer cs-fix
24+
1625
unit:
17-
composer unit
26+
composer run-script unit --timeout=0
27+
28+
unit-coverage:
29+
composer run-script unit-coverage --timeout=0
1830

1931
ci-coverage: init
2032
composer ci-coverage

composer.json

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@
1313
"api-clients/hydrator": "^1.0.1",
1414
"api-clients/middleware": "^4.0 || ^3.0 || ^2.0 || ^1.1",
1515
"api-clients/transport": "^3.0 || ^2.0 || ^1.0",
16-
"league/event": "^2.1",
1716
"php-di/php-di": "^5.4.3",
1817
"psr/container": "^1.0"
1918
},
2019
"require-dev": {
21-
"api-clients/test-utilities": "^3.0.1"
20+
"api-clients/test-utilities": "^4.1"
2221
},
2322
"suggest": {
2423
"api-clients/resource-generator": "Easy wireframing of resources"
@@ -47,22 +46,44 @@
4746
"ensure-installed": "composer install --ansi -n -q",
4847
"cs": [
4948
"@ensure-installed",
50-
"phpcs --standard=PSR2 src/"
49+
"php-cs-fixer fix --config=.php_cs --ansi --dry-run --diff --verbose --allow-risky=yes --show-progress=estimating"
50+
],
51+
"cs-fix": [
52+
"@ensure-installed",
53+
"php-cs-fixer fix --config=.php_cs --ansi --verbose --allow-risky=yes --show-progress=estimating"
5154
],
5255
"unit": [
5356
"@ensure-installed",
54-
"phpunit --colors=always -c phpunit.xml.dist --coverage-text --coverage-html covHtml"
57+
"phpunit --colors=always -c phpunit.xml.dist"
58+
],
59+
"unit-coverage": [
60+
"@ensure-installed",
61+
"phpunit --colors=always -c phpunit.xml.dist --coverage-text --coverage-html covHtml --coverage-clover ./build/logs/clover.xml"
62+
],
63+
"lint-php": [
64+
"@ensure-installed",
65+
"parallel-lint --exclude vendor ."
5566
],
5667
"qa-all": [
68+
"@lint-php",
5769
"@cs",
5870
"@unit"
5971
],
72+
"qa-all-coverage": [
73+
"@lint-php",
74+
"@cs",
75+
"@unit-coverage"
76+
],
6077
"qa-windows": [
78+
"@lint-php",
6179
"@cs",
6280
"@unit"
6381
],
6482
"qa-ci": [
65-
"@qa-all"
83+
"@unit"
84+
],
85+
"qa-ci-extended": [
86+
"@qa-all-coverage"
6687
],
6788
"qa-ci-windows": [
6889
"@qa-windows"

0 commit comments

Comments
 (0)