public function setUp() { $GLOBALS['TYPO3_DB'] = $this->getMock(DatabaseConnection::class); $this->subject = new TemplateMailMessage(); $this->configurationManager = $this->getMock(ConfigurationManager::class, array('getConfiguration'), array(), '', false); $this->configurationManager->expects($this->any())->method('getConfiguration')->with(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK)->will($this->returnValue($this->frameworkConfiguration)); $this->inject($this->subject, 'configurationManager', $this->configurationManager); $objectManager = GeneralUtility::makeInstance(ObjectManager::class); $this->inject($this->subject, 'objectManager', $objectManager); }