[Bug]: A dependency with the name `Pest\Mutate\Contracts\MutationTestRunner` 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
What Happened
When I add covers([CLASS HERE]); to my tests/TestCase.php, Pest\Exceptions\ShouldNotHappen is thrown.
Exact output:
Pest\Exceptions\ShouldNotHappen
This should not happen - please create an new issue here: https://github.com/pestphp/pest.
Issue: A dependency with the name `Pest\Mutate\Contracts\MutationTestRunner` cannot be resolved.
PHP version: 8.4.1
Operating system: Linux
at [internal]:0
1▕
+4 vendor frames
5 tests/TestCase.php:8
+2 vendor frames
8 [internal]:0
Composer\Autoload\ClassLoader::loadClass()
How to Reproduce
Install a fresh Laravel app, add PestPHP and add covers([\App\Providers\AppServiceProvider::class]); to tests/TestCase.php.
Other classes can be used as well instead of \App\Providers\AppServiceProvider::class.
<?php
/*
* tests/TestCase.php
*/
namespace Tests;
use App\Providers\AppServiceProvider;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
covers([AppServiceProvider::class]);
abstract class TestCase extends BaseTestCase {}
Sample Repository
https://github.com/TimeglitchD/pestphp-mutation-bug
Pest Version
3.7.1
PHP Version
8.4.1
Operation System
Linux
Notes
No response
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
Reproduce the failure using the fresh Laravel app setup and the covers declaration in tests/TestCase.php, or use the linked sample repository. Trace why dependency resolution fails when that declaration is loaded. Done means covers works without throwing Pest\Exceptions\ShouldNotHappen and the relevant tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- laravel, php
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100