/**
  * @test
  */
 public function loadModuleDataReturnsModuleDataObjectForEmptyModuleData()
 {
     // Simulate empty module data
     unset($GLOBALS['BE_USER']->uc['moduleData'][\TYPO3\CMS\Beuser\Service\ModuleDataStorageService::KEY]);
     $result = $this->fixture->loadModuleData();
     $this->assertInstanceOf('TYPO3\\CMS\\Beuser\\Domain\\Model\\ModuleData', $result);
 }
 /**
  * Load and persist module data
  *
  * @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request
  * @param \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response
  * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException
  * @return void
  */
 public function processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response)
 {
     $this->moduleData = $this->moduleDataStorageService->loadModuleData();
     // We "finally" persist the module data.
     try {
         parent::processRequest($request, $response);
         $this->moduleDataStorageService->persistModuleData($this->moduleData);
     } catch (\CMS\Extbase\Mvc\Exception\StopActionException $e) {
         $this->moduleDataStorageService->persistModuleData($this->moduleData);
         throw $e;
     }
 }
 /**
  * Removes given backend user to the compare list
  *
  * @param integer $uid
  * @return void
  */
 public function removeFromCompareListAction($uid)
 {
     $this->moduleData->detachUidCompareUser($uid);
     $this->moduleDataStorageService->persistModuleData($this->moduleData);
     $this->forward('index');
 }