dblayeroo: Add DISTINCT feature to displayAdd
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3819 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -702,4 +702,104 @@ class test_dblayeroo_{ENGINE} extends PHPUnit_Framework_TestCase
|
||||
$db2->disconnect ();
|
||||
$this->assertSame ("order3", $res);
|
||||
}
|
||||
|
||||
public function test_displayAdd_NotFull1 ()
|
||||
{
|
||||
$db1 = $this->db1 ();
|
||||
$db1->displayAdd ("group");
|
||||
$res = $db1->displayGet ();
|
||||
$db1->disconnect ();
|
||||
$this->assertSame (array ("order1" => $db1->sep()."group".$db1->sep()),
|
||||
$res);
|
||||
}
|
||||
|
||||
public function test_displayAdd_NotFull2 ()
|
||||
{
|
||||
$db1 = $this->db1 ();
|
||||
$db1->displayAdd ("distinct group");
|
||||
$res = $db1->displayGet ();
|
||||
$db1->disconnect ();
|
||||
$this->assertSame (array (
|
||||
"order1" => "DISTINCT ".$db1->sep()."group".$db1->sep()), $res);
|
||||
}
|
||||
|
||||
public function test_displayAdd_NotFull3 ()
|
||||
{
|
||||
$db1 = $this->db1 ();
|
||||
$db1->displayAdd ("group_concat ( group ) ");
|
||||
$res = $db1->displayGet ();
|
||||
$db1->disconnect ();
|
||||
$this->assertSame (array (
|
||||
"order1" => "GROUP_CONCAT(".$db1->sep()."group".$db1->sep().")"), $res);
|
||||
}
|
||||
|
||||
public function test_displayAdd_NotFull4 ()
|
||||
{
|
||||
$db1 = $this->db1 ();
|
||||
$db1->displayAdd ("group_concat (distinct group ) ");
|
||||
$res = $db1->displayGet ();
|
||||
$db1->disconnect ();
|
||||
$this->assertSame (array (
|
||||
"order1" => "GROUP_CONCAT(DISTINCT ".
|
||||
$db1->sep()."group".$db1->sep().")"), $res);
|
||||
}
|
||||
|
||||
public function test_displayAdd_Full1 ()
|
||||
{
|
||||
$db1 = $this->db1 ();
|
||||
$db1->displayAdd ("group");
|
||||
$res = $db1->displayGet (true);
|
||||
$db1->disconnect ();
|
||||
$this->assertSame (array (
|
||||
"order1" => $db1->sep()."groupedoo".$db1->sep().".".
|
||||
$db1->sep()."group".$db1->sep()),
|
||||
$res);
|
||||
}
|
||||
|
||||
public function test_displayAdd_Full2 ()
|
||||
{
|
||||
$db1 = $this->db1 ();
|
||||
$db1->displayAdd ("distinct group");
|
||||
$res = $db1->displayGet (true);
|
||||
$db1->disconnect ();
|
||||
$this->assertSame (array (
|
||||
"order1" => "DISTINCT ".$db1->sep()."groupedoo".$db1->sep().".".
|
||||
$db1->sep()."group".$db1->sep()), $res);
|
||||
}
|
||||
|
||||
public function test_displayAdd_Full3 ()
|
||||
{
|
||||
$db1 = $this->db1 ();
|
||||
$db1->displayAdd ("group_concat ( group ) ");
|
||||
$res = $db1->displayGet (true);
|
||||
$db1->disconnect ();
|
||||
$this->assertSame (array (
|
||||
"order1" => "GROUP_CONCAT(".$db1->sep()."groupedoo".$db1->sep().".".
|
||||
$db1->sep()."group".$db1->sep().")"), $res);
|
||||
}
|
||||
|
||||
public function test_displayAdd_Full4 ()
|
||||
{
|
||||
$db1 = $this->db1 ();
|
||||
$db1->displayAdd ("group_concat (distinct group ) ");
|
||||
$res = $db1->displayGet (true);
|
||||
$db1->disconnect ();
|
||||
$this->assertSame (array (
|
||||
"order1" => "GROUP_CONCAT(DISTINCT ".
|
||||
$db1->sep()."groupedoo".$db1->sep().".".
|
||||
$db1->sep()."group".$db1->sep().")"), $res);
|
||||
}
|
||||
|
||||
public function test_displayAdd_Multiple1 ()
|
||||
{
|
||||
$db1 = $this->db1 ();
|
||||
$db1->displayAdd ("group");
|
||||
$db1->displayAdd ("where");
|
||||
$res = $db1->displayGet ();
|
||||
$db1->disconnect ();
|
||||
$this->assertSame (array ("order1" => $db1->sep()."group".$db1->sep(),
|
||||
"order2" => $db1->sep()."where".$db1->sep(),),
|
||||
$res);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user