示例#1
0
 /**
  * @test
  */
 public function renderWithDeletedUserForRegistrationHidesUsersRegistration()
 {
     $this->fixture->setConfigurationValue('showRegistrationFieldsInRegistrationList', 'uid');
     $this->createLogInAndRegisterFrontEndUser();
     $this->testingFramework->changeRecord('fe_users', $this->feUserUid, array('deleted' => 1));
     self::assertNotContains((string) $this->registrationUid, $this->fixture->render());
 }
示例#2
0
 /**
  * @test
  */
 public function singleViewForEventWithoutRegistrationBeginShowsRegistrationLink()
 {
     $this->fixture->setConfigurationValue('enableRegistration', TRUE);
     $this->testingFramework->changeRecord('tx_seminars_seminars', $this->seminarUid, array('needs_registration' => 1, 'attendees_max' => 0, 'begin_date' => $GLOBALS['SIM_EXEC_TIME'] + 42, 'begin_date_registration' => 0));
     $this->fixture->setConfigurationValue('what_to_display', 'single_view');
     $this->fixture->piVars['showUid'] = $this->seminarUid;
     self::assertContains($this->fixture->translate('label_onlineRegistration'), $this->fixture->main('', array()));
 }
 /**
  * @test
  */
 public function renderForSingleEventEmptyLinkNotShowsErrorMessage()
 {
     $this->testingFramework->changeRecord('tx_seminars_seminars', $this->eventUid, array('object_type' => tx_seminars_Model_Event::TYPE_COMPLETE));
     $linkBuilder = $this->getMock('tx_seminars_Service_SingleViewLinkBuilder', array('createAbsoluteUrlForEvent'));
     $linkBuilder->expects(self::any())->method('createAbsoluteUrlForEvent')->will(self::returnValue(''));
     $this->fixture->injectLinkBuilder($linkBuilder);
     self::assertNotContains($GLOBALS['LANG']->getLL('eventMailForm_error_noDetailsPageFound'), $this->fixture->render());
 }
示例#4
0
 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());
 }
示例#5
0
 /**
  * @test
  */
 public function getTimeSlotsWithOneTimeSlotReturnsOneTimeSlot()
 {
     $uid = $this->testingFramework->createRecord('tx_seminars_seminars');
     $timeSlotUid = $this->testingFramework->createRecord('tx_seminars_timeslots', array('seminar' => $uid));
     $this->testingFramework->changeRecord('tx_seminars_seminars', $uid, array('timeslots' => $timeSlotUid));
     /** @var tx_seminars_Model_Event $model */
     $model = $this->fixture->find($uid);
     self::assertEquals($timeSlotUid, $model->getTimeSlots()->getUids());
 }
示例#6
0
 /**
  * @test
  */
 public function getRegistrationDataForEnabledPriceFieldReturnsSelectedPriceValue()
 {
     $fixture = new tx_seminars_FrontEnd_RegistrationForm(array('templateFile' => 'EXT:seminars/Resources/Private/Templates/FrontEnd/FrontEnd.html', 'showRegistrationFields' => 'price'), $GLOBALS['TSFE']->cObj);
     $fixture->setTestMode();
     $this->testingFramework->changeRecord('tx_seminars_seminars', $this->seminarUid, array('price_regular' => 42));
     $event = new tx_seminars_seminar($this->seminarUid);
     $fixture->setSeminar($event);
     $fixture->setFakedFormValue('price', 42);
     self::assertContains('42', $fixture->getAllRegistrationDataForConfirmation());
 }
 /**
  * @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());
 }
示例#8
0
 /**
  * @test
  */
 public function getPageUidForRecordWithPageUidZeroReturnsZero()
 {
     $this->testingFramework->changeRecord('tx_seminars_test', $this->fixtureUid, array('pid' => 0));
     $fixture = new tx_seminars_tests_fixtures_OldModel_Testing($this->fixtureUid);
     self::assertEquals(0, $fixture->getPageUid());
 }
 /**
  * @test
  */
 public function existsSeminarMessageForExistingHiddenUidReturnsErrorMessage()
 {
     $this->testingFramework->changeRecord('tx_seminars_seminars', $this->seminarUid, array('hidden' => 1));
     self::assertContains($this->fixture->translate('message_wrongSeminarNumber'), $this->fixture->existsSeminarMessage($this->seminarUid));
 }
示例#10
0
 /**
  * @test
  */
 public function hasExistingFrontEndUserWithInexistentFrontEndUserReturnsFalse()
 {
     $this->testingFramework->changeRecord('fe_users', $this->fixture->getUser(), array('deleted' => 1));
     self::assertFalse($this->fixture->hasExistingFrontEndUser());
 }