Skip to content

Commit 89404e9

Browse files
authored
Upgrade to php 84 (#115)
* Since mac runners are missing composer we want to setup php before composer validate * Fixes with paratest 7.3 and phpunit not being compatible from version 10.5.x, later version of paratest are not php8.1 compatible * Upgraded to be compatible php 8.4 and phpunit 12 * Updated README to include php 8.4
1 parent f946318 commit 89404e9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+121
-57
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
- "8.1"
2121
- "8.2"
2222
- "8.3"
23+
- "8.4"
2324
os:
2425
- ubuntu-latest
2526
- windows-latest
@@ -31,9 +32,6 @@ jobs:
3132
- name: Checkout
3233
uses: actions/checkout@v4
3334

34-
- name: Validate composer.json and composer.lock
35-
run: composer validate
36-
3735
- name: Set up PHP ${{ matrix.php-version }}
3836
uses: shivammathur/setup-php@v2
3937
with:
@@ -42,6 +40,9 @@ jobs:
4240
coverage: xdebug
4341
ini-values: error_reporting=E_ALL
4442

43+
- name: Validate composer.json and composer.lock
44+
run: composer validate
45+
4546
- name: Install dependencies
4647
run: composer update
4748
--prefer-dist

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ This adapter only generates JSON files containing information about tests. See [
3535
## Installation && Usage
3636
**Note:** this adapter supports Allure 2.x.x only.
3737

38-
Supported PHP versions: 8.1-8.3.
38+
Supported PHP versions: 8.1-8.4.
3939

4040
In order to use this adapter you need to add a new dependency to your **composer.json** file:
4141
```

composer.json

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,27 @@
2929
"source": "https://github.com/allure-framework/allure-phpunit"
3030
},
3131
"require": {
32-
"php": "~8.1.0 || ~8.2.0 || ~8.3.0",
33-
"allure-framework/allure-php-commons": "^2",
34-
"phpunit/phpunit": "^10"
32+
"php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
33+
"allure-framework/allure-php-commons": "^2.0",
34+
"phpunit/phpunit": "^10 || ^11 || ^12"
3535
},
3636
"require-dev": {
37-
"brianium/paratest": "^7",
38-
"psalm/plugin-phpunit": "^0.18.4",
37+
"phpunit/phpunit": "~10.4.0 || ^11 || ^12",
38+
"brianium/paratest": "^7.3",
39+
"psalm/plugin-phpunit": "^0.19.3",
3940
"squizlabs/php_codesniffer": "^3.7.2",
40-
"vimeo/psalm": "^5.15"
41+
"vimeo/psalm": "^6.9"
4142
},
4243
"conflict": {
4344
"amphp/byte-stream": "<1.5.1",
45+
"amphp/dns": "<2.2.0",
46+
"amphp/socket": "<2.3.1",
47+
"amphp/cache": "<2.0.1",
48+
"amphp/process": "<2.0.3",
49+
"amphp/parser": "<1.1.1",
50+
"daverandom/libdns": "<2.1.0",
51+
"spatie/array-to-xml": "<3.3.0",
52+
"ramsey/uuid": "<4.3.0",
4453
"brianium/paratest": "<7.0.3"
4554
},
4655
"autoload": {

phpunit.10.0.xml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd"
5-
colors="true"
6-
displayDetailsOnIncompleteTests="true"
7-
displayDetailsOnSkippedTests="true"
8-
displayDetailsOnTestsThatTriggerDeprecations="true"
9-
displayDetailsOnTestsThatTriggerWarnings="true"
10-
displayDetailsOnTestsThatTriggerNotices="true"
11-
displayDetailsOnTestsThatTriggerErrors="true"
12-
defaultTestSuite="unit">
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/12.0/phpunit.xsd"
5+
colors="true"
6+
displayDetailsOnIncompleteTests="true"
7+
displayDetailsOnSkippedTests="true"
8+
displayDetailsOnTestsThatTriggerDeprecations="true"
9+
displayDetailsOnTestsThatTriggerWarnings="true"
10+
displayDetailsOnTestsThatTriggerNotices="true"
11+
displayDetailsOnTestsThatTriggerErrors="true"
12+
defaultTestSuite="unit">
1313
<testsuites>
1414
<testsuite name="unit">
1515
<directory>test/unit/</directory>
1616
</testsuite>
1717
</testsuites>
18-
<coverage>
18+
<source>
1919
<include>
2020
<directory suffix=".php">src/</directory>
2121
</include>
22-
</coverage>
22+
</source>
2323
</phpunit>

src/AllureAdapter.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,25 @@ public static function reset(): void
4848
self::$instance = null;
4949
}
5050

51+
#[\Override]
5152
public function resetLastException(): void
5253
{
5354
$this->lastException = null;
5455
}
5556

57+
#[\Override]
5658
public function setLastException(Throwable $e): void
5759
{
5860
$this->lastException = $e;
5961
}
6062

63+
#[\Override]
6164
public function getLastException(): ?Throwable
6265
{
6366
return $this->lastException;
6467
}
6568

69+
#[\Override]
6670
public function registerStart(ContainerResult $containerResult, TestResult $testResult, TestInfo $info): string
6771
{
6872
$this->lastStarts[$info->getTest()] = new TestStartInfo(
@@ -73,6 +77,7 @@ public function registerStart(ContainerResult $containerResult, TestResult $test
7377
return $testResult->getUuid();
7478
}
7579

80+
#[\Override]
7681
public function getContainerId(TestInfo $info): string
7782
{
7883
$startInfo = $this->lastStarts[$info->getTest()] ?? null;
@@ -81,6 +86,7 @@ public function getContainerId(TestInfo $info): string
8186
?? throw new LogicException("Container not registered: {$info->getTest()}");
8287
}
8388

89+
#[\Override]
8490
public function getTestId(TestInfo $info): string
8591
{
8692
$startInfo = $this->lastStarts[$info->getTest()] ?? null;
@@ -89,6 +95,7 @@ public function getTestId(TestInfo $info): string
8995
?? throw new LogicException("Test not registered: {$info->getTest()}");
9096
}
9197

98+
#[\Override]
9299
public function registerRun(TestResult $testResult, TestInfo $info): TestRunInfo
93100
{
94101
$testCaseId = $this->buildTestCaseId($testResult, $info);

src/AllureExtension.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ private function loadConfigData(?string $configFile): array
9090
return [];
9191
}
9292

93+
#[\Override]
9394
public function bootstrap(Configuration $configuration, Facade $facade, ParameterCollection $parameters): void
9495
{
9596
$configSource = $parameters->has('config')

src/Event/TestConsideredRiskySubscriber.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public function __construct(
1717
) {
1818
}
1919

20+
#[\Override]
2021
public function notify(ConsideredRisky $event): void
2122
{
2223
$test = $event->test();

src/Event/TestErroredSubscriber.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public function __construct(
1717
) {
1818
}
1919

20+
#[\Override]
2021
public function notify(Errored $event): void
2122
{
2223
$test = $event->test();

src/Event/TestFailedSubscriber.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public function __construct(
1717
) {
1818
}
1919

20+
#[\Override]
2021
public function notify(Failed $event): void
2122
{
2223
$test = $event->test();

src/Event/TestFinishedSubscriber.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public function __construct(
1616
) {
1717
}
1818

19+
#[\Override]
1920
public function notify(Finished $event): void
2021
{
2122
$test = $event->test();

0 commit comments

Comments
 (0)