Fix phpunit 10 deprecations

Created on 2 November 2023, about 1 year ago
Updated 21 June 2024, 6 months ago

Problem/Motivation

Fix phpunit 10 deprecations

To reduce complexity inside PHPUnit's test double functionality, these methods will be deprecated and then removed:

  • TestCase::returnValue() (use $double->willReturn() instead of $double->will($this->returnValue()))
  • TestCase::onConsecutiveCalls() (use $double->willReturn() instead of $double->will($this->onConsecutiveCalls()))
  • TestCase::returnValueMap() (use $double->willReturnMap() instead of $double->will($this->returnValueMap()))
  • TestCase::returnArgument() (use $double->willReturnArgument() instead of $double->will($this->returnArgument()))
  • TestCase::returnSelf() (use $double->willReturnSelf() instead of $double->will($this->returnSelf()))
  • TestCase::returnCallback() (use $double->willReturnCallback() instead of $double->will($this->returnCallback()))
  • TestCase::throwException() (use $double->willThrowException() instead of $double->will($this->throwException()))

Timeline

soft deprecation in PHPUnit 10.3 (add @deprecated annotation to the method declaration)
deprecation in PHPUnit 11 (using the method will trigger a deprecation)
removal in PHPUnit 12

https://github.com/sebastianbergmann/phpunit/issues/5423

πŸ“Œ Task
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡¨πŸ‡·Costa Rica yuvania

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024