/** * @test */ public function getLoggedInUserWithLoadedModelOfUserNotInDatabaseReturnsThatInstance() { $this->testingFramework->createFakeFrontEnd(); $user = Tx_Oelib_MapperRegistry::get('tx_oelib_Mapper_FrontEndUser')->getNewGhost(); $user->setData(array()); $this->testingFramework->loginFrontEndUser($user->getUid()); self::assertSame($user, $this->subject->getLoggedInUser()); }
/** * @test */ public function modifyDataToInsertForUserGroupSpecificEventPidSetsPidFromUserGroupAsEventPid() { $this->fixture->setConfigurationValue('createEventsPID', 42); $userGroup = tx_oelib_MapperRegistry::get('tx_seminars_Mapper_FrontEndUserGroup')->getLoadedTestingModel(array('tx_seminars_events_pid' => 21)); $user = tx_oelib_MapperRegistry::get('tx_seminars_Mapper_FrontEndUser')->getLoadedTestingModel(array('usergroup' => $userGroup->getUid())); $this->testingFramework->loginFrontEndUser($user->getUid()); $modifiedFormData = $this->fixture->modifyDataToInsert(array()); self::assertEquals(21, $modifiedFormData['pid']); }
/** * @test */ public function loginFrontEndUserMappedAsGhostAndInDatabaseSetsGroupDataOfUser() { $this->subject->createFrontEndPage(); $this->subject->createFakeFrontEnd(); $feUserGroupUid = $this->subject->createFrontEndUserGroup(array('title' => 'foo')); /** @var tx_oelib_Mapper_FrontEndUser $mapper */ $mapper = Tx_Oelib_MapperRegistry::get('tx_oelib_Mapper_FrontEndUser'); /** @var tx_oelib_Model_FrontEndUser $user */ $user = $mapper->find($this->subject->createFrontEndUser($feUserGroupUid)); $this->subject->loginFrontEndUser($user->getUid()); self::assertSame(array($feUserGroupUid => 'foo'), $this->getFrontEndController()->fe_user->groupData['title']); }