Skip to content

Commit 2adff26

Browse files
authored
Migrate the testsuite to PHPUnit 11 (#1977)
1 parent bae8dbb commit 2adff26

File tree

5 files changed

+22
-11
lines changed

5 files changed

+22
-11
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ jobs:
3131
- name: Download dependencies
3232
run: |
3333
composer config minimum-stability dev
34-
composer req symfony/phpunit-bridge --no-update
3534
composer update --no-interaction --prefer-dist --optimize-autoloader --prefer-stable
3635
3736
- name: Run tests
38-
run: ./vendor/bin/simple-phpunit
37+
run: ./vendor/bin/phpunit

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ start-docker:
55
echo "Noop"
66

77
test: initialize
8-
./vendor/bin/simple-phpunit
8+
./vendor/bin/phpunit
99

1010
clean: stop-docker
1111
stop-docker:

composer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
"async-aws/core": "^1.9",
1818
"symfony/polyfill-uuid": "^1.13.1"
1919
},
20+
"require-dev": {
21+
"phpunit/phpunit": "^11.5.42",
22+
"symfony/error-handler": "^7.3.2 || ^8.0",
23+
"symfony/phpunit-bridge": "^7.3.2 || ^8.0"
24+
},
2025
"autoload": {
2126
"psr-4": {
2227
"AsyncAws\\Athena\\": "src"

phpunit.xml.dist

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd"
44
backupGlobals="false"
55
colors="true"
66
bootstrap="vendor/autoload.php"
77
failOnRisky="true"
88
failOnWarning="true"
9+
failOnDeprecation="true"
10+
failOnNotice="true"
911
>
10-
<coverage>
12+
<source ignoreSuppressionOfDeprecations="true">
1113
<include>
1214
<directory>./src</directory>
1315
</include>
14-
</coverage>
16+
<deprecationTrigger>
17+
<function>trigger_deprecation</function>
18+
</deprecationTrigger>
19+
</source>
1520
<php>
1621
<ini name="error_reporting" value="-1"/>
1722
</php>
@@ -20,4 +25,7 @@
2025
<directory>./tests/</directory>
2126
</testsuite>
2227
</testsuites>
28+
<extensions>
29+
<bootstrap class="Symfony\Bridge\PhpUnit\SymfonyExtension"/>
30+
</extensions>
2331
</phpunit>

tests/Unit/Input/StartCalculationExecutionRequestTest.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,11 @@
55
use AsyncAws\Athena\Input\StartCalculationExecutionRequest;
66
use AsyncAws\Athena\ValueObject\CalculationConfiguration;
77
use AsyncAws\Core\Test\TestCase;
8+
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
89

910
class StartCalculationExecutionRequestTest extends TestCase
1011
{
11-
/**
12-
* @group legacy
13-
*
14-
* @expectedDeprecation The property "CalculationConfiguration" of "%s" is deprecated by AWS.
15-
*/
12+
#[IgnoreDeprecations]
1613
public function testRequest(): void
1714
{
1815
$input = new StartCalculationExecutionRequest([
@@ -43,6 +40,8 @@ public function testRequest(): void
4340
}
4441
';
4542

43+
$this->expectUserDeprecationMessage('The property "CalculationConfiguration" of "AsyncAws\Athena\Input\StartCalculationExecutionRequest" is deprecated by AWS.');
44+
4645
self::assertRequestEqualsHttpRequest($expected, $input->request());
4746
}
4847
}

0 commit comments

Comments
 (0)