[BUGFIX] #5166 Port TestingFramework changes from oelib

Change-Id: Iec0fab2815e68d48ec7faea37820f0486828a6c5
Reviewed-on: http://review.typo3.org/34483
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Tested-by: Oliver Klee <typo3-coding@oliverklee.de>