Skip to content

Commit

Permalink
Update test tools
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas-novotny committed Apr 20, 2024
1 parent 352e151 commit b87a115
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 39 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
matrix:
php:
- '8.2'
- '8.3'
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -36,6 +37,7 @@ jobs:
run: |
vendor/bin/phpcs src tests
vendor/bin/phpstan analyse -c phpstan.neon
vendor/bin/composer-dependency-analyser
- name: Run tests
run: |
vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
Expand Down
5 changes: 0 additions & 5 deletions composer-require-checker.json

This file was deleted.

24 changes: 8 additions & 16 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@
"inspirum/arrayable": "^1.2"
},
"require-dev": {
"inspirum/coding-standard": "^1.3",
"inspirum/coding-standard": "^1.4",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.1",
"squizlabs/php_codesniffer": "^3.7"
"phpunit/phpunit": "^10.3",
"shipmonk/composer-dependency-analyser": "^1.5",
"squizlabs/php_codesniffer": "^3.9"
},
"autoload": {
"psr-4": {
Expand All @@ -54,8 +55,7 @@
"@style:phpcs",
"@test:unit",
"@style:phpstan",
"@check:requirement",
"@check:unused"
"@check:dependency"
],
"test:test": [
"@test:unit"
Expand All @@ -66,9 +66,6 @@
"test:coverage": [
"@phpunit --coverage-text --coverage-html=var/phpunit/coverage"
],
"test:infection": [
"@infection"
],
"style:phpcs": [
"@phpcs"
],
Expand All @@ -82,18 +79,13 @@
"style:fix": [
"@phpcbf src tests"
],
"check:requirement": [
"@composerRequireChecker"
],
"check:unused": [
"@composerUnused"
"check:dependency": [
"@composer-dependency-analyser"
],
"phpunit": "./vendor/bin/phpunit",
"phpcs": "./vendor/bin/phpcs -p -s --extensions=php --colors --report-width=140 || true",
"phpstan": "./vendor/bin/phpstan analyse -c phpstan.neon",
"phpcbf": "./vendor/bin/phpcbf -p --extensions=php",
"infection": "./tools/infection",
"composerRequireChecker": "./tools/composer-require-checker check --config-file=$PWD/composer-require-checker.json",
"composerUnused": "./tools/composer-unused"
"composer-dependency-analyser": "./vendor/bin/composer-dependency-analyser"
}
}
6 changes: 0 additions & 6 deletions phive.xml

This file was deleted.

4 changes: 0 additions & 4 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,3 @@ parameters:
path: src/Reader/DefaultReader.php
count: 5
reportUnmatched: false
-
message: '#^Method .+\:\:toArray\(\) should return array\<.+\> but returns array\.$#'
path: src/Builder/BaseNode.php
count: 1
2 changes: 0 additions & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
<php>
<ini name="display_errors" value="1"/>
<ini name="error_reporting" value="-1"/>
<env name="BALIKOBOT_API_USER" value="testUser"/>
<env name="BALIKOBOT_API_KEY" value="testKey1"/>
</php>
<testsuites>
<testsuite name="Unit">
Expand Down
4 changes: 2 additions & 2 deletions src/Builder/BaseNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use DOMException;
use DOMNode;
use DOMText;
use DOMXpath;
use DOMXPath;
use Inspirum\XML\Exception\Handler;
use Inspirum\XML\Formatter\Config;
use Inspirum\XML\Formatter\DefaultConfig;
Expand Down Expand Up @@ -301,7 +301,7 @@ private function getAttributesFromNode(DOMNode $node, bool $autoCast = false): a
*/
public function xpath(string $expression): ?array
{
$xpath = new DOMXpath($this->toDOMDocument());
$xpath = new DOMXPath($this->toDOMDocument());

$nodes = $xpath->query($expression);
if ($nodes === false) {
Expand Down
2 changes: 1 addition & 1 deletion src/Formatter/BaseConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @param list<string>|true $alwaysArray
*/
public function __construct(
private array | true $alwaysArray = [],
private array|true $alwaysArray = [],
private bool $autoCast = false,
private ?string $attributesName = null,
private ?string $valueName = null,
Expand Down
2 changes: 1 addition & 1 deletion src/Formatter/FlattenConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @param list<string>|true $alwaysArray
*/
public function __construct(
array | true $alwaysArray = [],
array|true $alwaysArray = [],
bool $autoCast = false,
private ?string $flattenNodes = null,
private ?string $flattenAttributes = null,
Expand Down
2 changes: 1 addition & 1 deletion src/Formatter/FullResponseConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @param list<string>|true $alwaysArray
*/
public function __construct(
array | true $alwaysArray = [],
array|true $alwaysArray = [],
bool $autoCast = false,
?string $attributesName = null,
?string $valueName = null,
Expand Down
3 changes: 2 additions & 1 deletion tests/Reader/DefaultReaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,10 @@ public function testIterateWithSimpleLoadString(string $file, bool $withNamespac

/**
* @param array<list<string>|string> $expected
* @param array<list<string>|string>|null $expectedOverride
*/
#[DataProvider('provideIterateXpath')]
public function testIterateWithXpath(string $file, bool $withNamespaces, string $path, array $expected): void
public function testIterateWithXpath(string $file, bool $withNamespaces, string $path, array $expected, ?array $expectedOverride = null): void
{
$reader = $this->newReader(self::getTestFilePath($file));

Expand Down

0 comments on commit b87a115

Please sign in to comment.