public function testSelectFirst()
 {
     // Test first from sequence
     $query = new SQLSelect();
     $query->setFrom('"SQLSelectTest_DO"');
     $query->setOrderBy('"Name"');
     $result = $query->firstRow()->execute();
     $records = array();
     foreach ($result as $row) {
         $records[] = $row;
     }
     $this->assertCount(1, $records);
     $this->assertEquals('Object 1', $records[0]['Name']);
     // Test first from empty sequence
     $query = new SQLSelect();
     $query->setFrom('"SQLSelectTest_DO"');
     $query->setOrderBy('"Name"');
     $query->setWhere(array('"Name"' => 'Nonexistent Object'));
     $result = $query->firstRow()->execute();
     $records = array();
     foreach ($result as $row) {
         $records[] = $row;
     }
     $this->assertCount(0, $records);
     // Test that given the last item, the 'first' in this list matches the last
     $query = new SQLSelect();
     $query->setFrom('"SQLSelectTest_DO"');
     $query->setOrderBy('"Name"');
     $query->setLimit(1, 1);
     $result = $query->firstRow()->execute();
     $records = array();
     foreach ($result as $row) {
         $records[] = $row;
     }
     $this->assertCount(1, $records);
     $this->assertEquals('Object 2', $records[0]['Name']);
 }