|
72 | 72 | use PHPUnit\Framework\MockObject\Rule\InvokedAtMostCount as InvokedAtMostCountMatcher;
|
73 | 73 | use PHPUnit\Framework\MockObject\Rule\InvokedCount as InvokedCountMatcher;
|
74 | 74 | use PHPUnit\Framework\MockObject\Stub;
|
75 |
| -use PHPUnit\Framework\MockObject\Stub\ConsecutiveCalls as ConsecutiveCallsStub; |
76 | 75 | use PHPUnit\Framework\MockObject\Stub\Exception as ExceptionStub;
|
77 |
| -use PHPUnit\Framework\MockObject\Stub\ReturnArgument as ReturnArgumentStub; |
78 |
| -use PHPUnit\Framework\MockObject\Stub\ReturnCallback as ReturnCallbackStub; |
79 |
| -use PHPUnit\Framework\MockObject\Stub\ReturnSelf as ReturnSelfStub; |
80 |
| -use PHPUnit\Framework\MockObject\Stub\ReturnStub; |
81 |
| -use PHPUnit\Framework\MockObject\Stub\ReturnValueMap as ReturnValueMapStub; |
82 | 76 | use PHPUnit\Framework\TestSize\TestSize;
|
83 | 77 | use PHPUnit\Framework\TestStatus\TestStatus;
|
84 | 78 | use PHPUnit\Metadata\Api\Groups;
|
@@ -966,96 +960,11 @@ final protected function atMost(int $allowedInvocations): InvokedAtMostCountMatc
|
966 | 960 | return new InvokedAtMostCountMatcher($allowedInvocations);
|
967 | 961 | }
|
968 | 962 |
|
969 |
| - /** |
970 |
| - * @deprecated Use <code>$double->willReturn()</code> instead of <code>$double->will($this->returnValue())</code> |
971 |
| - * @see https://github.com/sebastianbergmann/phpunit/issues/5423 |
972 |
| - */ |
973 |
| - final protected function returnValue(mixed $value): ReturnStub |
974 |
| - { |
975 |
| - Event\Facade::emitter()->testTriggeredPhpunitDeprecation( |
976 |
| - $this->valueObjectForEvents(), |
977 |
| - 'returnValue() is deprecated and will be removed in PHPUnit 12. Use $double->willReturn() instead of $double->will($this->returnValue())', |
978 |
| - ); |
979 |
| - |
980 |
| - return new ReturnStub($value); |
981 |
| - } |
982 |
| - |
983 |
| - /** |
984 |
| - * @deprecated Use <code>$double->willReturnMap()</code> instead of <code>$double->will($this->returnValueMap())</code> |
985 |
| - * @see https://github.com/sebastianbergmann/phpunit/issues/5423 |
986 |
| - */ |
987 |
| - final protected function returnValueMap(array $valueMap): ReturnValueMapStub |
988 |
| - { |
989 |
| - Event\Facade::emitter()->testTriggeredPhpunitDeprecation( |
990 |
| - $this->valueObjectForEvents(), |
991 |
| - 'returnValueMap() is deprecated and will be removed in PHPUnit 12. Use $double->willReturnMap() instead of $double->will($this->returnValueMap())', |
992 |
| - ); |
993 |
| - |
994 |
| - return new ReturnValueMapStub($valueMap); |
995 |
| - } |
996 |
| - |
997 |
| - /** |
998 |
| - * @deprecated Use <code>$double->willReturnArgument()</code> instead of <code>$double->will($this->returnArgument())</code> |
999 |
| - * @see https://github.com/sebastianbergmann/phpunit/issues/5423 |
1000 |
| - */ |
1001 |
| - final protected function returnArgument(int $argumentIndex): ReturnArgumentStub |
1002 |
| - { |
1003 |
| - Event\Facade::emitter()->testTriggeredPhpunitDeprecation( |
1004 |
| - $this->valueObjectForEvents(), |
1005 |
| - 'returnArgument() is deprecated and will be removed in PHPUnit 12. Use $double->willReturnArgument() instead of $double->will($this->returnArgument())', |
1006 |
| - ); |
1007 |
| - |
1008 |
| - return new ReturnArgumentStub($argumentIndex); |
1009 |
| - } |
1010 |
| - |
1011 |
| - /** |
1012 |
| - * @deprecated Use <code>$double->willReturnCallback()</code> instead of <code>$double->will($this->returnCallback())</code> |
1013 |
| - * @see https://github.com/sebastianbergmann/phpunit/issues/5423 |
1014 |
| - */ |
1015 |
| - final protected function returnCallback(callable $callback): ReturnCallbackStub |
1016 |
| - { |
1017 |
| - Event\Facade::emitter()->testTriggeredPhpunitDeprecation( |
1018 |
| - $this->valueObjectForEvents(), |
1019 |
| - 'returnCallback() is deprecated and will be removed in PHPUnit 12. Use $double->willReturnCallback() instead of $double->will($this->returnCallback())', |
1020 |
| - ); |
1021 |
| - |
1022 |
| - return new ReturnCallbackStub($callback); |
1023 |
| - } |
1024 |
| - |
1025 |
| - /** |
1026 |
| - * @deprecated Use <code>$double->willReturnSelf()</code> instead of <code>$double->will($this->returnSelf())</code> |
1027 |
| - * @see https://github.com/sebastianbergmann/phpunit/issues/5423 |
1028 |
| - */ |
1029 |
| - final protected function returnSelf(): ReturnSelfStub |
1030 |
| - { |
1031 |
| - Event\Facade::emitter()->testTriggeredPhpunitDeprecation( |
1032 |
| - $this->valueObjectForEvents(), |
1033 |
| - 'returnSelf() is deprecated and will be removed in PHPUnit 12. Use $double->willReturnSelf() instead of $double->will($this->returnSelf())', |
1034 |
| - ); |
1035 |
| - |
1036 |
| - return new ReturnSelfStub; |
1037 |
| - } |
1038 |
| - |
1039 | 963 | final protected function throwException(Throwable $exception): ExceptionStub
|
1040 | 964 | {
|
1041 | 965 | return new ExceptionStub($exception);
|
1042 | 966 | }
|
1043 | 967 |
|
1044 |
| - /** |
1045 |
| - * @deprecated Use <code>$double->willReturn()</code> instead of <code>$double->will($this->onConsecutiveCalls())</code> |
1046 |
| - * @see https://github.com/sebastianbergmann/phpunit/issues/5423 |
1047 |
| - * @see https://github.com/sebastianbergmann/phpunit/issues/5425 |
1048 |
| - */ |
1049 |
| - final protected function onConsecutiveCalls(mixed ...$arguments): ConsecutiveCallsStub |
1050 |
| - { |
1051 |
| - Event\Facade::emitter()->testTriggeredPhpunitDeprecation( |
1052 |
| - $this->valueObjectForEvents(), |
1053 |
| - 'onConsecutiveCalls() is deprecated and will be removed in PHPUnit 12. Use $double->willReturn() instead of $double->will($this->onConsecutiveCalls())', |
1054 |
| - ); |
1055 |
| - |
1056 |
| - return new ConsecutiveCallsStub($arguments); |
1057 |
| - } |
1058 |
| - |
1059 | 968 | final protected function getActualOutputForAssertion(): string
|
1060 | 969 | {
|
1061 | 970 | $this->outputRetrievedForAssertion = true;
|
|
0 commit comments