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 getRegistrationDataForDisabledPaymentMethodFieldReturnsEmptyString() { $selectedPaymentMethodUid = $this->testingFramework->createRecord('tx_seminars_payment_methods', array('title' => 'payment foo')); $this->testingFramework->createRelation('tx_seminars_seminars_payment_methods_mm', $this->seminarUid, $selectedPaymentMethodUid, 'payment_methods'); $this->fixture->setFakedFormValue('method_of_payment', $selectedPaymentMethodUid); self::assertEquals('', $this->fixture->getAllRegistrationDataForConfirmation()); }
public function testRenderCreatesCategoryListContainingLinksToListPageLimitedToCategory() { $this->fixture->setConfigurationValue('listPID', $this->testingFramework->createFrontEndPage()); $categoryUid = $this->testingFramework->createRecord('tx_seminars_categories', array('title' => 'one category')); $eventUid = $this->testingFramework->createRecord('tx_seminars_seminars', array('pid' => $this->systemFolderPid, 'title' => 'my title', 'begin_date' => $GLOBALS['SIM_EXEC_TIME'] + 1000, 'categories' => 1)); $this->testingFramework->createRelation('tx_seminars_seminars_categories_mm', $eventUid, $categoryUid); self::assertContains('tx_seminars_pi1[category]=' . $categoryUid, $this->fixture->render()); }
/** * @test */ public function getPaymentMethodsForEventTopicWithOnePaymentMethodReturnsOnePaymentMethod() { $paymentMethod = tx_oelib_MapperRegistry::get('tx_seminars_Mapper_PaymentMethod')->getNewGhost(); $uid = $this->testingFramework->createRecord('tx_seminars_seminars', array('object_type' => tx_seminars_Model_Event::TYPE_TOPIC, 'payment_methods' => 1)); $this->testingFramework->createRelation('tx_seminars_seminars_payment_methods_mm', $uid, $paymentMethod->getUid()); /** @var tx_seminars_Model_Event $model */ $model = $this->fixture->find($uid); self::assertEquals($paymentMethod->getUid(), $model->getPaymentMethods()->getUids()); }
/** * @test */ public function getEventDataForEventWithMultipleLodgingsDoesNotSeparateLodgingsWithCarriageReturnsAndLineFeeds() { $lodgingUid1 = $this->testingFramework->createRecord('tx_seminars_lodgings', array('title' => 'foo')); $this->testingFramework->createRelation('tx_seminars_seminars_lodgings_mm', $this->fixture->getUid(), $lodgingUid1); $lodgingUid2 = $this->testingFramework->createRecord('tx_seminars_lodgings', array('title' => 'bar')); $this->testingFramework->createRelation('tx_seminars_seminars_lodgings_mm', $this->fixture->getUid(), $lodgingUid2); $this->fixture->setNumberOfLodgings(2); self::assertNotContains('foo' . CRLF . 'bar', $this->fixture->getEventData('lodgings')); }
/** * @test */ public function getOrganizersWithOneOrganizerReturnsOneOrganizer() { $uid = $this->testingFramework->createRecord('tx_seminars_seminars', array('organizers' => 1)); $organizer = tx_oelib_MapperRegistry::get('tx_seminars_Mapper_Organizer')->getNewGhost(); $this->testingFramework->createRelation('tx_seminars_seminars_organizers_mm', $uid, $organizer->getUid()); /** @var tx_seminars_Model_Event $model */ $model = $this->fixture->find($uid); self::assertEquals($organizer->getUid(), $model->getOrganizers()->getUids()); }
/** * @test */ public function sendAdditionalNotificationUsesTheFirstOrganizerAsSenderIfEmailIsSentToTwoOrganizers() { $organizerUid = $this->testingFramework->createRecord('tx_seminars_organizers', array('title' => 'test organizer 2', 'email' => '*****@*****.**')); $this->testingFramework->createRelation('tx_seminars_seminars_organizers_mm', $this->seminarUid, $organizerUid); $this->testingFramework->changeRecord('tx_seminars_seminars', $this->seminarUid, array('organizers' => 2)); $registration = $this->createRegistration(); $this->fixture->sendAdditionalNotification($registration); $sentEmails = $this->mailer->getSentEmails(); self::assertArrayHasKey('*****@*****.**', $sentEmails[0]->getFrom()); self::assertArrayHasKey('*****@*****.**', $sentEmails[1]->getFrom()); }
public function testLimitToEventsResultsInAnEmptyBagIfThereAreNoMatches() { $this->testingFramework->createRecord('tx_seminars_categories'); $eventUid1 = $this->testingFramework->createRecord('tx_seminars_seminars'); $categoryUid = $this->testingFramework->createRecord('tx_seminars_categories'); $this->testingFramework->createRelation('tx_seminars_seminars_categories_mm', $eventUid1, $categoryUid); $eventUid2 = $this->testingFramework->createRecord('tx_seminars_seminars'); $this->fixture->limitToEvents($eventUid2); $bag = $this->fixture->build(); self::assertTrue($bag->isEmpty()); }
/** * @test */ public function limitToEventSortsByRelationSorting() { $eventUid = $this->testingFramework->createRecord('tx_seminars_seminars', array('organizers' => 2)); $organizerUid1 = $this->testingFramework->createRecord('tx_seminars_organizers'); $organizerUid2 = $this->testingFramework->createRecord('tx_seminars_organizers'); $this->testingFramework->createRelation('tx_seminars_seminars_organizers_mm', $eventUid, $organizerUid2); $this->testingFramework->createRelation('tx_seminars_seminars_organizers_mm', $eventUid, $organizerUid1); $this->fixture->limitToEvent($eventUid); $bag = $this->fixture->build(); $bag->rewind(); self::assertEquals($organizerUid2, $bag->current()->getUid()); }
public function testListViewLimitedToPlacesFromSelectorWidgetIgnoresFlexFormsValues() { // TODO: This needs to be changed when bug 2304 gets fixed. // @see https://bugs.oliverklee.com/show_bug.cgi?id=2304 $eventUid1 = $this->testingFramework->createRecord('tx_seminars_seminars', array('pid' => $this->systemFolderPid, 'title' => 'Event with place', 'place' => 1)); $placeUid1 = $this->testingFramework->createRecord('tx_seminars_sites', array('title' => 'a place')); $this->testingFramework->createRelation('tx_seminars_seminars_place_mm', $eventUid1, $placeUid1); $eventUid2 = $this->testingFramework->createRecord('tx_seminars_seminars', array('pid' => $this->systemFolderPid, 'title' => 'Event with another place', 'place' => 1)); $placeUid2 = $this->testingFramework->createRecord('tx_seminars_sites', array('title' => 'a place')); $this->testingFramework->createRelation('tx_seminars_seminars_place_mm', $eventUid2, $placeUid2); $this->fixture->setConfigurationValue('limitListViewToPlaces', $placeUid1); $this->fixture->piVars['place'] = array($placeUid2); $result = $this->fixture->main('', array()); self::assertNotContains('Event with place', $result); self::assertContains('Event with another place', $result); }