Issue Bug Closed

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

Helmut Hummel 08/23/10, 23:37 updated 10/02/18, 12:22

Description

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.

(issue imported from #M15539)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.