vscode-phpunit icon indicating copy to clipboard operation
vscode-phpunit copied to clipboard

Duplicating a test file breaks the test

Open Deji69 opened this issue 6 years ago • 2 comments
trafficstars

Steps to reproduce:

  1. Create a test file e.g. MyTest.php with a class MyTest
  2. Copy this test file in an attempt to quickly create a new test without writing from scratch, resulting in a MyTest.1.php file
  3. Rename this MyTest.1.php file to the desired new test name e.g. NewTest.php and 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.

Deji69 avatar May 18 '19 01:05 Deji69

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.

Deji69 avatar May 18 '19 02:05 Deji69

Fix this problem later

recca0120 avatar May 19 '19 11:05 recca0120

try version 3.0

recca0120 avatar Dec 04 '22 18:12 recca0120