/** * @test */ public function renderCallsRenderMethodOfCountdownViewHelperWithNextUpcomingEventsBeginDateAsUnixTimeStamp() { $this->fixture->injectEventMapper($this->mapper); $event = $this->mapper->getLoadedTestingModel(array('object_type' => tx_seminars_Model_Event::TYPE_COMPLETE, 'pid' => 0, 'title' => 'Test event', 'begin_date' => $GLOBALS['SIM_ACCESS_TIME'] + 1000)); $this->mapper->expects(self::once())->method('findNextUpcoming')->will(self::returnValue($event)); $this->viewHelper = $this->getMock('tx_seminars_ViewHelper_Countdown', array('render')); $this->viewHelper->expects(self::once())->method('render')->with(self::equalTo($event->getBeginDateAsUnixTimeStamp())); $this->fixture->injectCountDownViewHelper($this->viewHelper); $this->fixture->render(); }
protected function setUp() { $pluginConfiguration = new Tx_Oelib_Configuration(); $pluginConfiguration->setAsString('dateFormatYMD', '%d.%m.%Y'); $configurationRegistry = Tx_Oelib_ConfigurationRegistry::getInstance(); $configurationRegistry->set('plugin.tx_seminars', $pluginConfiguration); $configurationRegistry->set('config', new Tx_Oelib_Configuration()); $configurationRegistry->set('page.config', new Tx_Oelib_Configuration()); $configurationRegistry->set('plugin.tx_seminars._LOCAL_LANG.default', new Tx_Oelib_Configuration()); tx_oelib_configurationProxy::getInstance('seminars')->setAsBoolean('enableConfigCheck', FALSE); $this->testingFramework = new tx_oelib_testingFramework('tx_seminars'); $this->testingFramework->createFakeFrontEnd(); // just picked some random date (2001-01-01 00:00:00) $this->eventDate = 978303600; $this->mapper = new tx_seminars_Mapper_Event(); $event = $this->mapper->getLoadedTestingModel(array('pid' => 0, 'title' => 'Test event', 'begin_date' => $this->eventDate)); $this->eventId = $event->getUid(); $this->fixture = new tx_seminars_FrontEnd_EventHeadline(array('isStaticTemplateLoaded' => 1, 'templateFile' => 'EXT:seminars/Resources/Private/Templates/FrontEnd/FrontEnd.html'), $GLOBALS['TSFE']->cObj); $this->fixture->injectEventMapper($this->mapper); }
/** * @test */ public function getDependenciesForEventTopicReturnsListInstance() { self::assertTrue($this->fixture->getLoadedTestingModel(array('object_type' => tx_seminars_Model_Event::TYPE_TOPIC))->getDependencies() instanceof tx_oelib_List); }
/** * @test */ public function getDependenciesForEventDateReturnsListInstance() { $topicUid = $this->testingFramework->createRecord('tx_seminars_seminars', array('object_type' => tx_seminars_Model_Event::TYPE_TOPIC)); self::assertTrue($this->fixture->getLoadedTestingModel(array('object_type' => tx_seminars_Model_Event::TYPE_DATE, 'topic' => $topicUid))->getDependencies() instanceof tx_oelib_List); }
/** * @test */ public function getDependenciesForSingleEventReturnsEmptyList() { self::assertTrue($this->fixture->getLoadedTestingModel(array('object_type' => tx_seminars_Model_Event::TYPE_COMPLETE))->getDependencies()->isEmpty()); }
/** * @test */ public function getEventManagersReturnsListInstance() { self::assertTrue($this->fixture->getLoadedTestingModel(array())->getEventManagers() instanceof tx_oelib_List); }