Пример #1
0
 /**
  * @test
  */
 public function getCombinedSingleViewPageUsesEventTypeInsteadOfCategoriesIfBothAreAvailable()
 {
     $eventType = new tx_seminars_Model_EventType();
     $eventType->setData(array('single_view_page' => 42));
     $category = new tx_seminars_Model_Category();
     $category->setData(array('single_view_page' => 91));
     $categories = new tx_oelib_List();
     $categories->add($category);
     $this->fixture->setData(array('event_type' => $eventType, 'categories' => $categories));
     self::assertEquals('42', $this->fixture->getCombinedSingleViewPage());
 }
Пример #2
0
 /**
  * Gets the single view page UID/URL from $event (if any single view page is set for
  * the event) or from the configuration.
  *
  * @param tx_seminars_Model_Event $event the event for which to get the single view page
  *
  * @return string
  *         the single view page UID/URL for $event, will be empty if neither
  *         the event nor the configuration has any single view page set
  */
 protected function getSingleViewPageForEvent(tx_seminars_Model_Event $event)
 {
     if ($event->hasCombinedSingleViewPage()) {
         $result = $event->getCombinedSingleViewPage();
     } elseif ($this->configurationHasSingleViewPage()) {
         $result = (string) $this->getSingleViewPageFromConfiguration();
     } else {
         $result = '';
     }
     return $result;
 }