Skip to content

Commit 8197dbc

Browse files
Revert "Introduce UnorderedParameterSets and ConsecutiveParameterSets rules for improved invocation parameter matching in MockObject"
This reverts commit 6924d57.
1 parent b898616 commit 8197dbc

18 files changed

Lines changed: 2 additions & 659 deletions

src/Framework/MockObject/Exception/NoMoreParameterSetsConfiguredException.php

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/Framework/MockObject/Runtime/Interface/InvocationStubber.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,6 @@ public function after(string $id): self;
4848
*/
4949
public function with(mixed ...$arguments): self;
5050

51-
/**
52-
* @return $this
53-
*/
54-
public function withConsecutiveParameterSets(mixed ...$arguments): self;
55-
56-
/**
57-
* @return $this
58-
*/
59-
public function withParameterSetsInAnyOrder(mixed ...$arguments): self;
60-
6151
/**
6252
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
6353
*

src/Framework/MockObject/Runtime/InvocationStubberImplementation.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -139,24 +139,6 @@ public function with(mixed ...$arguments): InvocationStubber
139139
return $this;
140140
}
141141

142-
public function withConsecutiveParameterSets(mixed ...$arguments): InvocationStubber
143-
{
144-
$this->ensureParametersCanBeConfigured();
145-
146-
$this->matcher->setParametersRule(new Rule\ConsecutiveParameterSets($arguments));
147-
148-
return $this;
149-
}
150-
151-
public function withParameterSetsInAnyOrder(mixed ...$arguments): InvocationStubber
152-
{
153-
$this->ensureParametersCanBeConfigured();
154-
155-
$this->matcher->setParametersRule(new Rule\UnorderedParameterSets($arguments));
156-
157-
return $this;
158-
}
159-
160142
/**
161143
* @throws MethodNameNotConfiguredException
162144
* @throws MethodParametersAlreadyConfiguredException

src/Framework/MockObject/Runtime/Rule/ConsecutiveParameterSets.php

Lines changed: 0 additions & 84 deletions
This file was deleted.

src/Framework/MockObject/Runtime/Rule/Parameters.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
*/
1010
namespace PHPUnit\Framework\MockObject\Rule;
1111

12-
use AllowDynamicProperties;
1312
use function count;
1413
use function sprintf;
1514
use Exception;
@@ -26,15 +25,14 @@
2625
*
2726
* @internal This class is not covered by the backward compatibility promise for PHPUnit
2827
*/
29-
#[AllowDynamicProperties] final class Parameters implements ParametersRule
28+
final class Parameters implements ParametersRule
3029
{
3130
/**
3231
* @var list<Constraint>
3332
*/
3433
private array $parameters = [];
3534
private ?BaseInvocation $invocation = null;
3635
private null|bool|ExpectationFailedException $parameterVerificationResult;
37-
private bool $useAssertionCount = true;
3836

3937
/**
4038
* @param array<mixed> $parameters
@@ -149,13 +147,8 @@ private function guardAgainstDuplicateEvaluationOfParameterConstraints(): bool
149147
return (bool) $this->parameterVerificationResult;
150148
}
151149

152-
public function useAssertionCount(bool $useAssertionCount): void
153-
{
154-
$this->useAssertionCount = $useAssertionCount;
155-
}
156-
157150
private function incrementAssertionCount(): void
158151
{
159-
$this->useAssertionCount && Test::currentTestCase()->addToAssertionCount(1);
152+
Test::currentTestCase()->addToAssertionCount(1);
160153
}
161154
}

src/Framework/MockObject/Runtime/Rule/UnorderedParameterSets.php

Lines changed: 0 additions & 107 deletions
This file was deleted.

tests/end-to-end/regression/6407-multiple-arguments.phpt

Lines changed: 0 additions & 21 deletions
This file was deleted.

tests/end-to-end/regression/6407-single-arguments.phpt

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)