-
Notifications
You must be signed in to change notification settings - Fork 8
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
upgrade PHPUnit to version 10 #22
Conversation
From the [PHPUnit 8 release notes][1], the `TestCase` methods below now declare a `void` return type: - `setUpBeforeClass()` - `setUp()` - `assertPreConditions()` - `assertPostConditions()` - `tearDown()` - `tearDownAfterClass()` - `onNotSuccessfulTest()` [1]: https://phpunit.de/announcements/phpunit-8.html
@@ -33,4 +33,4 @@ jobs: | |||
run: composer install --prefer-dist --no-interaction | |||
|
|||
- name: Execute tests | |||
run: vendor/bin/phpunit --verbose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flag has been removed
stopOnFailure="false" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" | ||
> | ||
bootstrap="vendor/autoload.php" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
config upgraded using PHPUnit --migrate-configuration
flag
{ | ||
/** @test */ | ||
#[Test] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
annotation is replaced by an attribute
@@ -10,7 +10,7 @@ | |||
|
|||
abstract class TestCase extends Orchestra | |||
{ | |||
public function setUp(): void | |||
protected function setUp(): void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
access modifier has changed in PHPUnit 10
6182328
to
a6da785
Compare
@@ -33,4 +33,4 @@ jobs: | |||
run: composer install --prefer-dist --no-interaction | |||
|
|||
- name: Execute tests | |||
run: vendor/bin/phpunit --verbose | |||
run: vendor/bin/phpunit --no-coverage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added the --no-coverage
flag to override the configured coverage config
@@ -32,19 +33,7 @@ public function it_wont_set_headers_if_it_is_not_enabled_in_the_config(): void | |||
$this->get('test-route')->assertHeaderMissing('Permissions-Policy'); | |||
} | |||
|
|||
/** @test */ | |||
public function it_throws_an_invalid_policy_class_exception_when_using_an_invalid_policy(): void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is more likely an framework issue and not one that a package should check for
@@ -80,6 +80,13 @@ jobs: | |||
- name: Install Composer dependencies | |||
run: composer install --prefer-dist --no-interaction | |||
|
|||
- name: Rector Cache |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the CI cache the cache for Rector
@@ -26,6 +27,9 @@ | |||
__DIR__ . '/tests', | |||
]); | |||
|
|||
$rectorConfig->cacheClass(FileCacheStorage::class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set Rector to use file based storage
What does this pull request change or introduce
PHPUnit 10 upgrade
What is the impact of these changes
Running tests
Checklist
Steps to reproduce / test
Run the tests