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

Updated test dependencies to fix generated mock class type annotation error #627

Merged
merged 1 commit into from
Apr 28, 2023

Conversation

danielmorell
Copy link
Collaborator

Description of the change

This update increases our minimum required dependencies for two of our test dependencies: phpunit/phpunit and mockery/mockery. Without this we see the following error when trying to install and test the lowest versions of all of our dependencies. See #624 for the failing test results.

PHP Fatal error:  Declaration of Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration::assertPostConditions() 
must be compatible with PHPUnit\Framework\TestCase::assertPostConditions(): void in 
/home/runner/work/rollbar-php/rollbar-php/tests/ConfigTest.php on line 37

Updating only mockery/mockery solves the above issue. However, it introduces a new one. The mock generated from the Data class in...

https://github.com/rollbar/rollbar-php/blob/e7bb5f91921baf4a0e9d08e510c7791aa22b0d5a/tests/VerbosityTest.php#LL397C1-L399C1

Results in one of the generated methods having a type annotation both a ? and |null which is invalid and causes a fatal error during the test run. By updating our version of phpunit/phpunit that issue is resolved.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Maintenance
  • New release

Related issues

None

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
  • "Ready for review" label attached to the PR and reviewers assigned
  • Issue from task tracker has a link to this pull request
  • Changes have been reviewed by at least one other engineer

@danielmorell danielmorell added Type: Bug Fix a component so that its behavior aligns with its documentation. Type: Maintenance General up-keep, or changes that tidy an existing component or process. labels Apr 28, 2023
Copy link
Contributor

@waltjones waltjones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@danielmorell danielmorell merged commit d971895 into master Apr 28, 2023
@danielmorell danielmorell deleted the fixed/invalid-generated-mock branch April 28, 2023 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Fix a component so that its behavior aligns with its documentation. Type: Maintenance General up-keep, or changes that tidy an existing component or process.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants