/** @test */
 public function getSessionDataByNamespaceReturnsCorrectValue()
 {
     $sessionAdapterMock = new Tx_PtExtbase_Tests_Unit_State_Stubs_SessionAdapterMock();
     $sessionPersistenceManager = new Tx_PtExtbase_State_Session_SessionPersistenceManager($sessionAdapterMock);
     $sessionPersistenceManager->init();
     $this->assertEquals($sessionPersistenceManager->getSessionDataByNamespace('test1.test2.test3'), 'value');
 }
 /**
  * (non-PHPdoc)
  *
  * @see Tx_PtExtbase_State_Session_SessionPersistableInterface::persistToSession()
  */
 public function _persistToSession()
 {
     if ($this->currentPage > 1) {
         return array('page' => $this->currentPage);
     } else {
         /*
          *  Page 1 is default therefore we don't need it in the session
          *
          *  Don't change this, this belongs to RealUrl configuration if everything is
          *  put into URL.
          */
         $this->sessionPersistenceManager->removeSessionDataByNamespace($this->getObjectNamespace());
         return NULL;
     }
 }
 /**
  * @return void
  */
 protected function resetSessionOnResetParameter()
 {
     if ($this->configurationBuilder->buildBaseConfiguration()->getResetSessionOnResetParameter() && $this->getPostVarAdapterFactory->getInstance()->getParametersByNamespace($this->listIdentifier . '.resetSession')) {
         $this->sessionPersistenceManager->resetSessionData();
     }
 }
 /**
  * Adds content to bookmark which has to be stored in bookmark
  *
  * @param Tx_PtExtlist_Domain_Model_Bookmark_Bookmark $bookmark
  */
 public function addContentToBookmark(Tx_PtExtlist_Domain_Model_Bookmark_Bookmark $bookmark)
 {
     $this->bookmarkStrategy->addContentToBookmark($bookmark, $this->configurationBuilder, $this->sessionPersistenceManager->getSessionData());
 }