dblayeroo: Update tests to add DISTINCT in tests
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3945 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -550,6 +550,7 @@ class test_dblayeroo_{ENGINE} extends PHPUnit_Framework_TestCase
|
||||
->displayAdd ("group")
|
||||
->joinLeft ($tbl2, array ("group"=>"group"))
|
||||
->orderAdd ("group", "ASC")
|
||||
->debug (1)
|
||||
->execute ();
|
||||
$tbl1->disconnect ();
|
||||
$tbl2->disconnect ();
|
||||
@@ -930,8 +931,30 @@ class test_dblayeroo_{ENGINE} extends PHPUnit_Framework_TestCase
|
||||
$tbl1 = $this->tbl1 ();
|
||||
$tbl1->displayAdd ("group_concat (group ),group ",
|
||||
"Group Alias,Group2");
|
||||
// PGSQL generate an exception :
|
||||
// function string_agg(character varying) does not exist
|
||||
if ($this->engine === "pgsql")
|
||||
$this->setExpectedException ("PDOException");
|
||||
$res = $tbl1->select ()
|
||||
->execute ();
|
||||
$tbl1->disconnect ();
|
||||
if ($this->engine !== "pgsql")
|
||||
$this->assertSame (array (
|
||||
array ('Group Alias' => 'group1',
|
||||
'Group2' => 'group1',),
|
||||
array ('Group Alias' => 'group2',
|
||||
'Group2' => 'group2',),
|
||||
), $res);
|
||||
}
|
||||
|
||||
public function test_displayAdd_DISTINCT1 ()
|
||||
{
|
||||
$tbl1 = $this->tbl1 ();
|
||||
$res = $tbl1->select ()
|
||||
->displayAdd ("distinct where", "ALIAS")
|
||||
->execute ();
|
||||
$tbl1->disconnect ();
|
||||
$this->assertSame (array (0=>array ("ALIAS"=>"where2")),
|
||||
$res);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user