Jump to content

A Good Way of Testing Functions


LordLanky

Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.