Do you have a question? Post it now! No Registration Necessary. Now with pictures!
May 21, 2007, 12:11 pm
rate this thread
I searched for best practises for php apps, especially if you're using
phpunit as testframework.
I found nothing interesting, so I ask you, what do you think is a best
practise on directory hierarchy.
I'm actually using
config/ - contains config-files and is unreadable from internet ;)
classes/ - where my ownclasses/libraries are
lib/ - foreign libs, e.g., smarty if not installed on host
templates/ - smarty template dir..
tests/ - phpunit tests
I also read http://framework.zend.com/wiki/display/ZFDEV/Choosing+Your+Application%27s+Directory+Layout
but it says nothing about tests. Maybe the guys from Zeev and Andi do
not test :)
Re: PHPUnit 3
I usually have some kind of administrator directory with a password on
it. My unit tests can be run from there. Off course, the tests
themselves are outside of the web root, as they do not contain any file
that should be called directly. There is one exception (which can be
found in subdirectories of admin): I sometimes add documentation to my
tests in the form of an UML scheme.
For a demo, see http://www.w-p.dds.nl/storyboard/admin/rununittests.php