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

Update to support PHP 8.0 #6

Merged
merged 1 commit into from
Mar 22, 2021

Conversation

weierophinney
Copy link
Member

  • Adds ~8.0.0 to PHP constraint
  • Makes minimum supported PHP version 7.3
  • Updates PHPUnit version to 9.3 and php-mock-phpunit to 2.0
    • Updates phpunit.xml.dist to 9.3 schema
    • Updates unit tests to work with PHPUnit 9.3
    • Removes all prophecy usage in favor of phpunit mock objects

@weierophinney weierophinney linked an issue Mar 22, 2021 that may be closed by this pull request
6 tasks
@weierophinney weierophinney added this to the 2.2.0 milestone Mar 22, 2021
- Adds `~8.0.0` to PHP constraint
- Makes minimum supported PHP version 7.3
- Updates PHPUnit version to 9.3, php-mock-phpunit to 2.0, and vfsStream to 1.6.7
  - Updates phpunit.xml.dist to 9.3 schema
  - Updates unit tests to work with PHPUnit 9.3
  - Removes all prophecy usage in favor of phpunit mock objects

Signed-off-by: Matthew Weier O'Phinney <matthew@weierophinney.net>
@weierophinney weierophinney force-pushed the feature/php-8-support branch from be713d3 to 1bd4706 Compare March 22, 2021 20:39
"new": "content"
}
EOC;
Copy link
Member Author

Choose a reason for hiding this comment

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

PHP 7.3 indented now/heredocs FTW!

Comment on lines -335 to +356
->writeLine(Argument::containingString('Autoloading rules already exist for the module "App"'))
->shouldBeCalled();
$this->assertNotHelpOutput(STDERR);
->expects($this->once())
->method('writeLine')
->with('Autoloading rules already exist for the module "App"');
Copy link
Member Author

Choose a reason for hiding this comment

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

This and other methods where I remove the call to either assertNotHelpOutput() or assertHelpOutput() were cases where I hit a serialization bug in PHPUnit that exists due to how mock object constraints are created. Most of these have a closure memoized internally, and these cannot be serialized, which raises an error. The only way I could get tests to run for these was to:

  • Assert an exact number of invocations.
  • Use exact expectations for arguments (vs using a constraint method like stringContains()).

Since I'm now asserting that writeLine() is called an exact number of times, I know that the help output is NOT being created, allowing me to remove that assertion (and that assertion, because it essentially required a stringContains() comparison to be readable, was causing the seriailzation error).

@weierophinney weierophinney merged commit b37fc8d into laminas:2.2.x Mar 22, 2021
@weierophinney weierophinney deleted the feature/php-8-support branch March 22, 2021 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PHP 8.0 support
1 participant