1
0
mirror of synced 2024-12-14 07:06:04 +03:00
doctrine2/tests/QueryLimitTestCase.php

28 lines
755 B
PHP
Raw Normal View History

2006-08-16 01:45:00 +04:00
<?php
class Doctrine_Query_Limit_TestCase extends Doctrine_UnitTestCase {
public function testLimit() {
$this->query->from("User.Phonenumber");
2006-08-16 03:25:53 +04:00
$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());
2006-08-16 01:45:00 +04:00
}
}
?>