Skip to content

Commit b87a115

Browse files
committed
Update test tools
1 parent 352e151 commit b87a115

File tree

11 files changed

+17
-39
lines changed

11 files changed

+17
-39
lines changed

.github/workflows/master.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
matrix:
1313
php:
1414
- '8.2'
15+
- '8.3'
1516
steps:
1617
- uses: actions/checkout@v2
1718
with:
@@ -36,6 +37,7 @@ jobs:
3637
run: |
3738
vendor/bin/phpcs src tests
3839
vendor/bin/phpstan analyse -c phpstan.neon
40+
vendor/bin/composer-dependency-analyser
3941
- name: Run tests
4042
run: |
4143
vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover

composer-require-checker.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

composer.json

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@
2828
"inspirum/arrayable": "^1.2"
2929
},
3030
"require-dev": {
31-
"inspirum/coding-standard": "^1.3",
31+
"inspirum/coding-standard": "^1.4",
3232
"phpstan/phpstan": "^1.10",
33-
"phpunit/phpunit": "^10.1",
34-
"squizlabs/php_codesniffer": "^3.7"
33+
"phpunit/phpunit": "^10.3",
34+
"shipmonk/composer-dependency-analyser": "^1.5",
35+
"squizlabs/php_codesniffer": "^3.9"
3536
},
3637
"autoload": {
3738
"psr-4": {
@@ -54,8 +55,7 @@
5455
"@style:phpcs",
5556
"@test:unit",
5657
"@style:phpstan",
57-
"@check:requirement",
58-
"@check:unused"
58+
"@check:dependency"
5959
],
6060
"test:test": [
6161
"@test:unit"
@@ -66,9 +66,6 @@
6666
"test:coverage": [
6767
"@phpunit --coverage-text --coverage-html=var/phpunit/coverage"
6868
],
69-
"test:infection": [
70-
"@infection"
71-
],
7269
"style:phpcs": [
7370
"@phpcs"
7471
],
@@ -82,18 +79,13 @@
8279
"style:fix": [
8380
"@phpcbf src tests"
8481
],
85-
"check:requirement": [
86-
"@composerRequireChecker"
87-
],
88-
"check:unused": [
89-
"@composerUnused"
82+
"check:dependency": [
83+
"@composer-dependency-analyser"
9084
],
9185
"phpunit": "./vendor/bin/phpunit",
9286
"phpcs": "./vendor/bin/phpcs -p -s --extensions=php --colors --report-width=140 || true",
9387
"phpstan": "./vendor/bin/phpstan analyse -c phpstan.neon",
9488
"phpcbf": "./vendor/bin/phpcbf -p --extensions=php",
95-
"infection": "./tools/infection",
96-
"composerRequireChecker": "./tools/composer-require-checker check --config-file=$PWD/composer-require-checker.json",
97-
"composerUnused": "./tools/composer-unused"
89+
"composer-dependency-analyser": "./vendor/bin/composer-dependency-analyser"
9890
}
9991
}

phive.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

phpstan.neon

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,3 @@ parameters:
1111
path: src/Reader/DefaultReader.php
1212
count: 5
1313
reportUnmatched: false
14-
-
15-
message: '#^Method .+\:\:toArray\(\) should return array\<.+\> but returns array\.$#'
16-
path: src/Builder/BaseNode.php
17-
count: 1

phpunit.xml.dist

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
<php>
44
<ini name="display_errors" value="1"/>
55
<ini name="error_reporting" value="-1"/>
6-
<env name="BALIKOBOT_API_USER" value="testUser"/>
7-
<env name="BALIKOBOT_API_KEY" value="testKey1"/>
86
</php>
97
<testsuites>
108
<testsuite name="Unit">

src/Builder/BaseNode.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use DOMException;
1111
use DOMNode;
1212
use DOMText;
13-
use DOMXpath;
13+
use DOMXPath;
1414
use Inspirum\XML\Exception\Handler;
1515
use Inspirum\XML\Formatter\Config;
1616
use Inspirum\XML\Formatter\DefaultConfig;
@@ -301,7 +301,7 @@ private function getAttributesFromNode(DOMNode $node, bool $autoCast = false): a
301301
*/
302302
public function xpath(string $expression): ?array
303303
{
304-
$xpath = new DOMXpath($this->toDOMDocument());
304+
$xpath = new DOMXPath($this->toDOMDocument());
305305

306306
$nodes = $xpath->query($expression);
307307
if ($nodes === false) {

src/Formatter/BaseConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* @param list<string>|true $alwaysArray
1717
*/
1818
public function __construct(
19-
private array | true $alwaysArray = [],
19+
private array|true $alwaysArray = [],
2020
private bool $autoCast = false,
2121
private ?string $attributesName = null,
2222
private ?string $valueName = null,

src/Formatter/FlattenConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* @param list<string>|true $alwaysArray
1111
*/
1212
public function __construct(
13-
array | true $alwaysArray = [],
13+
array|true $alwaysArray = [],
1414
bool $autoCast = false,
1515
private ?string $flattenNodes = null,
1616
private ?string $flattenAttributes = null,

src/Formatter/FullResponseConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* @param list<string>|true $alwaysArray
1111
*/
1212
public function __construct(
13-
array | true $alwaysArray = [],
13+
array|true $alwaysArray = [],
1414
bool $autoCast = false,
1515
?string $attributesName = null,
1616
?string $valueName = null,

tests/Reader/DefaultReaderTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,10 @@ public function testIterateWithSimpleLoadString(string $file, bool $withNamespac
401401

402402
/**
403403
* @param array<list<string>|string> $expected
404+
* @param array<list<string>|string>|null $expectedOverride
404405
*/
405406
#[DataProvider('provideIterateXpath')]
406-
public function testIterateWithXpath(string $file, bool $withNamespaces, string $path, array $expected): void
407+
public function testIterateWithXpath(string $file, bool $withNamespaces, string $path, array $expected, ?array $expectedOverride = null): void
407408
{
408409
$reader = $this->newReader(self::getTestFilePath($file));
409410

0 commit comments

Comments
 (0)