query('select id from users order by username'); $result = $query->fetchAll(); $list = new UserList(); $list->find(); $this->assertEquals($list->getSort(),'username'); foreach ($list as $i=>$user) { $this->assertEquals($user->getId(),$result[$i]['id']); } } }