Example #1
0
 function test_mixedAlotPara()
 {
     $query = new SQL_Query('table');
     $query->addDontSelect('myPara', 'myPara1');
     $query->addDontSelect(array('myPara2', 'myPara3'));
     $query->addDontSelect(array('myPara4'));
     $query->addDontSelect('myPara5');
     $this->assertEquals(array('myPara', 'myPara1', 'myPara2', 'myPara3', 'myPara4', 'myPara5'), $query->getDontSelect());
 }
Example #2
0
 function test_default()
 {
     $query = new SQL_Query('table');
     $query->addDontSelect('myPara');
     $query->resetDontSelect();
     $this->assertEquals(array(), $query->getDontSelect());
 }
Example #3
0
 function test_selectWithAllParts()
 {
     $query = new SQL_Query('city');
     $query->addSelect('*', 'name', 'id');
     $query->addDontSelect('name');
     $query->addWhere('id', '<>', 42);
     $query->addOrder(array('country_id', true));
     $query->addGroup('surname');
     $ren = new $this->_renderer($query);
     $this->assertStringEquals('SELECT *,id FROM city ' . 'WHERE id <> 42 GROUP BY surname ORDER BY country_id DESC', $ren->render());
 }