Add more tests to dblayeroo
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3502 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -393,6 +393,7 @@ class test_dblayeroo_{ENGINE} extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
public function test_innerJoin1 ()
|
public function test_innerJoin1 ()
|
||||||
{
|
{
|
||||||
|
// No filter
|
||||||
$db1 = $this->db1 ();
|
$db1 = $this->db1 ();
|
||||||
$db2 = $this->db2 ();
|
$db2 = $this->db2 ();
|
||||||
$res = $db2->select ()
|
$res = $db2->select ()
|
||||||
@@ -446,6 +447,7 @@ class test_dblayeroo_{ENGINE} extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
public function test_leftJoin2 ()
|
public function test_leftJoin2 ()
|
||||||
{
|
{
|
||||||
|
// No filter
|
||||||
$db1 = $this->db1 ();
|
$db1 = $this->db1 ();
|
||||||
$db2 = $this->db2 ();
|
$db2 = $this->db2 ();
|
||||||
$res = $db1->select ()
|
$res = $db1->select ()
|
||||||
@@ -506,4 +508,70 @@ class test_dblayeroo_{ENGINE} extends PHPUnit_Framework_TestCase
|
|||||||
),
|
),
|
||||||
), $res);
|
), $res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_leftJoin3 ()
|
||||||
|
{
|
||||||
|
// Filter on the db1
|
||||||
|
$db1 = $this->db1 ();
|
||||||
|
$db2 = $this->db2 ();
|
||||||
|
$res = $db1->select ()
|
||||||
|
->displayColumn ("group")
|
||||||
|
->joinLeft ($db2, array ("group"=>"group"))
|
||||||
|
->execute ();
|
||||||
|
$db1->disconnect ();
|
||||||
|
$db2->disconnect ();
|
||||||
|
$this->assertSame (array (
|
||||||
|
array (
|
||||||
|
'groupedoo.group' => 'group1',
|
||||||
|
),
|
||||||
|
array (
|
||||||
|
'groupedoo.group' => 'group1',
|
||||||
|
),
|
||||||
|
array (
|
||||||
|
'groupedoo.group' => 'group1',
|
||||||
|
),
|
||||||
|
array (
|
||||||
|
'groupedoo.group' => 'group1',
|
||||||
|
),
|
||||||
|
array (
|
||||||
|
'groupedoo.group' => 'group2',
|
||||||
|
),
|
||||||
|
), $res);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function test_leftJoin4 ()
|
||||||
|
{
|
||||||
|
// Filter on the db1
|
||||||
|
$db1 = $this->db1 ();
|
||||||
|
$db2 = $this->db2 ();
|
||||||
|
$db2->displayColumn ("group");
|
||||||
|
$res = $db1->select ()
|
||||||
|
->displayColumn ("group")
|
||||||
|
->joinLeft ($db2, array ("group"=>"group"))
|
||||||
|
->execute ();
|
||||||
|
$db1->disconnect ();
|
||||||
|
$db2->disconnect ();
|
||||||
|
$this->assertSame (array (
|
||||||
|
array (
|
||||||
|
'usersoo.group' => 'group1',
|
||||||
|
'groupedoo.group' => 'group1',
|
||||||
|
),
|
||||||
|
array (
|
||||||
|
'usersoo.group' => 'group1',
|
||||||
|
'groupedoo.group' => 'group1',
|
||||||
|
),
|
||||||
|
array (
|
||||||
|
'usersoo.group' => 'group1',
|
||||||
|
'groupedoo.group' => 'group1',
|
||||||
|
),
|
||||||
|
array (
|
||||||
|
'usersoo.group' => 'group1',
|
||||||
|
'groupedoo.group' => 'group1',
|
||||||
|
),
|
||||||
|
array (
|
||||||
|
'usersoo.group' => NULL,
|
||||||
|
'groupedoo.group' => 'group2',
|
||||||
|
),
|
||||||
|
), $res);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user