[TYPO3-core] RFC: #15539: Unit Tests: $GLOBALS['TYPO3_DB']->link get lost during backup/ restore of global variables

Helmut Hummel helmut at typo3.org
Mon Aug 23 23:47:38 CEST 2010


Hi,

this is a SVN patch request:

Type:
Unit Test Fix

Bugtracker references:
http://bugs.typo3.org/view.php?id=15539

Branches: trunk, 4_4, 4_3


Problem:
When using phpunit's feature of backing up and restoring global
variables, the sql resource link in $GLOBALS['TYPO3_DB']->link is lost,
because PHP serializing does not support resource-types.[1]

If this feature is used in one testcase, the following testcases that
rely on a database link will fail or throw errors, if all tests are
executed at once.

Solution:
Add TYPO3_DB to the blacklist for the globals backup in the core tests
where this phpunit feature is used.

Note:
If the backupGlobals feature is used and the TYPO3_DB is mocked, then
the backup/ restore mus be handled in the testcase. This is currently
not the case within the core unit tests.


[1]http://php.net/serialize


Regards Helmut
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 15539.diff
Type: text/x-patch
Size: 2138 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100823/1ca1684a/attachment.bin>


More information about the TYPO3-team-core mailing list