Zend Framework

Test Coverage of case folding and describe table

Details

  • Type: Unit Tests: Improvement Unit Tests: Improvement
  • Status: Resolved Resolved
  • Priority: Minor 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');

Activity

Hide
Salvador Ledezma added a comment -

Please review the added tests for possible inclusion in the test suite if appropriate

Show
Salvador Ledezma added a comment - Please review the added tests for possible inclusion in the test suite if appropriate
Hide
Bill Karwin added a comment -

Assign to Bill Karwin.

Show
Bill Karwin added a comment - Assign to Bill Karwin.
Hide
Wil Sinclair added a comment -

This issue should have been fixed for the 1.5 release.

Show
Wil Sinclair added a comment - This issue should have been fixed for the 1.5 release.
Hide
Wil Sinclair added a comment -

Please categorize/fix as needed.

Show
Wil Sinclair added a comment - Please categorize/fix as needed.
Hide
Wil Sinclair added a comment -

This doesn't appear to have been fixed in 1.5.0. Please update if this is not correct.

Show
Wil Sinclair added a comment - This doesn't appear to have been fixed in 1.5.0. Please update if this is not correct.
Hide
Wil Sinclair added a comment -

Reassigning as Ralph is the maintainer of Zend_Db

Show
Wil Sinclair added a comment - Reassigning as Ralph is the maintainer of Zend_Db
Hide
Ralph Schindler added a comment -

Will evaluate within 2 weeks.

Show
Ralph Schindler added a comment - Will evaluate within 2 weeks.
Hide
Ralph Schindler added a comment -

Did you try this on any other unit tests other than Db2 by chance? They dont work against MySQL.

-ralph

Show
Ralph Schindler added a comment - Did you try this on any other unit tests other than Db2 by chance? They dont work against MySQL. -ralph
Hide
Ralph Schindler added a comment -

No feedback.

Show
Ralph Schindler added a comment - No feedback.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: