vscode-phpunit: [2.0.73] All my tests show *** duplicate ID *** now.
As of v2.0.73, all of my tests show *** duplicate ID *** in the test explorer UI. When I attempt to run a test, I get “No tests executed!” from phpunit.
Rolling back to v2.0.72 resolves this.
Here is an example test (located in tests/Feature/PhotosControllerTest.php):
<?php
namespace Tests\Feature;
use App\Photo;
use App\User;
use Illuminate\Support\Facades\Storage;
use Tests\TestCase;
class PhotosControllerTest extends TestCase
{
public function testListSuccess()
{
// Test steps...
}
public function testCreateSuccess()
{
// Test steps...
}
public function testDeleteSuccess()
{
// Test steps...
}
}
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15 (1 by maintainers)
It seems my config was:
When I changed it to:
The duplicate tests disappear, but when I run a test, it still says: “No tests executed!”
@MichMich You can. Downgrade to v2.0.72.
Thanks all for the feedback above.
The title of the issue is to do with the *** duplicate ID *** issue - which is sorted by amending your config
"phpunit.files": "{test,tests}/**/*Test.php"when you have a case insensitive filesystem.The next issue, is to do with tests not executing - not related to this one but on #64 there is some really good detail about the issue, so I’m closing this solved issue and for anyone with the “no test executed” issue, please follow #64
I had the same problem, I just changed the version to the 2.0.72 and everything worked 😃
Hope it helps someone
Take a look at the troubleshooting section “All tests are appearing twice with “*** duplicate ID ***” found.” of the readme.
I think when PR #50 came in, it expanded the default folders it looks in. This has meant for case-insensitive file systems it will try import the same test twice… Reversing this will mean for case sensitive file systems, their tests may not appear by default… Both as equally bad…?
In either case the fix is to specify your test folder
"phpunit.files": "{test,tests}/**/*Test.php"for a lowercase t…Can you test this out and find out if it works rather than rolling back?