Details
-
Type:
Unit Tests: Improvement
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Incomplete
-
Affects Version/s: 1.0.1
-
Fix Version/s: None
-
Component/s: Zend_Db
-
Labels:None
-
Fix Version Priority:Nice to Have
Description
I wrote a couple of unit tests to cover different types of case folding to make sure that describeTable() obeys the case folding property.
Please use them if you think they may be helpful for the other adapters – I only tested using the ibm_db2 adapter and the incubator PDO_IBM adapter.
The tests are modeled after the existing testAdapterOptionCaseFoldingXXX() methods and are called:
testAdapterDescribeTableNaturalCase()
testAdapterDescribeTableUpperCase()
testAdapterDescribeTableLowerCase()
There is also a helper method _testAdapterDescribeTableCaseCommon()
Each test takes a form similar to the following:
$params = $this->_util->getParams(); $params['options'] = array( Zend_Db::CASE_FOLDING => Zend_Db::CASE_UPPER); $db = Zend_Db::factory($this->getDriver(), $params); $products = 'zfproducts'; $desc = $db->describeTable($products); $product_id = 'PRODUCT_ID'; $this->assertTrue(array_key_exists($product_id, $desc)); $this->assertEquals($desc[$product_id]['COLUMN_NAME'], $product_id, 'Upper case does not match in describe table');
Please review the added tests for possible inclusion in the test suite if appropriate