protected function setUp() { $GLOBALS['LANG']->includeLLFile(t3lib_extMgm::extPath('seminars') . 'locallang_db.xml'); $GLOBALS['LANG']->includeLLFile(t3lib_extMgm::extPath('lang') . 'locallang_general.xml'); $this->testingFramework = new Tx_Oelib_TestingFramework('tx_seminars'); $configurationRegistry = Tx_Oelib_ConfigurationRegistry::getInstance(); $configurationRegistry->set('plugin', new Tx_Oelib_Configuration()); $this->configuration = new Tx_Oelib_Configuration(); $this->configuration->setData(array('charsetForCsv' => 'utf-8')); $configurationRegistry->set('plugin.tx_seminars', $this->configuration); $this->pageUid = $this->testingFramework->createSystemFolder(); $this->eventUid = $this->testingFramework->createRecord('tx_seminars_seminars', array('pid' => $this->pageUid, 'begin_date' => $GLOBALS['SIM_EXEC_TIME'])); $this->subject = new Tx_Seminars_Csv_EmailRegistrationListView(); $this->subject->setEventUid($this->eventUid); }
/** * @test */ public function createRecursivePageListHeedsDecreasingRecursionDepthOnSubsequentCalls() { $uid = $this->testingFramework->createSystemFolder(); $subFolderUid = $this->testingFramework->createSystemFolder($uid); self::assertSame($this->sortExplode($uid . ',' . $subFolderUid), $this->sortExplode(Tx_Oelib_Db::createRecursivePageList($uid, 1))); self::assertSame((string) $uid, Tx_Oelib_Db::createRecursivePageList($uid, 0)); }
/** * @test */ public function createAndOuptutListOfRegistrationsForNoEventUidGivenReturnsRegistrationsOnSubpageOfCurrentPage() { $this->fixture->piVars['pid'] = $this->pid; $subpagePid = $this->testingFramework->createSystemFolder($this->pid); $this->configuration->setAsString('fieldsFromAttendanceForCsv', 'address'); $this->testingFramework->createRecord('tx_seminars_attendances', array('seminar' => $this->eventUid, 'user' => $this->testingFramework->createFrontEndUser(), 'address' => 'foo', 'pid' => $subpagePid)); self::assertContains('foo', $this->fixture->createAndOutputListOfRegistrations()); }
/** * @test */ public function contentElementCanBeCreatedOnNonRootPage() { $parent = $this->subject->createSystemFolder(); $uid = $this->subject->createContentElement($parent); self::assertNotSame(0, $uid); $row = Tx_Oelib_Db::selectSingle('pid', 'tt_content', 'uid = ' . $uid); self::assertSame($parent, (int) $row['pid']); }
/** * @test */ public function renderCanContainEventFromSubFolder() { $pageUid = $this->testingFramework->createSystemFolder(); $this->subject->setPageUid($pageUid); $subFolderPid = $this->testingFramework->createSystemFolder($pageUid); $this->testingFramework->createRecord('tx_seminars_seminars', array('pid' => $subFolderPid, 'title' => 'another event')); $this->configuration->setAsString('fieldsFromEventsForCsv', 'title'); self::assertContains('another event', $this->subject->render($this->pageUid)); }
/** * @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 showContainsEventFromSubfolder() { $subfolderPid = $this->testingFramework->createSystemFolder($this->dummySysFolderPid); $this->testingFramework->createRecord('tx_seminars_seminars', array('title' => 'Event in subfolder', 'pid' => $subfolderPid)); self::assertContains('Event in subfolder', $this->fixture->show()); }