Mutation testing fails with "Psr\SimpleCache\CacheInterface cannot be resolved"
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 11.7k
- Forks
- 538
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 8
Description
Mutation testing fails with "Psr\SimpleCache\CacheInterface cannot be resolved"
Description
Pest mutation testing fails during the mutation analysis phase with a ShouldNotHappen exception when trying to resolve Psr\SimpleCache\CacheInterface.
Environment
- Pest version: 4.3.1
- PHP versions tested: 8.4.16 and 8.5.1
- Operating system: macOS (Darwin)
- Laravel version: 12.x
Steps to Reproduce
-
Run mutation testing with the
--everything --covered-onlyflags:vendor/bin/pest --mutate --everything --min=90 --covered-only
Expected Behavior
Mutation testing should complete and report the mutation score.
Actual Behavior
Tests pass successfully (430 passed, 1569 assertions), but mutation analysis fails with:
Pest\Exceptions\ShouldNotHappen
This should not happen - please create an new issue here: https://github.com/pestphp/pest/issues
Issue: A dependency with the name `Psr\SimpleCache\CacheInterface` cannot be resolved.
PHP version: 8.4.16
Operating system: Darwin
at vendor/pestphp/pest/src/Exceptions/ShouldNotHappen.php:37
Additional Context
- This occurs consistently on both PHP 8.4 and PHP 8.5
- Regular test runs (vendor/bin/pest) work without issues
- The project uses Laravel 12 with standard PSR-4 autoloading
psr/simple-cacheis installed as a dependency of Laravel
Composer dependencies (relevant)
{
"require": {
"laravel/framework": "^12.45.1"
},
"require-dev": {
"pestphp/pest": "^4.3.1",
"pestphp/pest-plugin-arch": "^4.0",
"pestphp/pest-plugin-browser": "^4.1.1",
"pestphp/pest-plugin-faker": "^4.0",
"pestphp/pest-plugin-laravel": "^4.0",
"pestphp/pest-plugin-type-coverage": "^4.0.3"
}
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Run vendor/bin/pest --mutate --everything --min=90 --covered-only and compare it with the regular vendor/bin/pest run. Start at vendor/pestphp/pest/src/Exceptions/ShouldNotHappen.php and trace the mutation-analysis failure while resolving Psr\SimpleCache\CacheInterface. Done means mutation testing completes and reports the mutation score.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100