Example #1
0
 /**
  * @test
  */
 public function sendRemindersToOrganizersForEventWithOneRegistrationsSendsReminderWithMessageWithNumberOfRegistrations()
 {
     $eventUid = $this->createSeminarWithOrganizer(array('begin_date' => $GLOBALS['SIM_EXEC_TIME'] + tx_oelib_Time::SECONDS_PER_DAY, 'cancelled' => tx_seminars_seminar::STATUS_CONFIRMED));
     $this->testingFramework->createRecord('tx_seminars_attendances', array('title' => 'test registration', 'seminar' => $eventUid, 'user' => $this->testingFramework->createFrontEndUser()));
     $this->fixture->sendEventTakesPlaceReminders();
     self::assertContains('1', $this->mailer->getFirstSentEmail()->getBody());
 }
Example #2
0
 /**
  * @test
  */
 public function relatedRecordWithExistingUidCanReturnOtherModelType()
 {
     $ownerUid = $this->testingFramework->createFrontEndUser();
     $uid = $this->testingFramework->createRecord('tx_oelib_test', array('owner' => $ownerUid));
     /** @var Tx_Oelib_Tests_Unit_Fixtures_TestingModel $model */
     $model = $this->subject->find($uid);
     self::assertInstanceOf('Tx_Oelib_Model_FrontEndUser', $model->getOwner());
 }
 /**
  * @test
  */
 public function renderReturnsRegistrationsOnSubpageOfGivenPage()
 {
     $this->subject->setEventUid(0);
     $this->subject->setPageUid($this->pageUid);
     $subpagePid = $this->testingFramework->createSystemFolder($this->pageUid);
     $this->registrationFieldKeys = array('address');
     $this->testingFramework->createRecord('tx_seminars_attendances', array('seminar' => $this->eventUid, 'user' => $this->testingFramework->createFrontEndUser(), 'address' => 'foo', 'pid' => $subpagePid));
     self::assertContains('foo', $this->subject->render());
 }
 /**
  * @test
  */
 public function renderForQueueRegistrationsAllowedForEmailNotContainsRegistrationOnQueue()
 {
     $this->configuration->setAsBoolean('showAttendancesOnRegistrationQueueInEmailCsv', TRUE);
     $this->configuration->setAsBoolean('showAttendancesOnRegistrationQueueInCSV', FALSE);
     $this->configuration->setAsString('fieldsFromAttendanceForCsv', 'uid');
     $this->configuration->setAsString('fieldsFromAttendanceForEmailCsv', 'uid');
     $registrationUid = $this->testingFramework->createRecord('tx_seminars_attendances', array('seminar' => $this->eventUid, 'crdate' => $GLOBALS['SIM_EXEC_TIME'], 'user' => $this->testingFramework->createFrontEndUser(), 'registration_queue' => TRUE));
     self::assertContains((string) $registrationUid, $this->subject->render());
 }
Example #5
0
 /**
  * @test
  */
 public function createAndOutputListOfRegistrationsForWebModeNotUsesRegistrationsOnQueueSettingFromEmailConfiguration()
 {
     $this->configuration->setAsBoolean('showAttendancesOnRegistrationQueueInEmailCsv', TRUE);
     $this->configuration->setAsString('fieldsFromAttendanceForEmailCsv', 'uid');
     $this->configuration->setAsBoolean('showAttendancesOnRegistrationQueueInCsv', FALSE);
     $this->configuration->setAsString('fieldsFromAttendanceForCsv', 'uid');
     $this->testingFramework->createRecord('tx_seminars_attendances', array('seminar' => $this->eventUid, 'user' => $this->testingFramework->createFrontEndUser()));
     $queueUid = $this->testingFramework->createRecord('tx_seminars_attendances', array('seminar' => $this->eventUid, 'user' => $this->testingFramework->createFrontEndUser(), 'bank_name' => 'foo bank', 'registration_queue' => 1));
     self::assertNotContains((string) $queueUid, $this->fixture->createAndOutputListOfRegistrations($this->eventUid));
 }
Example #6
0
 public function testLimitToTopicsWithoutRegistrationByUserAndLimitToRequiredEventTopicsCanReturnOneEntry()
 {
     $requiredTopicUid = $this->testingFramework->createRecord('tx_seminars_seminars', array('object_type' => tx_seminars_Model_Event::TYPE_TOPIC));
     $this->testingFramework->createRecord('tx_seminars_seminars', array('object_type' => tx_seminars_Model_Event::TYPE_DATE, 'topic' => $requiredTopicUid));
     $eventUid = $this->testingFramework->createRecord('tx_seminars_seminars', array('requirements' => 1, 'object_type' => tx_seminars_Model_Event::TYPE_TOPIC));
     $this->testingFramework->createRelation('tx_seminars_seminars_requirements_mm', $eventUid, $requiredTopicUid);
     $this->fixture->limitToRequiredEventTopics($eventUid);
     $this->fixture->limitToTopicsWithoutRegistrationByUser($this->testingFramework->createFrontEndUser());
     $bag = $this->fixture->build();
     self::assertSame(1, $bag->count());
 }
Example #7
0
 /**
  * @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']);
 }