Procházet zdrojové kódy

[ZF-3792] Zend_Db_Select
Test to enforce behavior of joinUsing (must generate JOIN ON, as JOIN USING not universally supported)


git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@24510 44c647ce-9c0f-0410-b52a-842ac1e357ba

adamlundrigan před 14 roky
rodič
revize
c4d504ac9d
1 změnil soubory, kde provedl 13 přidání a 0 odebrání
  1. 13 0
      tests/Zend/Db/Select/TestCommon.php

+ 13 - 0
tests/Zend/Db/Select/TestCommon.php

@@ -1697,5 +1697,18 @@ abstract class Zend_Db_Select_TestCommon extends Zend_Db_TestSetup
         $serialize = serialize($this->_select());
         $serialize = serialize($this->_select());
         $this->assertType('string',$serialize);
         $this->assertType('string',$serialize);
     }
     }
+    
+    /**
+     * @group ZF-3792
+     */
+    public function testJoinUsingActuallyGeneratesAnInnerJoinOnForCompatibilityReasons()
+    {
+        $table_A = $this->_db->quoteTableAs('A');
+        $table_B = $this->_db->quoteTableAs('B');
+        $colname = $this->_db->quoteIdentifier('colname');
+        
+        $s = $this->_db->select()->from('A')->joinUsing('B', $colname);
+        $this->assertContains("JOIN {$table_B} ON {$table_B}.{$colname} = {$table_A}.{$colname}", $s->assemble());
+    }
 
 
 }
 }