Issue Bug Closed

#57206Fix incomplete mocking in several tests

Helmut Hummel 03/23/14, 14:22 updated 10/02/18, 11:58

Description

IndexerServiceTest and ExtensionManagementServiceTest
both execute emit signal methods which in turn
try to instantiate the SignalSlotDispatcher,
which can fail.

Resolve this by mocking these methods.

In fact the following happened:

  • a core test instantiates SignalSlotDispatcher with ObjectMananger and succeeds because it mocked TYPO3_DB so ClassInfoCache (with DB Backend) does work as DB call just returns nothing
  • the singleton SignalSlotDispatcher is stored in the singleton ObjectMananger as instance
  • now the ExtensionManagementServiceTest can also get an instance of the SignalSlotDispatcher as the ObjectMananger has it already
  • When executing ExtensionManagementServiceTest alone, there is no mocking of TYPO3_DB and no available SignalSlotDispatcher in ObjectMananger so the ClassInfoCache tries to fetch the class info from DB and fails because TYPO3_DB is not an object.

Reviews 1