/** * make sure the interface is sorting returned results right * * basically, add some rows and then get them back in reverse order * * @since 5-24-11 */ public function testSort() { $db = $this->getDb(); $table = $this->getTable(__FUNCTION__); $count = 20; $_id_list = $this->insert($table, $count); $where_criteria = new MingoCriteria(); $where_criteria->descFoo(); $list = $db->get($table, $where_criteria); $this->assertEquals($count, count($list)); $this->assertSubset($list, $_id_list); $last_val = $count; foreach ($list as $map) { $this->assertEquals($map['foo'], $last_val); $last_val--; } //foreach }