Support doubling readonly
classes
#1174
Annotations
6 warnings
Run mutation testing:
src/Framework/MockObject/Runtime/Api/MockObjectApi.php#L56
Escaped Mutant for Mutator "LogicalNot":
--- Original
+++ New
@@ @@
$message = 'Expectations configured on test doubles that are created as test stubs are no longer verified since PHPUnit 10. Test doubles that are created as test stubs will no longer have the expects() method in PHPUnit 12. Update your test code to use createMock() instead of createStub(), for example.';
try {
$test = TestMethodBuilder::fromCallStack();
- if (!$this->__phpunit_state()->wasDeprecationAlreadyEmittedFor($test->id())) {
+ if ($this->__phpunit_state()->wasDeprecationAlreadyEmittedFor($test->id())) {
EventFacade::emitter()->testTriggeredPhpunitDeprecation($test, $message);
$this->__phpunit_state()->deprecationWasEmittedFor($test->id());
}
|
Run mutation testing:
src/Framework/MockObject/Runtime/Api/MockObjectApi.php#L62
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
$test = TestMethodBuilder::fromCallStack();
if (!$this->__phpunit_state()->wasDeprecationAlreadyEmittedFor($test->id())) {
EventFacade::emitter()->testTriggeredPhpunitDeprecation($test, $message);
- $this->__phpunit_state()->deprecationWasEmittedFor($test->id());
+
}
} catch (NoTestCaseObjectOnCallStackException) {
EventFacade::emitter()->testRunnerTriggeredDeprecation($message);
|
Run mutation testing:
src/Framework/MockObject/Runtime/Api/ProxiedCloneMethod.php#L32
Escaped Mutant for Mutator "CloneRemoval":
--- Original
+++ New
@@ @@
EventFacade::emitter()->testTriggeredPhpunitError(TestMethodBuilder::fromCallStack(), 'Cloning test double objects requires PHP 8.3');
return;
}
- $this->__phpunit_state = clone $this->__phpunit_state;
+ $this->__phpunit_state = $this->__phpunit_state;
$this->__phpunit_state()->cloneInvocationHandler();
parent::__clone();
}
abstract public function __phpunit_state(): TestDoubleState;
}
|
Run mutation testing:
src/Framework/MockObject/Runtime/Api/ProxiedCloneMethod.php#L34
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
return;
}
$this->__phpunit_state = clone $this->__phpunit_state;
- $this->__phpunit_state()->cloneInvocationHandler();
+
parent::__clone();
}
abstract public function __phpunit_state(): TestDoubleState;
}
|
Run mutation testing:
src/Framework/MockObject/Runtime/Api/StubApi.php#L33
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
/** @noinspection MagicMethodsValidityInspection */
public function __phpunit_unsetInvocationMocker(): void
{
- $this->__phpunit_state->unsetInvocationHandler();
+
}
}
|
Run mutation testing:
src/Framework/MockObject/Runtime/Api/TestDoubleState.php#L80
Escaped Mutant for Mutator "TrueValue":
--- Original
+++ New
@@ @@
}
public function deprecationWasEmittedFor(string $testId): void
{
- self::$deprecationEmittedForTest[$testId] = true;
+ self::$deprecationEmittedForTest[$testId] = false;
}
public function wasDeprecationAlreadyEmittedFor(string $testId): bool
{
|
Loading