It worked, but in addition I have to set the model alias: $this->User->alias = 'User';
because a simple `$this->User->read(null, 1)` raised an error saying that 'User.a_column' couldn't be found. On Nov 24, 3:22 pm, José Lorenzo <[email protected]> wrote: > When mocking a model it is recommended that you pass the correct parameters > to the contstructor: > > $this->User = $this->getMock('User', array('_saveUploadedFile', > '_removeUploadedFile'), > array(false, 'users', 'test')); > > The third parameter indicates that you want to use the 'users' table and > the 'test' datasource for your mock object. That is what CakePHP internally > does when you instantiate a new model in your tests using > ClassRegistry::init() -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
