query('select id from roles order by name'); $result = $query->fetchAll(); $list = new RoleList(); $list->find(); $this->assertEquals($list->getSort(),'name'); foreach ($list as $i=>$role) { $this->assertEquals($role->getId(),$result[$i]['id']); } } }