This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I'm using Dev-Build 201111090600. Create a class "Foo" in "Foo.php". Create a class "FooTest" in "FooTest.php" in same directory. Right click "Foo.php" and select "Tools > Create PHPUnit tests" Expected: - test-case get's created in test-directory Actually: - test-case get's created in same directory - "FooTest.php" is overwritten and then deleted without warning - the file and all user changes are lost Suggested solution: - OPTION 1) generate test in test directory instead of current directory - OPTION 2) if file *Test.php exists then ask user if he wishes to use the existing file and if not: warn the user before replacing the file
Thanks for catching that. (In reply to comment #0) > Suggested solution: > - OPTION 1) generate test in test directory instead of current directory Would be the best but unfortunately, not possbile since NetBeans just runs PHPUnit via command line and PHPUnit itself generates the file. > - OPTION 2) if file *Test.php exists then ask user if he wishes to use the > existing file and if not: warn the user before replacing the file Something like this needs to be done.
Fixed. Lado, could you please verify? Thanks a lot. http://hg.netbeans.org/web-main/rev/396b4d6e8fb5
Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/396b4d6e8fb5 User: Tomas Mysik <tmysik@netbeans.org> Log: #205135 - "Create PHPUnit test" deletes files
Verified. User is asked if he want to use existing file, if so the file is moved to selected directory. Product Version: NetBeans IDE Dev (Build 201111200600) Java: 1.7.0_01; Java HotSpot(TM) Client VM 21.1-b02