Thread: PHPUnit
View Single Post
  #1 (permalink)  
Old 04-18-2008, 04:00 PM
mel mel is offline
Junior Member
 
Join Date: Feb 2008
Posts: 11
Default PHPUnit

I'm totally new to unit testing, and am struggling immensely with it at the moment. A few days of searching for answers to various questions has been almost fruitless. I've managed to get semi-started, but I'm now stumped again.

The model class is User. After generating the skeleton then immediately running the 'tests' I was getting this error:
Zend_Db_Table_Exception: No adapter found for User

After adding some setup (autoloader, config and db), I get:
Zend_Db_Adapter_Mysqli_Exception: Can't connect to MySQL server on 'mysqlserver'

So my questions: how can I test a model class without using the database? I'm not sure that's even quite what I want to do, but as I said I'm very, very new to unit testing. Any answers/comments/suggestions/advice will be hugely appreciated.
Reply With Quote