protected function setUp() { tx_seminars_registrationchild::purgeCachedSeminars(); $this->testingFramework = new tx_oelib_testingFramework('tx_seminars'); $this->testingFramework->createFakeFrontEnd(); tx_oelib_ConfigurationRegistry::getInstance()->set('plugin.tx_seminars', new tx_oelib_Configuration()); $organizerUid = $this->testingFramework->createRecord('tx_seminars_organizers', array('title' => 'test organizer', 'email' => '*****@*****.**')); $this->seminarUid = $this->testingFramework->createRecord('tx_seminars_seminars', array('organizers' => 1, 'title' => 'foo_event')); $this->testingFramework->createRelation('tx_seminars_seminars_organizers_mm', $this->seminarUid, $organizerUid); $this->feUserUid = $this->testingFramework->createFrontEndUser('', array('name' => 'foo_user', 'email' => '*****@*****.**')); $this->registrationUid = $this->testingFramework->createRecord('tx_seminars_attendances', array('title' => 'test title', 'seminar' => $this->seminarUid, 'interests' => 'nothing', 'expectations' => '', 'background_knowledge' => 'foo' . LF . 'bar', 'known_from' => 'foo' . CR . 'bar', 'user' => $this->feUserUid)); $this->fixture = new tx_seminars_registrationchild($this->registrationUid); $this->fixture->setConfigurationValue('templateFile', 'EXT:seminars/Resources/Private/Templates/Mail/e-mail.html'); }
/** * @test */ public function showForNoEventUidDoesNotAddEventUidToCsvExportIcon() { $userUid = $this->testingFramework->createFrontEndUser('', array('name' => 'user_foo')); $eventUid = $this->testingFramework->createRecord('tx_seminars_seminars'); $this->testingFramework->createRecord('tx_seminars_attendances', array('seminar' => $eventUid, 'user' => $userUid)); self::assertNotContains('tx_seminars_pi2[eventUid]=', $this->fixture->show()); }
/** * @test */ public function renderCanContainWaitingListRegistrations() { $this->fixture->setConfigurationValue('showRegistrationFieldsInRegistrationList', 'uid'); $this->createLogInAndRegisterFrontEndUser(); $feUserUid = $this->testingFramework->createFrontEndUser(); $secondRegistration = $this->testingFramework->createRecord('tx_seminars_attendances', array('seminar' => $this->seminarUid, 'user' => $feUserUid, 'registration_queue' => 1)); self::assertRegExp('/<td>' . $secondRegistration . '/s', $this->fixture->render()); }
/** * @test */ public function relationToAdditionalPersonsReturnsPersonsFromDatabase() { $registrationUid = $this->testingFramework->createRecord('tx_seminars_attendances', array('additional_persons' => 1)); $personUid = $this->testingFramework->createFrontEndUser('', array('tx_seminars_registration' => $registrationUid)); /** @var tx_seminars_Model_Registration $model */ $model = $this->fixture->find($registrationUid); self::assertEquals((string) $personUid, $model->getAdditionalPersons()->getUids()); }
/** * @test */ public function singleViewForEventWithNoVacanciesAndNoQueueDoesNotShowRegistrationLink() { $this->fixture->setConfigurationValue('enableRegistration', TRUE); $this->testingFramework->changeRecord('tx_seminars_seminars', $this->seminarUid, array('needs_registration' => 1, 'attendees_max' => 1, 'queue_size' => 0, 'begin_date' => $GLOBALS['SIM_EXEC_TIME'] + 42)); $this->testingFramework->createRecord('tx_seminars_attendances', array('seminar' => $this->seminarUid, 'user' => $this->testingFramework->createFrontEndUser())); $this->fixture->setConfigurationValue('what_to_display', 'single_view'); $this->fixture->piVars['showUid'] = $this->seminarUid; self::assertNotContains(sprintf($this->fixture->translate('label_onlineRegistrationOnQueue'), 0), $this->fixture->main('', array())); }
public function testLimitToExistingUsersDoesNotFindRegistrationWithDeletedUser() { $feUserUid = $this->testingFramework->createFrontEndUser(); $this->testingFramework->changeRecord('fe_users', $feUserUid, array('deleted' => 1)); $this->testingFramework->createRecord('tx_seminars_attendances', array('user' => $feUserUid)); $this->fixture->limitToExistingUsers(); $bag = $this->fixture->build(); self::assertTrue($bag->isEmpty()); }
/** * @test */ public function collidingEventsDoNoCollideIfCollisionSkipIsEnabledForAnotherEvent() { $frontEndUserUid = $this->testingFramework->createFrontEndUser(); $begin = $GLOBALS['SIM_EXEC_TIME']; $end = $begin + 1000; $this->fixture->setBeginDate($begin); $this->fixture->setEndDate($end); $eventUid = $this->testingFramework->createRecord('tx_seminars_seminars', array('begin_date' => $begin, 'end_date' => $end, 'skip_collision_check' => 1)); $this->testingFramework->createRecord('tx_seminars_attendances', array('seminar' => $eventUid, 'user' => $frontEndUserUid)); self::assertFalse($this->fixture->isUserBlocked($frontEndUserUid)); }
/** * @test */ public function notifyOrganizersCallsModifyOrganizerNotificationEmailHookWithTemplate() { $this->fixture->setConfigurationValue('sendNotification', TRUE); $registrationUid = $this->testingFramework->createRecord('tx_seminars_attendances', array('seminar' => $this->seminarUid, 'user' => $this->testingFramework->createFrontEndUser())); $registration = new tx_seminars_registrationchild($registrationUid); $hook = $this->getMock('tx_seminars_Interface_Hook_Registration'); $hookClassName = get_class($hook); $hook->expects(self::once())->method('modifyOrganizerNotificationEmail')->with(self::anything(), self::isInstanceOf('Tx_Oelib_Template')); $GLOBALS['T3_VAR']['getUserObj'][$hookClassName] = $hook; $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['seminars']['registration'][$hookClassName] = $hookClassName; $this->fixture->notifyOrganizers($registration); }
/** * @test */ public function sendEmailForTwoRegistrationsCallsHookTwice() { $this->testingFramework->createRecord('tx_seminars_attendances', array('pid' => $this->dummySysFolderUid, 'seminar' => $this->eventUid, 'user' => $this->testingFramework->createFrontEndUser('', array('email' => '*****@*****.**', 'name' => 'foo User')))); $this->testingFramework->createRecord('tx_seminars_attendances', array('pid' => $this->dummySysFolderUid, 'seminar' => $this->eventUid, 'user' => $this->testingFramework->createFrontEndUser('', array('email' => '*****@*****.**', 'name' => 'foo User')))); $hook = $this->getMock('tx_seminars_Interface_Hook_BackEndModule'); $hook->expects(self::exactly(2))->method('modifyCancelEmail'); $hookClass = get_class($hook); $GLOBALS['T3_VAR']['getUserObj'][$hookClass] = $hook; $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['seminars']['backEndModule'][$hookClass] = $hookClass; $this->fixture->setPostData(array('action' => 'confirmEvent', 'isSubmitted' => '1', 'sender' => $this->organizerUid, 'subject' => 'foo', 'messageBody' => 'some message body')); $this->fixture->render(); }