Ticket #492 (closed Feature Request: wontfix)

Opened 7 months ago

Last modified 3 months ago

Allow for subdirectories in unit tests

Reported by: allain Owned by: Geert
Priority: major Milestone: 2.2
Component: Modules Version: SVN HEAD
Keywords: unit_test Cc:

Description

Allow for two tests in the same set of tests share the same filename by making the naming convention for classes match the directory structure.

For example in the tests directory if these were the tests: dir1/Hello_Test.php and dir2/Hello_Test.php

Then these would be the class names: dir1_Hello_Test and dir2_Hello_Test

This goes a long way towards organizing the tests, but there's still the possibility for conflicts. At that point it's up to the developer not to pick crappy names. :)

Change History

Changed 3 months ago by Geert

  • status changed from new to closed
  • resolution set to wontfix

I see where you are going and we talked about this long time ago. Although I see the naming problem you may have when running many tests at once, the proposed solution would only solve the problem partially. You could have multiple directories with the same name that contain tests with the same name. Moreover, by having to prefix the Test classes with the folder name they reside in, you lose the flexibility to move Test cases around without having to sync their name.

So in the end, I would make the same conclusion: it is up to the developer to not pick crappy names. Properly prefixing your names may help and is more transparent.

Note: See TracTickets for help on using tickets.