示例#1
0
 /**
  * @test
  */
 public function removeExludePagesFromObjectStorageHoldingExcludePages()
 {
     $page = new \DERHANSEN\SfBanners\Domain\Model\Page();
     $pageObjectStorageMock = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage', array('detach'), array(), '', false);
     $pageObjectStorageMock->expects($this->once())->method('detach')->with($this->equalTo($page));
     $this->inject($this->fixture, 'excludepages', $pageObjectStorageMock);
     $this->fixture->removeExcludepages($page);
 }
示例#2
0
 /**
  * Returns the requested flash variable depending on the setting in the banner.
  * If no value is set in the banner object, the default value from TS setting
  * is returned
  *
  * @param \DERHANSEN\SfBanners\Domain\Model\Banner $banner The banner
  * @param string $flashSetting Flash settings
  * @return string
  */
 public function render($banner = null, $flashSetting = '')
 {
     $settings = $this->templateVariableContainer->get('settings');
     $retVal = '';
     switch ($flashSetting) {
         case 'wmode':
             if ($banner->getFlashWmode() != '') {
                 $retVal = $banner->getFlashWmode();
             } else {
                 $retVal = $settings['defaultFlashVars']['wmode'];
             }
             break;
         case 'allowScriptAccess':
             if ($banner->getFlashAllowScriptAccess() != '') {
                 $retVal = $banner->getFlashAllowScriptAccess();
             } else {
                 $retVal = $settings['defaultFlashVars']['allowScriptAccess'];
             }
             break;
         default:
     }
     return $retVal;
 }
 /**
  * Test if allowscriptaccess is returned if set in banner
  *
  * @test
  * @return void
  */
 public function viewHelperReturnsValueForAllowScriptAccessFromBanner()
 {
     $viewHelper = new ParamsViewHelper();
     $settings = array();
     $settings['settings']['defaultFlashVars']['allowScriptAccess'] = 'sameDomain';
     $templateVariableContainer = new TemplateVariableContainer($settings);
     if (method_exists($viewHelper, 'setTemplateVariableContainer')) {
         $viewHelper->setTemplateVariableContainer($templateVariableContainer);
     } else {
         $renderingContext = new RenderingContext();
         $renderingContext->injectTemplateVariableContainer($templateVariableContainer);
         $viewHelper->setRenderingContext($renderingContext);
     }
     $banner = new Banner();
     $banner->setFlashAllowScriptAccess('someValue');
     $actualResult = $viewHelper->render($banner, 'allowScriptAccess');
     $this->assertEquals('someValue', $actualResult);
 }
示例#4
0
 /**
  * Click Action for a banner
  *
  * @param \DERHANSEN\SfBanners\Domain\Model\Banner $banner
  * @return void
  */
 public function clickAction(\DERHANSEN\SfBanners\Domain\Model\Banner $banner)
 {
     $banner->increaseClicks();
     $this->bannerRepository->update($banner);
     $this->redirectToURI($banner->getLinkUrl());
 }
示例#5
0
 /**
  * Test if recursive flag can be set
  *
  * @test
  * @return void
  */
 public function recursiveCanBeSet()
 {
     $this->fixture->setRecursive(TRUE);
     $this->assertTrue($this->fixture->getRecursive());
 }