/** * @test */ public function getFeUserGetsFeUser() { $expected = $this->getMock('\\TYPO3\\CMS\\Extbase\\Domain\\Model\\FrontendUser'); $this->proxy->_set('feUser', $expected); $actual = $this->proxy->getFeUser(); $this->assertEquals($expected, $actual); }
/** * Action for deleting a bookmark * * @param Tx_PtExtlist_Domain_Model_Bookmark_Bookmark $bookmark Bookmark to be deleted */ public function deleteAction(Tx_PtExtlist_Domain_Model_Bookmark_Bookmark $bookmark) { if ($bookmark->getFeUser()->getUid() == $this->feUser->getUid() || $this->bookmarkConfiguration->getUserCanDeleteAll()) { $this->bookmarkRepository->remove($bookmark); $this->persistenceManager->persistAll(); } else { $this->flashMessageContainer->add('You are not allowed to delete this bookmark.'); } $this->forward('show'); }