Skip to content

Commit

Permalink
[TASK] Make PageViewHelperTest notice free
Browse files Browse the repository at this point in the history
Releases: master
Resolves: #84372
Change-Id: Ibe6212e13ccab98a662e603772ca816bcec9245a
Reviewed-on: https://review.typo3.org/56250
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
  • Loading branch information
janhelke authored and lolli42 committed Mar 16, 2018
1 parent 0bc60be commit 16e7203
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
22 changes: 11 additions & 11 deletions typo3/sysext/fluid/Classes/ViewHelpers/Link/PageViewHelper.php
Expand Up @@ -79,17 +79,17 @@ public function initializeArguments()
*/
public function render()
{
$pageUid = (int)$this->arguments['pageUid'] ?: null;
$pageType = (int)$this->arguments['pageType'];
$noCache = (bool)$this->arguments['noCache'];
$noCacheHash = (bool)$this->arguments['noCacheHash'];
$section = (string)$this->arguments['section'];
$linkAccessRestrictedPages = (bool)$this->arguments['linkAccessRestrictedPages'];
$additionalParams = (array)$this->arguments['additionalParams'];
$absolute = (bool)$this->arguments['absolute'];
$addQueryString = (bool)$this->arguments['addQueryString'];
$argumentsToBeExcludedFromQueryString = (array)$this->arguments['argumentsToBeExcludedFromQueryString'];
$addQueryStringMethod = $this->arguments['addQueryStringMethod'];
$pageUid = isset($this->arguments['pageUid']) ? (int)$this->arguments['pageUid'] : null;
$pageType = isset($this->arguments['pageType']) ? (int)$this->arguments['pageType'] : 0;
$noCache = isset($this->arguments['noCache']) ? (bool)$this->arguments['noCache'] : false;
$noCacheHash = isset($this->arguments['noCacheHash']) ? (bool)$this->arguments['noCacheHash'] : false;
$section = isset($this->arguments['section']) ? (string)$this->arguments['section'] : '';
$linkAccessRestrictedPages = isset($this->arguments['linkAccessRestrictedPages']) ? (bool)$this->arguments['linkAccessRestrictedPages'] : false;
$additionalParams = isset($this->arguments['additionalParams']) ? (array)$this->arguments['additionalParams'] : [];
$absolute = isset($this->arguments['absolute']) ? (bool)$this->arguments['absolute'] : false;
$addQueryString = isset($this->arguments['addQueryString']) ? (bool)$this->arguments['addQueryString'] : false;
$argumentsToBeExcludedFromQueryString = isset($this->arguments['argumentsToBeExcludedFromQueryString']) ? (array)$this->arguments['argumentsToBeExcludedFromQueryString'] : [];
$addQueryStringMethod = $this->arguments['addQueryStringMethod'] ?? null;
$uriBuilder = $this->renderingContext->getControllerContext()->getUriBuilder();
$uri = $uriBuilder->reset()
->setTargetPageUid($pageUid)
Expand Down
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Link;

/*
Expand All @@ -16,17 +17,13 @@

use TYPO3\CMS\Fluid\ViewHelpers\Link\PageViewHelper;
use TYPO3\TestingFramework\Fluid\Unit\ViewHelpers\ViewHelperBaseTestcase;
use TYPO3Fluid\Fluid\Core\ViewHelper\TagBuilder;

/**
* Test-case for Link\PageViewHelper
*/
class PageViewHelperTest extends ViewHelperBaseTestcase
{
/**
* Subject is not notice free, disable E_NOTICES
*/
protected static $suppressNotices = true;

/**
* @var PageViewHelper
*/
Expand All @@ -38,10 +35,10 @@ class PageViewHelperTest extends ViewHelperBaseTestcase
protected function setUp()
{
parent::setUp();
$this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Link\PageViewHelper::class, ['renderChildren']);
$this->viewHelper = $this->getAccessibleMock(PageViewHelper::class, ['renderChildren']);
$this->injectDependenciesIntoViewHelper($this->viewHelper);
$this->viewHelper->initializeArguments();
$this->tagBuilder = $this->createMock(\TYPO3Fluid\Fluid\Core\ViewHelper\TagBuilder::class);
$this->tagBuilder = $this->createMock(TagBuilder::class);
$this->viewHelper->_set('tag', $this->tagBuilder);
}

Expand Down

0 comments on commit 16e7203

Please sign in to comment.