/** * @test */ public function doesCheckFlexFormValueHookGetsCalled() { $GLOBALS['TYPO3_DB'] = $this->getMock('TYPO3\\CMS\\Core\\Database\\DatabaseConnection', array(), array(), '', FALSE); $hookClass = uniqid('tx_coretest'); $hookMock = $this->getMock($hookClass, array('checkFlexFormValue_beforeMerge')); $hookMock->expects($this->once())->method('checkFlexFormValue_beforeMerge'); $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['checkFlexFormValue'][] = $hookClass; $GLOBALS['T3_VAR']['getUserObj'][$hookClass] = $hookMock; $this->subject->checkValue_flex(array(), array(), array(), array(), array(), ''); }