Exemplo n.º 1
0
 public function testPaginatorGenerateWithPixieAdapter()
 {
     $records = $this->qb->table('sample')->select('t_value');
     $expected = $this->qb->table('sample')->select('t_value')->limit(10)->offset(10)->get();
     $paginatorClass = new Paginator();
     $paginator = $paginatorClass->page(2)->perPage(10)->make($records);
     $this->assertEquals(100, $paginator->total(), 'Failed asserting pagination total.');
     $this->assertEquals($expected, $paginator->records(), 'Failed asserting pagination records.');
 }
Exemplo n.º 2
0
 public function testInsertQueryReturnsNullForIgnoredInsert()
 {
     $this->mockPdoStatement->expects($this->once())->method('rowCount')->will($this->returnValue(0));
     $id = $this->builder->table('test')->insertIgnore(array('id' => 5, 'name' => 'usman'));
     $this->assertEquals(null, $id);
 }