@@ -61,14 +70,13 @@ public function testExamplePlugin() {
$rand_int=rand(0,1000);
$join->setJoinValue($rand_int);
$query=db_select('node');
$query=db_select('views_test_data');
$table=array('alias'=>'users');
$join->buildJoin($query,$table,$view->query);
$tables=$query->getTables();
$join_info=$tables['users'];
debug($join_info);
$this->assertTrue(strpos($join_info['condition'],"node.uid = $rand_int")!==FALSE,'Make sure that the custom join plugin can extend the join base and alter the result.');
$this->assertTrue(strpos($join_info['condition'],"views_test_data.uid = $rand_int")!==FALSE,'Make sure that the custom join plugin can extend the join base and alter the result.');
}
/**
...
...
@@ -77,14 +85,14 @@ public function testExamplePlugin() {
publicfunctiontestBasePlugin(){
// Setup a simple join and test the result sql.
$view=views_get_view('frontpage');
$view=views_get_view('test_view');
$view->initDisplay();
$view->initQuery();
// First define a simple join without an extra condition.
// Set the various options on the join object.
$configuration=array(
'left_table'=>'node',
'left_table'=>'views_test_data',
'left_field'=>'uid',
'table'=>'users',
'field'=>'uid',
...
...
@@ -97,7 +105,7 @@ public function testBasePlugin() {
// Build the actual join values and read them back from the dbtng query
// object.
$query=db_select('node');
$query=db_select('views_test_data');
$table=array('alias'=>'users');
$join->buildJoin($query,$table,$view->query);
...
...
@@ -106,7 +114,7 @@ public function testBasePlugin() {
$this->assertEqual($join_info['join type'],'LEFT','Make sure the default join type is LEFT');