/**
  * Creates a fake extension with a given table definition.
  *
  * @param string $tableDefinition SQL script to create the extension's tables
  * @throws \RuntimeException
  * @return void
  */
 protected function createFakeExtension($tableDefinition)
 {
     // Prepare a fake extension configuration
     $ext_tables = GeneralUtility::tempnam('ext_tables');
     if (!GeneralUtility::writeFile($ext_tables, $tableDefinition)) {
         throw new \RuntimeException('Can\'t write temporary ext_tables file.');
     }
     $this->temporaryFiles[] = $ext_tables;
     $GLOBALS['TYPO3_LOADED_EXT'] = array('test_dbal' => array('ext_tables.sql' => $ext_tables));
     // Append our test table to the list of existing tables
     $this->subject->initialize();
 }