Unit testing your Database using Custom Functions in SQLite

Overview One of the largest challenges in unit testing is often making the differentiation in functional unit testing database queries or mocking them. I generally opt for a more functional test leveraging PHPUnit's database test case fixtures. We often utilize a database abstraction layer and in this particular case are using MySQL. However, when using SQLite we lose support for several functions which are leveraged. In some simple searching the SQLite driver supported creating custom functions and PHP does not leave you without option as the function was implemented. This means there is a path forward for us to re-implement…

read more...