Skip to content

Commit

Permalink
Update supported php versions and phpunit
Browse files Browse the repository at this point in the history
  • Loading branch information
samizdam committed Nov 23, 2024
1 parent 5a2e7f2 commit c9a0e2e
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 29 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ jobs:
strategy:
matrix:
php:
- 8.0
- 8.1
- 8.2
- 8.3
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/.idea/

/.phpunit.result.cache
/.phpunit.cache/

/composer.lock

Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Best composer dependencies compatibility: allow more versions

## Removed
- php 7.4 support
- php 7.4 and 8.0 support

## [0.0.14] - 2021-02-02
### Added
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"require-dev": {
"helmich/phpunit-psr7-assert": "^4",
"nyholm/psr7": "^1.2",
"phpunit/phpunit": "^9.0"
"phpunit/phpunit": "^10.0|^11.0"
},
"suggest": {
"doctrine/orm": "^2.7",
Expand Down
49 changes: 32 additions & 17 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,19 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">src/</directory>
</include>
<report>
<html outputDirectory="_coverage" lowUpperBound="70" highLowerBound="99"/>
<text outputFile="php://stdout"/>
</report>
</coverage>
<php>
<ini name="error_reporting" value="E_ALL"/>
</php>
<testsuite name="">
<directory>tests/</directory>
</testsuite>
<logging/>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
bootstrap="vendor/autoload.php"
cacheDirectory=".phpunit.cache"
executionOrder="depends,defects"
requireCoverageMetadata="false"
beStrictAboutCoverageMetadata="true"
beStrictAboutOutputDuringTests="true"
displayDetailsOnPhpunitDeprecations="true"
failOnPhpunitDeprecation="true"
failOnRisky="true"
failOnWarning="true">
<testsuites>
<testsuite name="default">
<directory>tests</directory>
</testsuite>
</testsuites>

<source restrictDeprecations="true" restrictNotices="true" restrictWarnings="true">
<include>
<directory>src</directory>
</include>
</source>


<coverage includeUncoveredFiles="true">
<report>
<html outputDirectory="_coverage" lowUpperBound="70" highLowerBound="99"/>
<text outputFile="php://stdout"/>
</report>
</coverage>

</phpunit>
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ public function testCreateCorrect(string $path, RouteRulesProvider $routeRulesPr
$this->assertTrue(is_a($actual, $expected));
}

public function correctDataProvider()
public static function correctDataProvider(): array
{
$routeRulesProviderWithoutApiVersion = $this->getRouteRulesProviderWithoutApiVersion();
$routeRulesProviderWithApiVersion = $this->getRouteRulesProviderWithApiVersion();
$routeRulesProviderWithoutApiVersion = self::getRouteRulesProviderWithoutApiVersion();
$routeRulesProviderWithApiVersion = self::getRouteRulesProviderWithApiVersion();
$uuid = Uuid::uuid4()->toString();

return [
Expand All @@ -49,10 +49,10 @@ public function testCreateIncorrect(string $path, RouteRulesProvider $routeRules
$factory->create($path);
}

public function incorrectDataProvider()
public static function incorrectDataProvider(): array
{
$routeRulesProviderWithoutApiVersion = $this->getRouteRulesProviderWithoutApiVersion();
$routeRulesProviderWithApiVersion = $this->getRouteRulesProviderWithApiVersion();
$routeRulesProviderWithoutApiVersion = self::getRouteRulesProviderWithoutApiVersion();
$routeRulesProviderWithApiVersion = self::getRouteRulesProviderWithApiVersion();
$uuid = Uuid::uuid4()->toString();

return [
Expand Down Expand Up @@ -91,7 +91,7 @@ private function getMappingProvider(): MappingConfigProvider
);
}

private function getRouteRulesProviderWithoutApiVersion(): RouteRulesProvider
private static function getRouteRulesProviderWithoutApiVersion(): RouteRulesProvider
{
$resourceRegex = '([a-z][A-Za-z\d]+)';
$hexRegex = '[\da-f]';
Expand All @@ -108,7 +108,7 @@ private function getRouteRulesProviderWithoutApiVersion(): RouteRulesProvider
);
}

private function getRouteRulesProviderWithApiVersion(): RouteRulesProvider
private static function getRouteRulesProviderWithApiVersion(): RouteRulesProvider
{
$versionRegex = '(v\d+)';
$resourceRegex = '([a-z][A-Za-z\d]+)';
Expand Down

0 comments on commit c9a0e2e

Please sign in to comment.