/**
  * @test
  */
 public function renderLinksOneRequirementToTheSingleView()
 {
     $this->fixture->setConfigurationValue('detailPID', $this->testingFramework->createFrontEndPage());
     $this->testingFramework->changeRecord('tx_seminars_seminars', $this->seminarUid, array('object_type' => tx_seminars_Model_Event::TYPE_TOPIC));
     $requiredEvent = $this->testingFramework->createRecord('tx_seminars_seminars', array('object_type' => tx_seminars_Model_Event::TYPE_TOPIC, 'title' => 'required_foo'));
     $this->testingFramework->createRelationAndUpdateCounter('tx_seminars_seminars', $this->seminarUid, $requiredEvent, 'requirements');
     $this->fixture->setEvent(new tx_seminars_seminar($this->seminarUid));
     self::assertRegExp('/<a href=.*' . $requiredEvent . '.*>required_foo<\\/a>/', $this->fixture->render());
 }
示例#2
0
 /**
  * @test
  */
 public function getEntriesFromGeneralStoragePageForUseStoragePidSetAndNoStoragePidSetFindsRecordWithAnyPid()
 {
     tx_oelib_configurationProxy::getInstance('seminars')->setAsBoolean('useStoragePid', TRUE);
     $recordUid = $this->testingFramework->createRecord($this->testingTable, array('title' => 'foo record', 'pid' => 42));
     $configuration = $this->fixture->getEntriesFromGeneralStoragePage(array('config' => array('itemTable' => $this->testingTable), 'row' => array('pid' => $this->testingFramework->createFrontEndPage()), 'items' => array()));
     self::assertTrue(in_array(array(0 => 'foo record', 1 => $recordUid, 2 => 'fooicon'), $configuration['items']));
 }
示例#3
0
 /**
  * @test
  */
 public function getDetailsPageForInternalSeparateDetailsPageSetReturnsThisPage()
 {
     $detailsPageUid = $this->testingFramework->createFrontEndPage();
     $eventUid = $this->testingFramework->createRecord('tx_seminars_seminars', array('title' => 'a test event', 'details_page' => $detailsPageUid));
     $event = new tx_seminars_seminarchild($eventUid);
     self::assertSame((string) $detailsPageUid, $event->getDetailsPage());
 }
 /**
  * @test
  */
 public function createAbsoluteUrlForEventWithInternalDetailsPageAddsSeminarParameter()
 {
     $pageUid = $this->testingFramework->createFrontEndPage();
     $event = tx_oelib_MapperRegistry::get('tx_seminars_Mapper_Event')->getLoadedTestingModel(array('details_page' => $pageUid));
     $fixture = new tx_seminars_tests_fixtures_Service_TestingSingleViewLinkBuilder();
     self::assertContains('?id=' . $pageUid . '&tx_seminars_pi1%5BshowUid%5D=' . $event->getUid(), $fixture->createAbsoluteUrlForEvent($event));
 }
示例#5
0
 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
  *
  * @see https://bugs.oliverklee.com/show_bug.cgi?id=4504
  */
 public function testGetLinkToRegistrationOrLoginPageWithLoggedInUserAndSeparateDetailsPageCreatesLinkToRegistrationPage()
 {
     $this->createFrontEndPages();
     $detailsPageUid = $this->testingFramework->createFrontEndPage();
     $this->seminar->setDetailsPage($detailsPageUid);
     $this->createAndLogInFrontEndUser();
     self::assertContains('?id=' . $this->registrationPageUid, $this->fixture->getLinkToRegistrationOrLoginPage($this->pi1, $this->seminar));
 }
示例#7
0
 protected function setUp()
 {
     $this->testingFramework = new tx_oelib_testingFramework('tx_seminars');
     $frontEndPageUid = $this->testingFramework->createFrontEndPage();
     $this->testingFramework->createFakeFrontEnd($frontEndPageUid);
     $this->session = new tx_oelib_FakeSession();
     tx_oelib_Session::setInstance(tx_oelib_Session::TYPE_USER, $this->session);
     $configurationRegistry = tx_oelib_ConfigurationRegistry::getInstance();
     $configuration = new tx_oelib_Configuration();
     $configuration->setAsString('currency', 'EUR');
     $configurationRegistry->set('plugin.tx_seminars', $configuration);
     $configurationRegistry->set('plugin.tx_staticinfotables_pi1', new tx_oelib_Configuration());
     $this->seminar = new tx_seminars_seminar($this->testingFramework->createRecord('tx_seminars_seminars', array('payment_methods' => '1')));
     $this->seminarUid = $this->seminar->getUid();
     $this->fixture = new tx_seminars_FrontEnd_RegistrationForm(array('pageToShowAfterUnregistrationPID' => $frontEndPageUid, 'sendParametersToThankYouAfterRegistrationPageUrl' => 1, 'thankYouAfterRegistrationPID' => $frontEndPageUid, 'sendParametersToPageToShowAfterUnregistrationUrl' => 1, 'templateFile' => 'EXT:seminars/Resources/Private/Templates/FrontEnd/FrontEnd.html', 'logOutOneTimeAccountsAfterRegistration' => 1, 'showRegistrationFields' => 'registered_themselves,attendees_names', 'showFeUserFieldsInRegistrationForm' => 'name,email', 'showFeUserFieldsInRegistrationFormWithLabel' => 'email', 'form.' => array('unregistration.' => array(), 'registration.' => array('step1.' => array(), 'step2.' => array()))), $GLOBALS['TSFE']->cObj);
     $this->fixture->setAction('register');
     $this->fixture->setSeminar($this->seminar);
     $this->fixture->setTestMode();
 }
示例#8
0
 /**
  * @test
  */
 public function listOfRequirementsForEventWithOneNotFulfilledRequirementLinksHtmlspecialcharedTitleOfRequirement()
 {
     $this->testingFramework->createAndLoginFrontEndUser();
     $this->fixture->setConfigurationValue('what_to_display', 'seminar_registration');
     $this->fixture->setConfigurationValue('detailPID', $this->testingFramework->createFrontEndPage());
     $topic = $this->testingFramework->createRecord('tx_seminars_seminars', array('object_type' => tx_seminars_Model_Event::TYPE_TOPIC));
     $date = $this->testingFramework->createRecord('tx_seminars_seminars', array('object_type' => tx_seminars_Model_Event::TYPE_DATE, 'begin_date' => $GLOBALS['SIM_EXEC_TIME'] + 1000, 'end_date' => $GLOBALS['SIM_EXEC_TIME'] + 2000, 'attendees_max' => 10, 'topic' => $topic, 'needs_registration' => 1));
     $requiredTopic = $this->testingFramework->createRecord('tx_seminars_seminars', array('object_type' => tx_seminars_Model_Event::TYPE_TOPIC, 'title' => 'required & foo'));
     $this->testingFramework->createRelationAndUpdateCounter('tx_seminars_seminars', $topic, $requiredTopic, 'requirements');
     $this->fixture->piVars['seminar'] = $date;
     self::assertRegExp('/<a href=.*' . $requiredTopic . '.*>required &amp; foo<\\/a>/', $this->fixture->main('', array()));
 }