/** * @test */ public function canViewRegistrationsListMessageWithLoginAndAccessDeniedReturnsAccessDeniedMessage() { $fixture = $this->getMock('tx_seminars_seminar', array('needsRegistration', 'canViewRegistrationsList'), array(), '', FALSE); $fixture->expects(self::any())->method('needsRegistration')->will(self::returnValue(TRUE)); $fixture->expects(self::any())->method('canViewRegistrationsList')->will(self::returnValue(FALSE)); $this->testingFramework->createFakeFrontEnd(); $this->testingFramework->createAndLoginFrontEndUser(); self::assertSame($fixture->translate('message_accessDenied'), $fixture->canViewRegistrationsListMessage('list_registrations', 'world')); }
/** * @test */ public function getRegistrationDataForThemselvesSelectedAndSeparateAttendeesRecordsEnabledContainsEMailAddress() { $this->testingFramework->createAndLoginFrontEndUser('', array('name' => 'Jane Doe', 'email' => '*****@*****.**')); $fixture = new tx_seminars_FrontEnd_RegistrationForm(array('templateFile' => 'EXT:seminars/Resources/Private/Templates/FrontEnd/FrontEnd.html', 'showRegistrationFields' => 'attendees_names,registered_themselves', 'createAdditionalAttendeesAsFrontEndUsers' => TRUE), $GLOBALS['TSFE']->cObj); $fixture->setTestMode(); $event = new tx_seminars_seminar($this->seminarUid); $fixture->setSeminar($event); $fixture->setFakedFormValue('registered_themselves', '1'); self::assertContains('*****@*****.**', $fixture->getAllRegistrationDataForConfirmation()); }
/** * @test */ public function myEventsListCallsModifyListRowHook() { /** @var tx_seminars_Model_Event $event */ $event = tx_oelib_MapperRegistry::get('tx_seminars_Mapper_Event')->find($this->seminarUid); $this->testingFramework->createAndLoginFrontEndUser(); $hook = $this->getMock('tx_seminars_Interface_Hook_EventListView'); $hook->expects(self::once())->method('modifyListRow')->with($event, self::anything()); // We don't test for the second parameter (the template instance here) // because we cannot access it from the outside. $hookClass = get_class($hook); $GLOBALS['T3_VAR']['getUserObj'][$hookClass] = $hook; $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['seminars']['listView'][$hookClass] = $hookClass; $this->fixture->main('', array()); }
/** * @test */ public function limitToMissingRegistrationsLimitsOutputToMissingRegistrationsOnly() { $userUid = $this->testingFramework->createAndLoginFrontEndUser(); $this->testingFramework->changeRecord('tx_seminars_seminars', $this->seminarUid, array('object_type' => tx_seminars_Model_Event::TYPE_TOPIC)); $requiredEvent1 = $this->testingFramework->createRecord('tx_seminars_seminars', array('object_type' => tx_seminars_Model_Event::TYPE_TOPIC, 'title' => 'required_foo')); $this->testingFramework->createRecord('tx_seminars_seminars', array('object_type' => tx_seminars_Model_Event::TYPE_DATE, 'topic' => $requiredEvent1)); $this->testingFramework->createRelationAndUpdateCounter('tx_seminars_seminars', $this->seminarUid, $requiredEvent1, 'requirements'); $requiredEvent2 = $this->testingFramework->createRecord('tx_seminars_seminars', array('object_type' => tx_seminars_Model_Event::TYPE_TOPIC, 'title' => 'required_bar')); $requiredDate2 = $this->testingFramework->createRecord('tx_seminars_seminars', array('object_type' => tx_seminars_Model_Event::TYPE_DATE, 'topic' => $requiredEvent2)); $this->testingFramework->createRelationAndUpdateCounter('tx_seminars_seminars', $this->seminarUid, $requiredEvent2, 'requirements'); $this->testingFramework->createRecord('tx_seminars_attendances', array('seminar' => $requiredDate2, 'user' => $userUid)); $this->fixture->setEvent(new tx_seminars_seminar($this->seminarUid)); $this->fixture->limitToMissingRegistrations(); self::assertNotContains('required_bar', $this->fixture->render()); }
/** * @test */ public function removeRegistrationWithFittingQueueRegistrationCallsSeminarRegistrationMovedFromQueueHook() { $hookClass = uniqid('tx_registrationHook'); $hook = $this->getMock($hookClass, array('seminarRegistrationMovedFromQueue')); // We cannot test for the expected parameters because the registration // instance does not exist yet at this point. $hook->expects(self::once())->method('seminarRegistrationMovedFromQueue'); $GLOBALS['T3_VAR']['getUserObj'][$hookClass] = $hook; $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['seminars']['registration'][$hookClass] = $hookClass; $userUid = $this->testingFramework->createAndLoginFrontEndUser(); $seminarUid = $this->seminarUid; $this->createFrontEndPages(); $registrationUid = $this->testingFramework->createRecord('tx_seminars_attendances', array('user' => $userUid, 'seminar' => $seminarUid)); $this->testingFramework->createRecord('tx_seminars_attendances', array('user' => $userUid, 'seminar' => $seminarUid, 'seats' => 1, 'registration_queue' => 1)); $this->fixture->removeRegistration($registrationUid, $this->pi1); }
/** * Creates an FE user, registers them to the seminar with the UID in * $this->seminarUid and logs them in. * * Note: This function creates a registration record. * * @return void */ private function createLogInAndRegisterFrontEndUser() { $this->feUserUid = $this->testingFramework->createAndLoginFrontEndUser('', array('name' => 'Tom & Jerry')); $this->registrationUid = $this->testingFramework->createRecord('tx_seminars_attendances', array('seminar' => $this->seminarUid, 'user' => $this->feUserUid)); }
/** * @test */ public function setRegistrationDataWithCompanyGivenStoresCompanyIntoTheObject() { $userUid = $this->testingFramework->createAndLoginFrontEndUser(); $this->fixture->setRegistrationData($this->fixture->getSeminarObject(), $userUid, array('company' => 'Foo' . LF . 'Bar Inc')); self::assertSame('Foo' . LF . 'Bar Inc', $this->fixture->getRegistrationData('company')); }