2
0
Prechádzať zdrojové kódy

ZF-5674: add test for long table name and long table column name

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@19141 44c647ce-9c0f-0410-b52a-842ac1e357ba
mikaelkael 16 rokov pred
rodič
commit
b7162bc254

+ 5 - 0
tests/Zend/Db/Table/OracleTest.php

@@ -100,6 +100,11 @@ class Zend_Db_Table_OracleTest extends Zend_Db_Table_TestCommon
         $this->assertEquals(5, $insertResult);
     }
 
+    protected function _getRowForTableAndIdentityWithVeryLongName()
+    {
+        return array('thisisalongtablenameidentity' => 1, 'stuff' => 'information');
+    }
+
     public function getDriver()
     {
         return 'Oracle';

+ 5 - 0
tests/Zend/Db/Table/Pdo/OciTest.php

@@ -100,6 +100,11 @@ class Zend_Db_Table_Pdo_OciTest extends Zend_Db_Table_TestCommon
         $this->assertEquals(5, $insertResult);
     }
 
+    protected function _getRowForTableAndIdentityWithVeryLongName()
+    {
+        return array('thisisalongtablenameidentity' => 1, 'stuff' => 'information');
+    }
+
     public function getDriver()
     {
         return 'Pdo_Oci';

+ 23 - 1
tests/Zend/Db/Table/TestCommon.php

@@ -1614,6 +1614,28 @@ abstract class Zend_Db_Table_TestCommon extends Zend_Db_Table_TestSetup
         return $cacheFrontend;
     }
 
+    /**
+     * @group ZF-5674
+     */
+    public function testTableAndIdentityWithVeryLongName()
+    {
+        Zend_Db_Table::setDefaultAdapter($this->_db);
+        // create test table using no identifier quoting
+        $this->_util->createTable('thisisaveryverylongtablename', array(
+            'thisisalongtablenameidentity' => 'IDENTITY',
+            'stuff' => 'VARCHAR(32)'
+        ));
+        $tableName = $this->_util->getTableName('thisisaveryverylongtablename');
+        $table = new Zend_Db_Table('thisisaveryverylongtablename');
+        $row = $table->createRow($this->_getRowForTableAndIdentityWithVeryLongName());
+        $row->save();
+        $rowset = $table->find(1);
+        $this->assertEquals(1, count($rowset));
+        $this->_util->dropTable('thisisaveryverylongtablename');
+    }
 
-
+    protected function _getRowForTableAndIdentityWithVeryLongName()
+    {
+        return array('stuff' => 'information');
+    }
 }