I have an action in a model that adds a record to a table. It works fine when I test it by typing values in to the browser, but is failing when I test it with PHPUnit. The frustrating part is that I don’t really know how to diagnose the problem.
The unit test has a (rather long) $data array, and the problem occurs when I call the dbTable->insert($data) method. The log shows:
CRIT (2): Application Error
CRIT (2): Request Parameters
How can I get more information on these errors? The line following the offending line is not executed.
Thanks!
Ok, so I had a boolean field in the DB that was not nullable. It showed a default value of 0, so I assumed that I didn’t need to provide this field in the insert statement. Seems I was wrong.
As soon as I provided a value for this field it worked fine.
Something else that confused this issue is that I had assumed I’d get a more descriptive error in my log if was such a simple error …