LordLanky Posted August 14, 2009 Share Posted August 14, 2009 Hi All, I dont suppose anyone knows a good way to unit test custom functions? I am writing about 20 new functions a day for my website but my colleague who is writing the interface takes alot longer. this means i have to wait ages before being able to thoroughly test the functions i write. Does anyone know a good way to test them? What i'm thinking of is a form where you type in the function name, then type in the variables, and then it will self pass to itself and call that function. the problem i have is being able to call a user defined function. Any tips would be great! Link to comment https://forums.phpfreaks.com/topic/170228-a-good-way-of-testing-functions/ Share on other sites More sharing options...
trq Posted August 14, 2009 Share Posted August 14, 2009 Why not actualy use a unit testing framework? http://www.phpunit.de Link to comment https://forums.phpfreaks.com/topic/170228-a-good-way-of-testing-functions/#findComment-897969 Share on other sites More sharing options...
oni-kun Posted August 14, 2009 Share Posted August 14, 2009 Do you mean you're both working on a project? There's no reason you can't create a 'test.php' file and put a few of your new functions within there, and statically define user variables etc. You may want to use FOR loops as well, batching 100 uses of your function for example to test the speed of it, if it lags alot then you should optimize your code more. You should be able to test the basic function theory without the need of your partner's code. Link to comment https://forums.phpfreaks.com/topic/170228-a-good-way-of-testing-functions/#findComment-897970 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.