Support doubling readonly
classes
#1189
ci.yaml
on: pull_request
Dependency Validation
9s
Coding Guidelines
48s
Matrix: Unit Tests
Type Checker
27s
Matrix: End-to-End Tests
Matrix: Test PHAR
Annotations
6 warnings
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());
}
|
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());
+
}
// @codeCoverageIgnoreStart
} catch (NoTestCaseObjectOnCallStackException) {
|
Mutation Testing:
src/Framework/MockObject/Runtime/Api/ProxiedCloneMethod.php#L19
Escaped Mutant for Mutator "CloneRemoval":
--- Original
+++ New
@@ @@
{
public function __clone(): void
{
- $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;
}
|
Mutation Testing:
src/Framework/MockObject/Runtime/Api/ProxiedCloneMethod.php#L21
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
public function __clone(): void
{
$this->__phpunit_state = clone $this->__phpunit_state;
- $this->__phpunit_state()->cloneInvocationHandler();
+
parent::__clone();
}
abstract public function __phpunit_state(): TestDoubleState;
}
|
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();
+
}
}
|
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
{
|
Artifacts
Produced during runtime
Name | Size | |
---|---|---|
phpunit-snapshot-phar
Expired
|
677 KB |
|