コード例 #1
0
ファイル: Typo3.php プロジェクト: nos3/ai-typo3
 /**
  * Initializes the URL view helper.
  *
  * @param MW_View_Interface $view View instance with registered view helpers
  * @param TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder $uriBuilder TYPO3 URI builder
  * @param array $fixed Fixed parameters that should be added to each URL
  */
 public function __construct(MW_View_Interface $view, \TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder $uriBuilder, array $fixed)
 {
     parent::__construct($view);
     $this->_prefix = $uriBuilder->getArgumentPrefix();
     $this->_uriBuilder = $uriBuilder;
     $this->_fixed = $fixed;
 }
コード例 #2
0
ファイル: Typo3.php プロジェクト: aimeos/ai-typo3
 /**
  * Initializes the URL view helper.
  *
  * @param \Aimeos\MW\View\Iface $view View instance with registered view helpers
  * @param \TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder $uriBuilder TYPO3 URI builder
  * @param array $fixed Fixed parameters that should be added to each URL
  */
 public function __construct(\Aimeos\MW\View\Iface $view, \TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder $uriBuilder, array $fixed)
 {
     parent::__construct($view);
     $this->prefix = $uriBuilder->getArgumentPrefix();
     $this->uriBuilder = $uriBuilder;
     $this->fixed = $fixed;
 }
コード例 #3
0
 /**
  * Get redirect URI from FlexForm or TypoScript
  *
  * @return string|null
  */
 public function getRedirectUri()
 {
     $uri = null;
     $target = $this->getTarget();
     if ($target !== null) {
         $this->uriBuilder->setTargetPageUid($target);
         $uri = $this->uriBuilder->build();
     }
     return $uri;
 }
コード例 #4
0
ファイル: LinkViewHelper.php プロジェクト: advOpk/pwm
 /**
  * Parse a content element
  *
  * @param string $path like uploads/tx_powermail/
  * @param bool $absolute
  * @return string
  */
 public function render($path, $absolute = FALSE)
 {
     $uri = '';
     if ($absolute) {
         $uri .= parse_url(GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'), PHP_URL_SCHEME);
         $uri .= '://' . GeneralUtility::getIndpEnv('HTTP_HOST') . '/';
         $uri .= rtrim(GeneralUtility::getIndpEnv('TYPO3_SITE_PATH'), '/');
     }
     $uri .= $this->uriBuilder->setTargetPageUid($path)->buildFrontendUri();
     return $uri;
 }
コード例 #5
0
ファイル: View.php プロジェクト: aimeos/aimeos-typo3
 /**
  * Creates the view object for the HTML client.
  *
  * @param \Aimeos\MW\Config\Iface $config Config object
  * @param \TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder $uriBuilder URL builder object
  * @param array $templatePaths List of base path names with relative template paths as key/value pairs
  * @param \TYPO3\CMS\Extbase\Mvc\RequestInterface|null $request Request object
  * @param string|null $locale Code of the current language or null for no translation
  * @param boolean $frontend True if the view is for the frontend, false for the backend
  * @return \Aimeos\MW\View\Iface View object
  */
 public static function get(\Aimeos\MW\Config\Iface $config, \TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder $uriBuilder, array $templatePaths, \TYPO3\CMS\Extbase\Mvc\RequestInterface $request = null, $locale = null)
 {
     $view = new \Aimeos\MW\View\Standard($templatePaths);
     self::addTranslate($view, $locale, $config->get('i18n', array()));
     self::addParam($view, $request);
     self::addConfig($view, $config);
     self::addNumber($view, $config);
     self::addFormparam($view, array($uriBuilder->getArgumentPrefix()));
     self::addUrl($view, $config, $uriBuilder, $request);
     self::addRequest($view, $request);
     self::addResponse($view);
     self::addAccess($view);
     return $view;
 }
コード例 #6
0
 /**
  * Executes this finisher
  * @see AbstractFinisher::execute()
  *
  * @return void
  */
 protected function executeInternal()
 {
     $formRuntime = $this->finisherContext->getFormRuntime();
     $this->request = $formRuntime->getRequest();
     $this->response = $formRuntime->getResponse();
     $this->uriBuilder = $this->objectManager->get(UriBuilder::class);
     $this->uriBuilder->setRequest($this->request);
     $pageUid = (int) str_replace('pages_', '', $this->parseOption('pageUid'));
     $additionalParameters = $this->parseOption('additionalParameters');
     $additionalParameters = '&' . ltrim($additionalParameters, '&');
     $delay = (int) $this->parseOption('delay');
     $statusCode = (int) $this->parseOption('statusCode');
     $this->finisherContext->cancel();
     $this->redirect($pageUid, $additionalParameters, $delay, $statusCode);
 }
コード例 #7
0
 /**
  * @test
  */
 public function frontendUriBuilderParametersArePassedOnIfConfigured()
 {
     $this->typoScriptFrontendController->tmpl->setup['plugin.']['tx_linkhandler.']['tx_news_news.']['overrideParentTypolinkConfiguration'] = 1;
     $this->typoScriptFrontendController->tmpl->setup['plugin.']['tx_linkhandler.']['tx_news_news.']['typolink.']['useCacheHash'] = 0;
     $this->uriBuilder->reset()->setTargetPageUid('record:tx_news_news:tx_news_domain_model_news:1')->setNoCache(TRUE);
     $generatedUrl = $this->uriBuilder->buildFrontendUri();
     $this->assertEquals('index.php?id=1&no_cache=1&tx_news_pi1%5Bnews%5D=1&tx_news_pi1%5Bcontroller%5D=News&tx_news_pi1%5Baction%5D=detail', $generatedUrl);
 }
コード例 #8
0
 /**
  * @test
  */
 public function removeDefaultControllerAndActionRemovesControllerAndActionIfBothAreEqualToTheDefault()
 {
     $this->mockExtensionService->expects($this->atLeastOnce())->method('getDefaultControllerNameByPlugin')->with('ExtensionName', 'PluginName')->will($this->returnValue('DefaultController'));
     $this->mockExtensionService->expects($this->atLeastOnce())->method('getDefaultActionNameByPluginAndController')->with('ExtensionName', 'PluginName', 'DefaultController')->will($this->returnValue('defaultAction'));
     $arguments = array('controller' => 'DefaultController', 'action' => 'defaultAction', 'foo' => 'bar');
     $extensionName = 'ExtensionName';
     $pluginName = 'PluginName';
     $expectedResult = array('foo' => 'bar');
     $actualResult = $this->uriBuilder->_callRef('removeDefaultControllerAndAction', $arguments, $extensionName, $pluginName);
     $this->assertEquals($expectedResult, $actualResult);
 }
コード例 #9
0
ファイル: UriBuilder.php プロジェクト: dextar1/t3extblog
 /**
  * Life-cycle method that is called by the DI container as soon as this object is completely built
  *
  * @return void
  */
 public function initializeObject()
 {
     parent::initializeObject();
     // @todo Remove this when TYPO3 6.2 is no longer relevant
     // Replace it by a simple inject annotation like above
     if (version_compare(TYPO3_branch, '7.0', '>')) {
         // This makes sure the settings are found correctly\
         // Seems there is no good reason but this would break TYPO3 6.2
         /* @var $objectManager \TYPO3\CMS\Extbase\Object\ObjectManagerInterface */
         $objectManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
         $this->configurationManager = $objectManager->get('TYPO3\\T3extblog\\Configuration\\ConfigurationManager');
     }
 }
コード例 #10
0
ファイル: Tools.php プロジェクト: Easter1021/newsletter
 /**
  * Returns a frontend URI independently of current context, with or without extbase, and with or without TSFE
  * @param string $actionName
  * @param array $controllerArguments
  * @param string $controllerName
  * @param string $extensionName
  * @param string $pluginName
  * @return string absolute URI
  */
 public static function buildFrontendUri($actionName, array $controllerArguments, $controllerName, $extensionName = 'newsletter', $pluginName = 'p')
 {
     if (!self::$uriBuilder) {
         self::$uriBuilder = self::buildUriBuilder($extensionName, $pluginName);
     }
     $controllerArguments['action'] = $actionName;
     $controllerArguments['controller'] = $controllerName;
     $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
     $extensionService = $objectManager->get('TYPO3\\CMS\\Extbase\\Service\\ExtensionService');
     $pluginNamespace = $extensionService->getPluginNamespace($extensionName, $pluginName);
     $arguments = array($pluginNamespace => $controllerArguments);
     self::$uriBuilder->reset()->setUseCacheHash(false)->setCreateAbsoluteUri(true)->setArguments($arguments);
     return self::$uriBuilder->buildFrontendUri() . '&type=1342671779';
 }
コード例 #11
0
 /**
  * Create doc header drop down
  *
  * @return void
  */
 protected function createMenu()
 {
     $this->uriBuilder->setRequest($this->request);
     $menu = $this->view->getModuleTemplate()->getDocHeaderComponent()->getMenuRegistry()->makeMenu();
     $menu->setIdentifier('cadabra');
     $actions = [['action' => 'index', 'label' => 'listProducts'], ['action' => 'listArticles', 'label' => 'listArticles']];
     foreach ($actions as $action) {
         $item = $menu->makeMenuItem()->setTitle($this->getLanguageService()->sL($this->settings['LLL']['productadministration'] . ':module.' . $action['label']))->setHref($this->uriBuilder->reset()->uriFor($action['action'], [], 'Backend\\Product'))->setActive($this->request->getControllerActionName() === $action['action']);
         $menu->addMenuItem($item);
     }
     $this->view->getModuleTemplate()->getDocHeaderComponent()->getMenuRegistry()->addMenu($menu);
     $pageInfo = \TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess($this->pageUid, '');
     $this->view->getModuleTemplate()->getDocHeaderComponent()->setMetaInformation($pageInfo);
 }
コード例 #12
0
 /**
  * Redirects the request to another action and / or controller.
  *
  * Redirect will be sent to the client which then performs another request to the new URI.
  *
  * NOTE: This method only supports web requests and will thrown an exception
  * if used with other request types.
  *
  * @param string $actionName Name of the action to forward to
  * @param string $controllerName Unqualified object name of the controller to forward to. If not specified, the current controller is used.
  * @param string $extensionName Name of the extension containing the controller to forward to. If not specified, the current extension is assumed.
  * @param array $arguments Arguments to pass to the target action
  * @param int $pageUid Target page uid. If NULL, the current page uid is used
  * @param int $delay (optional) The delay in seconds. Default is no delay.
  * @param int $statusCode (optional) The HTTP status code for the redirect. Default is "303 See Other
  * @return void
  * @throws UnsupportedRequestTypeException If the request is not a web request
  * @throws StopActionException
  * @see forward()
  * @api
  */
 protected function redirect($actionName, $controllerName = null, $extensionName = null, array $arguments = null, $pageUid = null, $delay = 0, $statusCode = 303)
 {
     if (!$this->request instanceof WebRequest) {
         throw new UnsupportedRequestTypeException('redirect() only supports web requests.', 1220539734);
     }
     if ($controllerName === null) {
         $controllerName = $this->request->getControllerName();
     }
     $this->uriBuilder->reset()->setTargetPageUid($pageUid)->setCreateAbsoluteUri(true);
     if (\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SSL')) {
         $this->uriBuilder->setAbsoluteUriScheme('https');
     }
     $uri = $this->uriBuilder->uriFor($actionName, $arguments, $controllerName, $extensionName);
     $this->redirectToUri($uri, $delay, $statusCode);
 }
コード例 #13
0
 /**
  * @param $pages
  * @return array
  */
 public function getEntriesFromPages($pages)
 {
     $urlEntries = [];
     foreach ($pages as $page) {
         if ($page['doktype'] == 1) {
             $urlEntry = new UrlEntry();
             $uri = $this->uriBuilder->reset()->setTargetPageUid($page['uid'])->setCreateAbsoluteUri(true)->build();
             $urlEntry->setLoc($uri);
             $urlEntry->setLastmod(date('Y-m-d', $page['tstamp']));
             if (isset($page['sitemap_priority'])) {
                 $urlEntry->setPriority(sprintf('%01.1f', $page['sitemap_priority'] / 10));
             }
             if (isset($page['sitemap_changefreq'])) {
                 $urlEntry->setChangefreq($page['sitemap_changefreq']);
             }
             $urlEntries[] = $urlEntry;
         }
     }
     return $urlEntries;
 }
コード例 #14
0
 /**
  * Page not found handling
  *
  * @param array $params
  * @param TypoScriptFrontendController $ref
  * @throws PageNotFoundException
  * @return void
  */
 public function pageNotFound(array $params, TypoScriptFrontendController $ref = NULL)
 {
     $domain = GeneralUtility::getIndpEnv('TYPO3_SITE_URL');
     $domainInformation = parse_url($domain);
     $errorPageUid = (int) $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['theme']['errorPages']['_DEFAULT'];
     if (!empty($domainInformation['host'])) {
         $tmpErrorPageUid = (int) $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['theme']['errorPages'][$domainInformation['host']];
         if ($tmpErrorPageUid > 0) {
             $errorPageUid = $tmpErrorPageUid;
         }
     }
     if ($errorPageUid > 0) {
         $sysLanguageUid = $this->getSysLanguage($ref);
         $this->uriBuilder->reset()->setTargetPageUid($errorPageUid)->setCreateAbsoluteUri(TRUE);
         if ($sysLanguageUid > 0) {
             $this->uriBuilder->setArguments(array('L' => $sysLanguageUid));
         }
         HttpUtility::redirect($this->uriBuilder->buildFrontendUri(), HttpUtility::HTTP_STATUS_404);
     }
     $message = 'The page not found handling could not handle the request. The original message was: "' . $params['reasonText'] . '" with URL "' . $params['currentUrl'] . '"';
     throw new PageNotFoundException($message, 1301648780);
 }
コード例 #15
0
ファイル: Base.php プロジェクト: nos3/aimeos-typo3
 /**
  * Creates the view object for the HTML client.
  *
  * @param \MW_Config_Interface $config Configuration object
  * @param \TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder $uriBuilder URL builder object
  * @param array $templatePaths List of base path names with relative template paths as key/value pairs
  * @param \TYPO3\CMS\Extbase\Mvc\RequestInterface|null $request Request object
  * @param string|null $locale Code of the current language or null for no translation
  * @return MW_View_Interface View object
  */
 public static function getView(\MW_Config_Interface $config, \TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder $uriBuilder, array $templatePaths, \TYPO3\CMS\Extbase\Mvc\RequestInterface $request = null, $locale = null)
 {
     $params = $fixed = array();
     if ($request !== null && $locale !== null) {
         $fixed = self::getFixedParams($config, $request);
         // required for reloading to the current page
         $params = $request->getArguments();
         $params['target'] = $GLOBALS["TSFE"]->id;
         $i18n = Base::getI18n(array($locale), $config->get('i18n', array()));
         $translation = $i18n[$locale];
     } else {
         $translation = new \MW_Translation_None('en');
     }
     $view = new \MW_View_Default();
     // workaround for TYPO3 6.2 bug (UriBuilder is incomplete)
     if ($request !== null || \TYPO3\CMS\Core\Utility\VersionNumberUtility::getNumericTypo3Version() >= '7.0.0') {
         $helper = new \MW_View_Helper_Url_Typo3($view, $uriBuilder, $fixed);
     } else {
         $helper = new \MW_View_Helper_Url_None($view);
     }
     $view->addHelper('url', $helper);
     $helper = new \MW_View_Helper_Translate_Default($view, $translation);
     $view->addHelper('translate', $helper);
     $helper = new \MW_View_Helper_Partial_Default($view, $config, $templatePaths);
     $view->addHelper('partial', $helper);
     $helper = new \MW_View_Helper_Parameter_Default($view, $params);
     $view->addHelper('param', $helper);
     $helper = new \MW_View_Helper_Config_Default($view, $config);
     $view->addHelper('config', $helper);
     $sepDec = $config->get('client/html/common/format/seperatorDecimal', '.');
     $sep1000 = $config->get('client/html/common/format/seperator1000', ' ');
     $helper = new \MW_View_Helper_Number_Default($view, $sepDec, $sep1000);
     $view->addHelper('number', $helper);
     $helper = new \MW_View_Helper_FormParam_Default($view, array($uriBuilder->getArgumentPrefix()));
     $view->addHelper('formparam', $helper);
     $helper = new \MW_View_Helper_Encoder_Default($view);
     $view->addHelper('encoder', $helper);
     $helper = new \MW_View_Helper_Csrf_Default($view);
     $view->addHelper('csrf', $helper);
     $body = @file_get_contents('php://input');
     $helper = new \MW_View_Helper_Request_Default($view, $body, $_SERVER['REMOTE_ADDR']);
     $view->addHelper('request', $helper);
     return $view;
 }
コード例 #16
0
ファイル: Base.php プロジェクト: Niko-r/aimeos-typo3
 /**
  * Creates the view object for the HTML client.
  *
  * @param \Aimeos\MW\Config\Iface $config Configuration object
  * @param \TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder $uriBuilder URL builder object
  * @param array $templatePaths List of base path names with relative template paths as key/value pairs
  * @param \TYPO3\CMS\Extbase\Mvc\RequestInterface|null $request Request object
  * @param string|null $locale Code of the current language or null for no translation
  * @return MW_View_Interface View object
  */
 public static function getView(\Aimeos\MW\Config\Iface $config, \TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder $uriBuilder, array $templatePaths, \TYPO3\CMS\Extbase\Mvc\RequestInterface $request = null, $locale = null)
 {
     $params = $fixed = array();
     if ($request !== null && $locale !== null) {
         $params = $request->getArguments();
         $fixed = self::getFixedParams($config, $request);
         $i18n = Base::getI18n(array($locale), $config->get('i18n', array()));
         $translation = $i18n[$locale];
     } else {
         $translation = new \Aimeos\MW\Translation\None('en');
     }
     $view = new \Aimeos\MW\View\Standard($templatePaths);
     // workaround for TYPO3 bug (UriBuilder is incomplete in CLI environment)
     if ($request !== null) {
         $helper = new \Aimeos\MW\View\Helper\Url\Typo3($view, $uriBuilder, $fixed);
     } else {
         $helper = new \Aimeos\MW\View\Helper\Url\None($view);
     }
     $view->addHelper('url', $helper);
     $helper = new \Aimeos\MW\View\Helper\Translate\Standard($view, $translation);
     $view->addHelper('translate', $helper);
     $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $params);
     $view->addHelper('param', $helper);
     $helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config);
     $view->addHelper('config', $helper);
     $sepDec = $config->get('client/html/common/format/seperatorDecimal', '.');
     $sep1000 = $config->get('client/html/common/format/seperator1000', ' ');
     $helper = new \Aimeos\MW\View\Helper\Number\Standard($view, $sepDec, $sep1000);
     $view->addHelper('number', $helper);
     $helper = new \Aimeos\MW\View\Helper\Formparam\Standard($view, array($uriBuilder->getArgumentPrefix()));
     $view->addHelper('formparam', $helper);
     $ip = $_SERVER['REMOTE_ADDR'];
     $target = $GLOBALS["TSFE"]->id;
     $body = @file_get_contents('php://input');
     $files = is_array($_FILES) ? $_FILES : array();
     $helper = new \Aimeos\MW\View\Helper\Request\Standard($view, $body, $ip, $target, $files);
     $view->addHelper('request', $helper);
     return $view;
 }
コード例 #17
0
 /**
  * @return void
  */
 protected function setUp()
 {
     $this->viewHelperVariableContainer = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer::class);
     $this->templateVariableContainer = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer::class);
     $this->uriBuilder = $this->getMock(\TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::class);
     $this->uriBuilder->expects($this->any())->method('reset')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setArguments')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setSection')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setFormat')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setCreateAbsoluteUri')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setAddQueryString')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setArgumentsToBeExcludedFromQueryString')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setLinkAccessRestrictedPages')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setTargetPageUid')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setTargetPageType')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setNoCache')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setUseCacheHash')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setAddQueryStringMethod')->will($this->returnValue($this->uriBuilder));
     $this->request = $this->getMock(\TYPO3\CMS\Extbase\Mvc\Web\Request::class);
     $this->controllerContext = $this->getMock(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext::class, array(), array(), '', false);
     $this->controllerContext->expects($this->any())->method('getUriBuilder')->will($this->returnValue($this->uriBuilder));
     $this->controllerContext->expects($this->any())->method('getRequest')->will($this->returnValue($this->request));
     $this->tagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class);
     $this->arguments = array();
     $this->renderingContext = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContext::class, array('dummy'));
     $this->renderingContext->injectTemplateVariableContainer($this->templateVariableContainer);
     $this->renderingContext->_set('viewHelperVariableContainer', $this->viewHelperVariableContainer);
     $this->renderingContext->setControllerContext($this->controllerContext);
     $this->mvcPropertyMapperConfigurationService = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService::class, array('dummy'));
 }
コード例 #18
0
 /**
  * @test
  */
 public function constructorInjectsRequestToUriBuilder()
 {
     $this->mockUriBuilder->expects($this->once())->method('setRequest')->with($this->mockRequest);
     new \TYPO3\CMS\Fluid\View\StandaloneView();
 }
コード例 #19
0
 /**
  * @return void
  */
 protected function setUp()
 {
     $this->viewHelperVariableContainer = $this->prophesize(ViewHelperVariableContainer::class);
     $this->templateVariableContainer = $this->createMock(CmsVariableProvider::class);
     $this->uriBuilder = $this->createMock(\TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::class);
     $this->uriBuilder->expects($this->any())->method('reset')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setArguments')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setSection')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setFormat')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setCreateAbsoluteUri')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setAddQueryString')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setArgumentsToBeExcludedFromQueryString')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setLinkAccessRestrictedPages')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setTargetPageUid')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setTargetPageType')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setNoCache')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setUseCacheHash')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setAddQueryStringMethod')->will($this->returnValue($this->uriBuilder));
     $this->request = $this->prophesize(\TYPO3\CMS\Extbase\Mvc\Web\Request::class);
     $this->controllerContext = $this->createMock(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext::class);
     $this->controllerContext->expects($this->any())->method('getUriBuilder')->will($this->returnValue($this->uriBuilder));
     $this->controllerContext->expects($this->any())->method('getRequest')->will($this->returnValue($this->request->reveal()));
     $this->arguments = [];
     $this->renderingContext = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Tests\Unit\Core\Rendering\RenderingContextFixture::class, ['getControllerContext']);
     $this->renderingContext->expects($this->any())->method('getControllerContext')->willReturn($this->controllerContext);
     $this->renderingContext->setVariableProvider($this->templateVariableContainer);
     $this->renderingContext->_set('viewHelperVariableContainer', $this->viewHelperVariableContainer->reveal());
     $this->renderingContext->setControllerContext($this->controllerContext);
     $this->mvcPropertyMapperConfigurationService = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService::class, ['dummy']);
 }
コード例 #20
0
 /**
  * @dataProvider convertIteratorToArrayConvertsIteratorsToArrayProvider
  * @test
  */
 public function convertIteratorToArrayConvertsIteratorsToArray($iterator)
 {
     $result = $this->uriBuilder->_call('convertIteratorToArray', $iterator);
     $this->assertTrue(is_array($result));
 }
コード例 #21
0
 /**
  * Gets the pageUrl
  *
  * @param integer $pageUid
  * @return string
  */
 protected function getPageUrl($pageUid)
 {
     return $this->uriBuilder->reset()->setTargetPageUid((int) $pageUid)->setCreateAbsoluteUri(true)->buildFrontendUri();
 }
コード例 #22
0
 /**
  * @return void
  */
 public function setUp()
 {
     $this->viewHelperVariableContainer = $this->getMock('TYPO3\\Fluid\\Core\\ViewHelper\\ViewHelperVariableContainer');
     $this->templateVariableContainer = $this->getMock('TYPO3\\Fluid\\Core\\ViewHelper\\TemplateVariableContainer');
     $this->uriBuilder = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder');
     $this->uriBuilder->expects($this->any())->method('reset')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setArguments')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setSection')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setFormat')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setCreateAbsoluteUri')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setAddQueryString')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setArgumentsToBeExcludedFromQueryString')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setLinkAccessRestrictedPages')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setTargetPageUid')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setTargetPageType')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setNoCache')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setUseCacheHash')->will($this->returnValue($this->uriBuilder));
     $this->request = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request');
     $this->controllerContext = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ControllerContext', array(), array(), '', FALSE);
     $this->controllerContext->expects($this->any())->method('getUriBuilder')->will($this->returnValue($this->uriBuilder));
     $this->controllerContext->expects($this->any())->method('getRequest')->will($this->returnValue($this->request));
     $this->tagBuilder = $this->getMock('TYPO3\\Fluid\\Core\\ViewHelper\\TagBuilder');
     $this->arguments = array();
     $this->renderingContext = new \TYPO3\Fluid\Core\Rendering\RenderingContext();
     $this->renderingContext->injectTemplateVariableContainer($this->templateVariableContainer);
     $this->renderingContext->injectViewHelperVariableContainer($this->viewHelperVariableContainer);
     $this->renderingContext->setControllerContext($this->controllerContext);
 }