Skip to content

Commit ee73f87

Browse files
Closes #5424
1 parent 0e1f810 commit ee73f87

File tree

1 file changed

+0
-91
lines changed

1 file changed

+0
-91
lines changed

src/Framework/TestCase.php

Lines changed: 0 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,7 @@
7272
use PHPUnit\Framework\MockObject\Rule\InvokedAtMostCount as InvokedAtMostCountMatcher;
7373
use PHPUnit\Framework\MockObject\Rule\InvokedCount as InvokedCountMatcher;
7474
use PHPUnit\Framework\MockObject\Stub;
75-
use PHPUnit\Framework\MockObject\Stub\ConsecutiveCalls as ConsecutiveCallsStub;
7675
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;
8276
use PHPUnit\Framework\TestSize\TestSize;
8377
use PHPUnit\Framework\TestStatus\TestStatus;
8478
use PHPUnit\Metadata\Api\Groups;
@@ -966,96 +960,11 @@ final protected function atMost(int $allowedInvocations): InvokedAtMostCountMatc
966960
return new InvokedAtMostCountMatcher($allowedInvocations);
967961
}
968962

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-
1039963
final protected function throwException(Throwable $exception): ExceptionStub
1040964
{
1041965
return new ExceptionStub($exception);
1042966
}
1043967

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-
1059968
final protected function getActualOutputForAssertion(): string
1060969
{
1061970
$this->outputRetrievedForAssertion = true;

0 commit comments

Comments
 (0)