Exemplo n.º 1
0
 /**
  * @test
  */
 public function restoreBookmarkRestoresBookmark()
 {
     $bookmarkMock = $this->getMockBuilder('Tx_PtExtlist_Domain_Model_Bookmark_Bookmark')->disableOriginalClone()->getMock();
     $sessionPersistenceManagerMock = $this->getMockBuilder('Tx_PtExtbase_State_Session_SessionPersistenceManager')->setMethods(array('init', 'getSessionData', 'setSessionData'))->disableOriginalConstructor()->getMock();
     $sessionPersistenceManagerMock->expects($this->once())->method('init');
     $sessionPersistenceManagerMock->expects($this->once())->method('getSessionData')->will($this->returnValue(array('sessionData')));
     $sessionPersistenceManagerMock->expects($this->once())->method('setSessionData')->with(array('mergedSessionData'));
     $bookmarkStrategyMock = $this->getMockBuilder('Tx_PtExtlist_Domain_Model_Bookmark_BookmarkStrategy')->setMethods(array('mergeSessionAndBookmark'))->getMock();
     $bookmarkStrategyMock->expects($this->once())->method('mergeSessionAndBookmark')->with($bookmarkMock, array('sessionData'))->will($this->returnValue(array('mergedSessionData')));
     $this->proxy->_set('sessionPersistenceManager', $sessionPersistenceManagerMock);
     $this->proxy->_set('bookmarkStrategy', $bookmarkStrategyMock);
     $this->proxy->restoreBookmark($bookmarkMock);
     $this->assertEquals(true, $this->proxy->_get('bookmarkIsRestored'));
 }