1
0
mirror of synced 2025-02-12 02:09:24 +03:00
doctrine2/tests/QueryLimitTestCase.php
2006-08-15 23:25:53 +00:00

28 lines
755 B
PHP

<?php
class Doctrine_Query_Limit_TestCase extends Doctrine_UnitTestCase {
public function testLimit() {
$this->query->from("User.Phonenumber");
$this->query->limit(5);
$sql = $this->query->getQuery();
$users = $this->query->execute();
$count = $this->dbh->count();
$this->assertEqual($users->count(), 5);
$users[0]->Phonenumber[0];
$this->assertEqual($count, $this->dbh->count());
$this->query->offset(2);
$users = $this->query->execute();
$count = $this->dbh->count();
$this->assertEqual($users->count(), 5);
$users[3]->Phonenumber[0];
$this->assertEqual($count, $this->dbh->count());
}
}
?>