-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
feature/test-doublesTest Stubs and Mock ObjectsTest Stubs and Mock Objectstype/deprecationSomething will be/is deprecatedSomething will be/is deprecated
Milestone
Description
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
@deprecatedannotation to the method declaration) - deprecation in PHPUnit 11 (using the method will trigger a deprecation)
- removal in PHPUnit 12
williamdes and enterlight
Metadata
Metadata
Assignees
Labels
feature/test-doublesTest Stubs and Mock ObjectsTest Stubs and Mock Objectstype/deprecationSomething will be/is deprecatedSomething will be/is deprecated