Example #1
0
 /**
  * @test
  */
 public function renderForZeroRecordsAndSeparatorEnabledReturnsOnlySeparatorSpecificationAndHeader()
 {
     $pageUid = $this->testingFramework->createSystemFolder();
     $this->subject->setPageUid($pageUid);
     $this->configuration->setAsString('fieldsFromEventsForCsv', 'uid,title');
     $this->configuration->setAsBoolean('addExcelSpecificSeparatorLineToCsv', TRUE);
     self::assertSame('sep=;' . CRLF . $this->localizeAndRemoveColon('tx_seminars_seminars.uid') . ';' . $this->localizeAndRemoveColon('tx_seminars_seminars.title') . CRLF, $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 #3
0
 /**
  * @test
  */
 public function sendRemindersToOrganizersForShowAttendancesOnQueueInEmailCsvFalseSendsEmailWithCsvFileWhichDoesNotContainDataOfAttendanceOnQueue()
 {
     $this->configuration->setAsBoolean('addRegistrationCsvToOrganizerReminderMail', TRUE);
     $this->configuration->setAsBoolean('showAttendancesOnRegistrationQueueInEmailCsv', FALSE);
     $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' => 'real registration', 'seminar' => $eventUid, 'user' => $this->testingFramework->createFrontEndUser()));
     $this->testingFramework->createRecord('tx_seminars_attendances', array('title' => 'on queue', 'seminar' => $eventUid, 'user' => $this->testingFramework->createFrontEndUser(), 'registration_queue' => 1));
     $this->fixture->sendEventTakesPlaceReminders();
     self::assertNotContains('on queue', $this->getFirstEmailAttachment()->getBody());
 }
Example #4
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));
 }
 /**
  * @test
  */
 public function hasAccessForVipFrontEndUserAndVipAccessReturnsTrue()
 {
     $this->seminarsPluginConfiguration->setAsBoolean('allowCsvExportOfRegistrationsInMyVipEventsView', TRUE);
     $user = $this->getMock('tx_seminars_Model_FrontEndUser');
     $userUid = 42;
     $user->expects(self::any())->method('getUid')->will(self::returnValue($userUid));
     /** @var $user tx_seminars_Model_FrontEndUser */
     Tx_Oelib_FrontEndLoginManager::getInstance()->logInUser($user);
     $event = $this->getMock('tx_seminars_seminar', array(), array(), '', FALSE);
     $event->expects(self::any())->method('isUserVip')->with($userUid, $this->vipsGroupUid)->will(self::returnValue(TRUE));
     /** @var $event tx_seminars_seminar */
     $this->subject->setEvent($event);
     self::assertTrue($this->subject->hasAccess());
 }
 /**
  * @test
  */
 public function renderForBothConfigurationFieldsEmptyAndSeparatorDisabledReturnsEmptyLine()
 {
     $this->configuration->setAsBoolean('addExcelSpecificSeparatorLineToCsv', FALSE);
     self::assertSame(CRLF, $this->subject->render());
 }