|
|||
|
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. |
|
||||
|
The easiest way to have a test db with known data in it. There is also a Mock class you can use, but I'm pretty new to this stuff myself...
__________________
Zend Framework Resources: Zend Webinars | Reference Manual | API Docs | Books | FreeNode: #zftalk Getting Started Tutorials: Getting started with ZF | Getting started with Zend Auth |
![]() |
| Thread Tools | |
| Display Modes | |
|
|