pestphp / pestphp/pest

Mutation testing fails with "Psr\SimpleCache\CacheInterface cannot be resolved"

Open
#1,603 0 comments 0 reactions 0 assignees View on GitHub

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

  1. Run mutation testing with the --everything --covered-only flags:

    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-cache is 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.