コード例 #1
0
 public function testbuild_flow_query_join()
 {
     $aowWorkFlow = new AOW_WorkFlow();
     $query = array();
     //test without type param
     $result = $aowWorkFlow->build_flow_query_join('aos_products_quotes', new AOS_Quotes(), '', array());
     $this->assertSame(array(), $result);
     //test with type custom
     $expected = array('join' => array('c' => 'LEFT JOIN calls_cstm c ON calls.id = c.id_c '));
     $result = $aowWorkFlow->build_flow_query_join('c', new Call(), 'custom', array());
     $this->assertSame($expected, $result);
     //test with type relationship
     $expected = array('join' => array('aos_products_quotes' => "LEFT JOIN aos_products_quotes aos_products_quotes ON aos_quotes.id=aos_products_quotes.parent_id AND aos_products_quotes.deleted=0\n\n"), 'select' => array("aos_products_quotes.id AS 'aos_products_quotes_id'"));
     $result = $aowWorkFlow->build_flow_query_join('aos_products_quotes', new AOS_Quotes(), 'relationship', array());
     $this->assertSame($expected, $result);
 }