How do I test this class?
Posted: Tue Jan 13, 2009 9:42 pm
I just start practicing proper OOP with PHP5 (using private/public access properties) and found myself wondering how to test this class using TDD.
The point of entry into this class is securityCheck(), where two sets of data will be compared with each other. The return results would be an array of flags, indicating which checks have failed, be it an incorrect invoice number, tampered email and etc.
I would like do test each of the function individually. Any advice on how should I do that, or do I need to define a different set of data for each case?
Code: Select all
public function securityCheck()
{
}
private function checkDuplicateTXN()
{
}
private function checkTamperedEmail()
{
}
private function checkIncompletePayment()
{
}
private function checkWrongCurrency()
{
}
private function checkWrongPayTo()
{
}
private function processErrors()
{
}
I would like do test each of the function individually. Any advice on how should I do that, or do I need to define a different set of data for each case?