Commit 4ee7ac65 authored by Jens Segers's avatar Jens Segers

Add test for #225

parent 5e6859db
...@@ -111,6 +111,17 @@ class Builder extends \Illuminate\Database\Query\Builder { ...@@ -111,6 +111,17 @@ class Builder extends \Illuminate\Database\Query\Builder {
return $this->where('_id', '=', $this->convertKey($id))->first($columns); return $this->where('_id', '=', $this->convertKey($id))->first($columns);
} }
/**
* Execute the query as a "select" statement.
*
* @param array $columns
* @return array|static[]
*/
public function get($columns = array())
{
return parent::get($columns);
}
/** /**
* Execute the query as a fresh "select" statement. * Execute the query as a fresh "select" statement.
* *
......
...@@ -280,4 +280,15 @@ class QueryTest extends TestCase { ...@@ -280,4 +280,15 @@ class QueryTest extends TestCase {
$this->assertEquals(2, count($users)); $this->assertEquals(2, count($users));
} }
public function testPaginate()
{
$results = User::paginate(2);
$this->assertEquals(2, $results->count());
$this->assertNotNull($results->first()->title);
$results = User::paginate(2, array('name', 'age'));
$this->assertEquals(2, $results->count());
$this->assertNull($results->first()->title);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment