From: Bastien Koert > On Thu, Jun 25, 2009 at 10:00 AM, Bob McConnell<r...@cbord.com> wrote: >> I need some guidance. I have looked over the PHP site and don't see any >> hints about using PHP interpreters for unit testing. I would like to >> know if this idea has any chance of working. >> >> I want to set up the development and build machines with PHP >> interpreters to do automated unit tests. Because we use PostgreSQL, I >> want to set up those boxes without any Postgres libraries and substitute >> FIT test stubs in their place. >> >> 1. I have to use MS-Windows as my development platform. Currently I have >> XP-Pro with NetBeans 6.5.1. I have played with Eclipse and Komodo >> Editor, which remain as possible options. I need a PHP interpreter that >> will allow me to write and debug FIT tests for functions already in use, >> as well as new code that I write or modify. >> >> 2. The production server is RHEL ES 5 with Apache 2 and PostgreSQL. I >> cannot make any changes to this platform. >> >> 3. The build machine is running Fedora Core (version unknown), also with >> Apache and PostgreSQL installed as it is also used for integration >> testing. I want to change this to remove the Postgres libraries so they >> can be replaced with the FIT back end. Integration testing would require >> a separate server which would also solve some other QA issues we have. >> We currently do both development and QA testing on this box, releasing a >> set of RPM files to production once they have been run through the >> wringer. >> >> Is this a reasonable plan? >> >> Where can I find PHP interpreters for MS-Windows and FC that will >> support this? > > > http://www.phpunit.de/ ?
We have looked at that and it does not appear to be a workable option. Near as I can tell it can only test OO code already organized as classes. But... 1. None of the code I need to test is OO. The system was originally written as PHP 4 procedures and has not been significantly changed since then. Rewriting it as OOP has been discussed, but will not likely happen in the next two or three years. 2. I don't do objects. After 40 years of procedural programming, with the last 20 in low level embedded devices, I just cannot think that way. In addition, I learned to program using "eschew obfuscation" as my primary guideline. To me, OOP appears to be obfuscation taken to an absurd level. I'm more into the concrete and have a real problem with abstraction. So it takes me longer to read and understand other programmers' objects than to write the same functions myself as procedural code. Now, is there any support to implement unit testing without objects? Does my plan outline above have any merit? Bob McConnell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php