Example #1
0
 /**
  * @test
  */
 public function limitToMinimumPriceForMinimumPriceZeroFindsEventWithRegularPrice()
 {
     $this->testingFramework->createRecord('tx_seminars_seminars', array('price_regular' => 16));
     $this->fixture->limitToMinimumPrice(0);
     $bag = $this->fixture->build();
     self::assertSame(1, $bag->count());
 }
Example #2
0
 /**
  * @test
  */
 public function renderHasResultEndingWithCarriageReturnAndLineFeed()
 {
     $this->configuration->setAsString('fieldsFromEventsForCsv', 'uid');
     $this->createEventInFolderAndSetPageUid();
     $this->testingFramework->createRecord('tx_seminars_seminars', array('pid' => $this->pageUid, 'begin_date' => $GLOBALS['SIM_EXEC_TIME'] - 3600));
     self::assertRegExp('/\\r\\n$/', $this->subject->render($this->pageUid));
 }
Example #3
0
 /**
  * @test
  */
 public function getPreselectedOrganizerForTwoAvailableOrganizersReturnsZero()
 {
     $this->testingFramework->createAndLoginFrontEndUser();
     $this->testingFramework->createRecord('tx_seminars_organizers');
     $this->testingFramework->createRecord('tx_seminars_organizers');
     self::assertEquals(0, $this->fixture->getPreselectedOrganizer());
 }
Example #4
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());
 }
 /**
  * @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 #7
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 #8
0
 /**
  * @test
  */
 public function oneToManyRelationsWithOneRelatedModelReturnsListWithRelatedModelWithData()
 {
     $relatedTitle = 'Triss Merrigold';
     $uid = $this->testingFramework->createRecord('tx_oelib_test', array('composition' => 1));
     $this->testingFramework->createRecord('tx_oelib_testchild', array('parent' => $uid, 'title' => $relatedTitle));
     /** @var Tx_Oelib_Tests_Unit_Fixtures_TestingModel $model */
     $model = $this->subject->find($uid);
     /** @var Tx_Oelib_Tests_Unit_Fixtures_TestingModel $firstChildModel */
     $firstChildModel = $model->getComposition()->first();
     self::assertSame($relatedTitle, $firstChildModel->getTitle());
 }
Example #9
0
 public function testHasEventIcon()
 {
     $this->testingFramework->createRecord('tx_seminars_seminars', array('pid' => $this->dummySysFolderPid, 'title' => 'event_1', 'object_type' => tx_seminars_Model_Event::TYPE_COMPLETE));
     self::assertContains('EventComplete.gif', $this->fixture->show());
 }
Example #10
0
 /**
  * Creates a test record.
  *
  * @return int the UID
  */
 private function createTestRecord()
 {
     return $this->testingFramework->createRecord('tx_oelib_test', array('title' => self::TEST_RECORD_TITLE));
 }
Example #11
0
 /**
  * @test
  */
 public function countByWhereClauseWithTwoMatchingRecordsReturnsTwo()
 {
     $this->testingFramework->createRecord('tx_oelib_test', array('title' => 'bar'));
     $this->testingFramework->createRecord('tx_oelib_test', array('title' => 'bar'));
     self::assertSame(2, $this->subject->countByWhereClause('title = "bar"'));
 }
Example #12
0
 /**
  * @test
  */
 public function existsRecordWithUidUsesAdditionalNonEmptyWhereClause()
 {
     $uid = $this->testingFramework->createRecord('tx_oelib_test', array('deleted' => 1));
     self::assertFalse(Tx_Oelib_Db::existsRecordWithUid('tx_oelib_test', $uid, ' AND deleted = 0'));
 }
Example #13
0
 /**
  * @test
  */
 public function increaseRelationCounterThrowsExceptionOnInexistentFieldName()
 {
     $this->setExpectedException('InvalidArgumentException', 'The table tx_oelib_test has no column inexistent_column.');
     $uid = $this->subject->createRecord('tx_oelib_test');
     $this->subject->increaseRelationCounter('tx_oelib_test', $uid, 'inexistent_column');
 }