[TYPO3-dev] Problems with phpunit feature backupGlobals

Helmut Hummel helmut at typo3.org
Sun Aug 22 08:17:51 CEST 2010


Hi,

during writing the unit tests for t3lib_preparedStatement class, I
encontered a problem with the backupGlobals feature of phpunit.

This feature comes in heandy since, when acitveated, it takes care of
backing up and restoring all global and superglobal variables.

Unfortunately it does so by serializing each variable. Because
serializing does not support resource types[1], the $GLOBALS['TYPO3_DB']
object is missing the $GLOBALS['TYPO3_DB']->link.

Unfortunately quite some tests in TYPO3 core are setting this class
variable to true, affecting all following test, which needs database access.

Does anybody have an idea how to solve this problem? Since I do not
understand, why phpunit serializes the variables, I would go fix/ patch
it to make it worl for us.

Regards Helmut

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




More information about the TYPO3-dev mailing list