Testable subroutine should only do one thing. The one you showed does three: connects to a database (read about "mocking"), constructs a SQL string, htmlizes the result.
In reply to Re: How do i Unit Test a subroutine
by choroba
in thread How do i Unit Test a subroutine
by ejvar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |