vscode-phpunit
vscode-phpunit copied to clipboard
Duplicating a test file breaks the test
trafficstars
Steps to reproduce:
- Create a test file e.g.
MyTest.phpwith a classMyTest - Copy this test file in an attempt to quickly create a new test without writing from scratch, resulting in a
MyTest.1.phpfile - Rename this
MyTest.1.phpfile to the desired new test name e.g.NewTest.phpand rename the class accordingly
Now the test explorer shows two tests called "MyTest", and both never go away and cannot be run. The following error occurs in the output for both "MyTest" tests (the original test filename is overridden by the temporary copy):
Cannot open file "...\MyTest.1.php"
The only way to fix this is to close the workspace and re-open it. The NewTest test however works fine.
Actually, I probably over-complicated it a bit there, the issue also exists if you simply want to rename an existing test/file - the old test doesn't go away.
Fix this problem later
try version 3.0