ZF-1868: Add a unit test to fetch a LOB column
Description
As a first step to creating more test coverage for the Zend_Db component, I have created a simple unit test that fetches LOBs. It retrieves both a BLOB and a CLOB column, then does a string comparison.
The test is called testAdapterFetchLob() and is placed in the file:
tests/Zend/Db/Adapter/TestCommon.php
This requires some DDL that creates a table with LOB columns and also populates the table with 1 row. This is provided in:
tests/Zend/Db/TestUtil/Common.php
This may have to be changed because different databases may define LOBs differently. For example, MySQL uses TEXT, not CLOB.
Also, I made a DB2-specific modification to allow a string to be inserted as a BLOB in the file:
tests/Zend/Db/TestUtil/Db2.php
Please review the unit test and change as appropriate. If you also have some suggestions on what other type of LOB tests could be useful, I can add them as time permits.
Comments
Posted by Salvador Ledezma (ledezma) on 2007-08-20T19:19:04.000+0000
testAdapterFetchLob() is defined here
Posted by Salvador Ledezma (ledezma) on 2007-08-20T19:19:48.000+0000
DDL and population of LOB table
Posted by Salvador Ledezma (ledezma) on 2007-08-20T19:20:31.000+0000
DB2-specific change to convert a string to a BLOB.
Posted by Bill Karwin (bkarwin) on 2007-08-24T17:49:55.000+0000
Assign to Bill Karwin.
Posted by Salvador Ledezma (ledezma) on 2007-08-30T15:25:05.000+0000
I expanded the original test to now include 4 asserts:
Updated files now include:
tests/Zend/Db/TestUtil/Common.php -- contains DDL and data for table tests/Zend/Db/TestUtil/Db2.php -- DB2 specific data for a BLOB column tests/Zend/Db/Adapter/TestCommon.php -- testAdapterFetchLob() with 2 new asserts
Posted by Darby Felton (darby) on 2007-11-13T14:18:02.000+0000
Assigning to [~ledezma]
Posted by Thomas Weidner (thomas) on 2008-03-12T14:44:46.000+0000
Hy Salvador,
if you are not able to commit this patch, you should un-assign this issue so anyone with commit-rights will do this.
Otherwise please commit your changes and close this issue. ;-)
Posted by Salvador Ledezma (ledezma) on 2008-03-12T17:59:37.000+0000
I had submitted these patches for review by someone with commit authority.
Please use as you see fit.
Posted by Wil Sinclair (wil) on 2008-03-25T22:02:49.000+0000
Resetting 'fix version priority' and 'fix version' to be re-evaluated for next release.
Posted by Mickael Perraud (mikaelkael) on 2010-02-19T13:33:02.000+0000
Tests added with correction of ZF-5146 (r13071)