Skip to content

Update to phpunit 10 #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 3.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"require": {
"php": ">=8.1",
"amphp/amp": "^3",
"phpunit/phpunit": "^9",
"phpunit/phpunit": "^10",
"revolt/event-loop": "^1 || ^0.2"
},
"require-dev": {
Expand Down
41 changes: 15 additions & 26 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,28 +1,17 @@
<?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"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
>
<testsuites>
<testsuite name="Main">
<directory>test</directory>
</testsuite>
<testsuite name="PHPT tests">
<directory suffix=".phpt">test</directory>
</testsuite>
</testsuites>
<coverage>
<include>
<directory suffix=".php">src</directory>
</include>
</coverage>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<testsuites>
<testsuite name="Main">
<directory>test</directory>
</testsuite>
<testsuite name="PHPT tests">
<directory suffix=".phpt">test</directory>
</testsuite>
</testsuites>
<coverage/>
<source>
<include>
<directory suffix=".php">src</directory>
</include>
</source>
</phpunit>
10 changes: 1 addition & 9 deletions src/AsyncTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,6 @@ abstract class AsyncTestCase extends PHPUnitTestCase

private bool $setUpInvoked = false;

/**
* @codeCoverageIgnore Invoked before code coverage data is being collected.
*/
final public function setName(string $name): void
{
parent::setName($name);
$this->realTestName = $name;
}

protected function setUp(): void
{
$this->setUpInvoked = true;
Expand Down Expand Up @@ -114,6 +105,7 @@ final protected function runAsyncTest(mixed ...$args): mixed

final protected function runTest(): mixed
{
$this->realTestName = $this->name();
parent::setName('runAsyncTest');
return parent::runTest();
}
Expand Down
2 changes: 1 addition & 1 deletion test/AsyncTestCaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function testExpectingAnErrorThrown(): Future
});
}

public function provideArguments(): array
public static function provideArguments(): array
{
return [
['foo', 42, true],
Expand Down