Re: Display both featured AND last posts.

2012-01-02 Thread Linas Jakucionis
Hi, $this->set specifies the variable name that is supposed to be used in the template, so your code snippet should look like this: $this->set('posts', $this->Post->find('all', array('conditions' => array('Post.featured' => '1'),'limit' => 10))); $this->set('posts2', $this->Post->find('all',array

Re: How to write unit test for getPopularItems()?

2011-11-21 Thread Linas Jakucionis
Hi, Common practice is to write unit tests against known test data, rather than against unknown production data. That way you could compare the actual values returned. When doing testing against unknown data you are limited to whatever extra checks you can make: * is the correct number of items