Skip to content
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

Merged
merged 11 commits into from
Apr 7, 2023
Merged

upgrade PHPUnit to version 10 #22

merged 11 commits into from
Apr 7, 2023

Conversation

Treggats
Copy link
Collaborator

@Treggats Treggats commented Apr 6, 2023

What does this pull request change or introduce

PHPUnit 10 upgrade

What is the impact of these changes

Running tests

Checklist

  • An issue was created before proposing this change
  • Tests for the changes have been added
  • Tests are passing

Steps to reproduce / test

Run the tests

laravel-shift and others added 7 commits April 6, 2023 22:50
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
@Treggats Treggats self-assigned this Apr 6, 2023
@@ -33,4 +33,4 @@ jobs:
run: composer install --prefer-dist --no-interaction

- name: Execute tests
run: vendor/bin/phpunit --verbose
Copy link
Collaborator Author

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"
Copy link
Collaborator Author

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]
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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

@Treggats Treggats force-pushed the shift-87713 branch 2 times, most recently from 6182328 to a6da785 Compare April 6, 2023 23:15
@@ -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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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);
Copy link
Collaborator Author

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

@Treggats Treggats changed the title [draft] upgrade PHPUnit to version 10 upgrade PHPUnit to version 10 Apr 6, 2023
@Treggats Treggats requested a review from mazedlx April 6, 2023 23:26
@Treggats Treggats marked this pull request as ready for review April 6, 2023 23:26
@mazedlx mazedlx merged commit c55e163 into mazedlx:main Apr 7, 2023
@Treggats Treggats deleted the shift-87713 branch April 7, 2023 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants