$this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
$this->injectDocCommentParser($this->objectManager->get(\TYPO3\CMS\Extbase\Reflection\DocCommentParser::class));
$this->injectReflectionService($this->objectManager->get(\TYPO3\CMS\Extbase\Reflection\ReflectionService::class));
- return $this->generateDocbook('TYPO3\CMS\Fluid\ViewHelpers');
+ return $this->generateDocbook(\TYPO3\CMS\Fluid\ViewHelpers::class);
}
/**
protected function convertObjectAccessorNode(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode $node) {
return array(
'initialization' => '',
- 'execution' => sprintf('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ObjectAccessorNode::getPropertyPath($renderingContext->getTemplateVariableContainer(), \'%s\', $renderingContext)', $node->getObjectPath())
+ 'execution' => sprintf(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode::class . '::getPropertyPath($renderingContext->getTemplateVariableContainer(), \'%s\', $renderingContext)', $node->getObjectPath())
);
}
return array(
'initialization' => $initializationPhpCode . $convertedLeftSide['initialization'] . $convertedRightSide['initialization'],
- 'execution' => sprintf('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\BooleanNode::evaluateComparator(\'%s\', %s, %s)', $node->getComparator(), $convertedLeftSide['execution'], $convertedRightSide['execution'])
+ 'execution' => sprintf(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::class . '::evaluateComparator(\'%s\', %s, %s)', $node->getComparator(), $convertedLeftSide['execution'], $convertedRightSide['execution'])
);
} else {
// simple case, no comparator.
$converted = $this->convert($node->getSyntaxTreeNode());
return array(
'initialization' => $initializationPhpCode . $converted['initialization'],
- 'execution' => sprintf('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\BooleanNode::convertToBoolean(%s)', $converted['execution'])
+ 'execution' => sprintf(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::class . '::convertToBoolean(%s)', $converted['execution'])
);
}
}
$elseViewHelperEncountered = FALSE;
foreach ($this->childNodes as $childNode) {
if ($childNode instanceof \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode
- && $childNode->getViewHelperClassName() === 'TYPO3\\CMS\\Fluid\\ViewHelpers\\ThenViewHelper') {
+ && $childNode->getViewHelperClassName() === \TYPO3\CMS\Fluid\ViewHelpers\ThenViewHelper::class) {
$data = $childNode->evaluate($this->renderingContext);
return $data;
}
if ($childNode instanceof \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode
- && $childNode->getViewHelperClassName() === 'TYPO3\\CMS\\Fluid\\ViewHelpers\\ElseViewHelper') {
+ && $childNode->getViewHelperClassName() === \TYPO3\CMS\Fluid\ViewHelpers\ElseViewHelper::class) {
$elseViewHelperEncountered = TRUE;
}
}
}
foreach ($this->childNodes as $childNode) {
if ($childNode instanceof \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode
- && $childNode->getViewHelperClassName() === 'TYPO3\\CMS\\Fluid\\ViewHelpers\\ElseViewHelper') {
+ && $childNode->getViewHelperClassName() === \TYPO3\CMS\Fluid\ViewHelpers\ElseViewHelper::class) {
return $childNode->evaluate($this->renderingContext);
}
}
public function compile($argumentsVariableName, $renderChildrenClosureVariableName, &$initializationPhpCode, \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $syntaxTreeNode, \TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler) {
foreach ($syntaxTreeNode->getChildNodes() as $childNode) {
if ($childNode instanceof \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode
- && $childNode->getViewHelperClassName() === 'TYPO3\\CMS\\Fluid\\ViewHelpers\\ThenViewHelper') {
+ && $childNode->getViewHelperClassName() === \TYPO3\CMS\Fluid\ViewHelpers\ThenViewHelper::class) {
$childNodesAsClosure = $templateCompiler->wrapChildNodesInClosure($childNode);
$initializationPhpCode .= sprintf('%s[\'__thenClosure\'] = %s;', $argumentsVariableName, $childNodesAsClosure) . chr(10);
}
if ($childNode instanceof \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode
- && $childNode->getViewHelperClassName() === 'TYPO3\\CMS\\Fluid\\ViewHelpers\\ElseViewHelper') {
+ && $childNode->getViewHelperClassName() === \TYPO3\CMS\Fluid\ViewHelpers\ElseViewHelper::class) {
$childNodesAsClosure = $templateCompiler->wrapChildNodesInClosure($childNode);
$initializationPhpCode .= sprintf('%s[\'__elseClosure\'] = %s;', $argumentsVariableName, $childNodesAsClosure) . chr(10);
/**
* @var array
*/
- protected $supportedRequestTypes = array('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequest');
+ protected $supportedRequestTypes = array(\TYPO3\CMS\Fluid\Core\Widget\WidgetRequest::class);
/**
* Configuration for this widget.
* @todo clean up, and make it somehow more routing compatible.
*/
private function initializeWidgetIdentifier() {
- if (!$this->viewHelperVariableContainer->exists('TYPO3\\CMS\\Fluid\\Core\\Widget\\AbstractWidgetViewHelper', 'nextWidgetNumber')) {
+ if (!$this->viewHelperVariableContainer->exists(\TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetViewHelper::class, 'nextWidgetNumber')) {
$widgetCounter = 0;
} else {
- $widgetCounter = $this->viewHelperVariableContainer->get('TYPO3\\CMS\\Fluid\\Core\\Widget\\AbstractWidgetViewHelper', 'nextWidgetNumber');
+ $widgetCounter = $this->viewHelperVariableContainer->get(\TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetViewHelper::class, 'nextWidgetNumber');
}
$widgetIdentifier = '@widget_' . $widgetCounter;
- $this->viewHelperVariableContainer->addOrUpdate('TYPO3\\CMS\\Fluid\\Core\\Widget\\AbstractWidgetViewHelper', 'nextWidgetNumber', $widgetCounter + 1);
+ $this->viewHelperVariableContainer->addOrUpdate(\TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetViewHelper::class, 'nextWidgetNumber', $widgetCounter + 1);
$this->widgetContext->setWidgetIdentifier($widgetIdentifier);
}
}
*/
public function __construct() {
\TYPO3\CMS\Fluid\Fluid::$debugMode = TRUE; // We want ViewHelper argument documentation
- $this->abstractViewHelperReflectionClass = new \TYPO3\CMS\Extbase\Reflection\ClassReflection('TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper');
+ $this->abstractViewHelperReflectionClass = new \TYPO3\CMS\Extbase\Reflection\ClassReflection(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::class);
}
/**
protected function getClassNamesInNamespace($namespace) {
$affectedViewHelperClassNames = array();
- $allViewHelperClassNames = $this->reflectionService->getAllSubClassNamesForClass('TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper');
+ $allViewHelperClassNames = $this->reflectionService->getAllSubClassNamesForClass(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::class);
foreach ($allViewHelperClassNames as $viewHelperClassName) {
if ($this->reflectionService->isClassAbstract($viewHelperClassName)) {
continue;
}
$section = $sections[$sectionName];
- $renderingContext->getViewHelperVariableContainer()->add('TYPO3\\CMS\\Fluid\\ViewHelpers\\SectionViewHelper', 'isCurrentlyRenderingSection', 'TRUE');
+ $renderingContext->getViewHelperVariableContainer()->add(\TYPO3\CMS\Fluid\ViewHelpers\SectionViewHelper::class, 'isCurrentlyRenderingSection', 'TRUE');
$this->startRendering($renderingTypeOnNextLevel, $parsedTemplate, $renderingContext);
$output = $section->evaluate($renderingContext);
*/
public function render($value = NULL, $default = FALSE) {
$viewHelperVariableContainer = $this->renderingContext->getViewHelperVariableContainer();
- if (!$viewHelperVariableContainer->exists('TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper', 'switchExpression')) {
+ if (!$viewHelperVariableContainer->exists(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'switchExpression')) {
throw new \TYPO3\CMS\Fluid\Core\ViewHelper\Exception('The case View helper can only be used within a switch View helper', 1368112037);
}
if (is_null($value) && $default === FALSE) {
throw new \TYPO3\CMS\Fluid\Core\ViewHelper\Exception('The case View helper must have either value or default argument', 1382867521);
}
- $switchExpression = $viewHelperVariableContainer->get('TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper', 'switchExpression');
+ $switchExpression = $viewHelperVariableContainer->get(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'switchExpression');
// non-type-safe comparison by intention
if ($default === TRUE || $switchExpression == $value) {
- $viewHelperVariableContainer->addOrUpdate('TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper', 'break', TRUE);
+ $viewHelperVariableContainer->addOrUpdate(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'break', TRUE);
return $this->renderChildren();
}
return '';
*/
protected function getNameWithoutPrefix() {
if ($this->isObjectAccessorMode()) {
- $formObjectName = $this->viewHelperVariableContainer->get('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObjectName');
+ $formObjectName = $this->viewHelperVariableContainer->get(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObjectName');
if (!empty($formObjectName)) {
$propertySegments = explode('.', $this->arguments['property']);
$propertyPath = '';
* @return void
*/
protected function addAdditionalIdentityPropertiesIfNeeded() {
- if (!$this->viewHelperVariableContainer->exists('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObject')) {
+ if (!$this->viewHelperVariableContainer->exists(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObject')) {
return;
}
$propertySegments = explode('.', $this->arguments['property']);
if (count($propertySegments) < 2) {
return;
}
- $formObject = $this->viewHelperVariableContainer->get('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObject');
- $objectName = $this->viewHelperVariableContainer->get('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObjectName');
+ $formObject = $this->viewHelperVariableContainer->get(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObject');
+ $objectName = $this->viewHelperVariableContainer->get(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObjectName');
// If count == 2 -> we need to go through the for-loop exactly once
for ($i = 1; $i < count($propertySegments); $i++) {
$object = ObjectAccess::getPropertyPath($formObject, implode('.', array_slice($propertySegments, 0, $i)));
$objectName .= '[' . $propertySegments[($i - 1)] . ']';
$hiddenIdentityField = $this->renderHiddenIdentityField($object, $objectName);
// Add the hidden identity field to the ViewHelperVariableContainer
- $additionalIdentityProperties = $this->viewHelperVariableContainer->get('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'additionalIdentityProperties');
+ $additionalIdentityProperties = $this->viewHelperVariableContainer->get(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'additionalIdentityProperties');
$additionalIdentityProperties[$objectName] = $hiddenIdentityField;
- $this->viewHelperVariableContainer->addOrUpdate('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'additionalIdentityProperties', $additionalIdentityProperties);
+ $this->viewHelperVariableContainer->addOrUpdate(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'additionalIdentityProperties', $additionalIdentityProperties);
}
}
* @return mixed Value
*/
protected function getPropertyValue() {
- if (!$this->viewHelperVariableContainer->exists('TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper', 'formObject')) {
+ if (!$this->viewHelperVariableContainer->exists(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObject')) {
return NULL;
}
- $formObject = $this->viewHelperVariableContainer->get('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObject');
+ $formObject = $this->viewHelperVariableContainer->get(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObject');
$propertyName = $this->arguments['property'];
if (is_array($formObject)) {
return isset($formObject[$propertyName]) ? $formObject[$propertyName] : NULL;
* @return bool TRUE if we should evaluate the domain object, FALSE otherwise.
*/
protected function isObjectAccessorMode() {
- return $this->hasArgument('property') && $this->viewHelperVariableContainer->exists('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObjectName');
+ return $this->hasArgument('property') && $this->viewHelperVariableContainer->exists(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObjectName');
}
/**
return new \TYPO3\CMS\Extbase\Error\Result();
}
$originalRequestMappingResults = $this->getRequest()->getOriginalRequestMappingResults();
- $formObjectName = $this->viewHelperVariableContainer->get('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObjectName');
+ $formObjectName = $this->viewHelperVariableContainer->get(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObjectName');
return $originalRequestMappingResults->forProperty($formObjectName)->forProperty($this->arguments['property']);
}
*/
protected function renderHiddenFieldForEmptyValue() {
$hiddenFieldNames = array();
- if ($this->viewHelperVariableContainer->exists('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'renderedHiddenFields')) {
- $hiddenFieldNames = $this->viewHelperVariableContainer->get('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'renderedHiddenFields');
+ if ($this->viewHelperVariableContainer->exists(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'renderedHiddenFields')) {
+ $hiddenFieldNames = $this->viewHelperVariableContainer->get(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'renderedHiddenFields');
}
$fieldName = $this->getName();
if (substr($fieldName, -2) === '[]') {
}
if (!in_array($fieldName, $hiddenFieldNames)) {
$hiddenFieldNames[] = $fieldName;
- $this->viewHelperVariableContainer->addOrUpdate('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'renderedHiddenFields', $hiddenFieldNames);
+ $this->viewHelperVariableContainer->addOrUpdate(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'renderedHiddenFields', $hiddenFieldNames);
return '<input type="hidden" name="' . htmlspecialchars($fieldName) . '" value="" />';
}
return '';
if ($fieldName === NULL || $fieldName === '') {
return '';
}
- if (!$this->viewHelperVariableContainer->exists('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'fieldNamePrefix')) {
+ if (!$this->viewHelperVariableContainer->exists(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'fieldNamePrefix')) {
return $fieldName;
}
- $fieldNamePrefix = (string)$this->viewHelperVariableContainer->get('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'fieldNamePrefix');
+ $fieldNamePrefix = (string)$this->viewHelperVariableContainer->get(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'fieldNamePrefix');
if ($fieldNamePrefix === '') {
return $fieldName;
}
* @return void
*/
protected function registerFieldNameForFormTokenGeneration($fieldName) {
- if ($this->viewHelperVariableContainer->exists('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formFieldNames')) {
- $formFieldNames = $this->viewHelperVariableContainer->get('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formFieldNames');
+ if ($this->viewHelperVariableContainer->exists(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formFieldNames')) {
+ $formFieldNames = $this->viewHelperVariableContainer->get(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formFieldNames');
} else {
$formFieldNames = array();
}
$formFieldNames[] = $fieldName;
- $this->viewHelperVariableContainer->addOrUpdate('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formFieldNames', $formFieldNames);
+ $this->viewHelperVariableContainer->addOrUpdate(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formFieldNames', $formFieldNames);
}
}
* @return string HTML-string for the additional identity properties
*/
protected function renderAdditionalIdentityFields() {
- if ($this->viewHelperVariableContainer->exists('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'additionalIdentityProperties')) {
- $additionalIdentityProperties = $this->viewHelperVariableContainer->get('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'additionalIdentityProperties');
+ if ($this->viewHelperVariableContainer->exists(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'additionalIdentityProperties')) {
+ $additionalIdentityProperties = $this->viewHelperVariableContainer->get(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'additionalIdentityProperties');
$output = '';
foreach ($additionalIdentityProperties as $identity) {
$output .= chr(10) . $identity;
protected function addFormObjectNameToViewHelperVariableContainer() {
$formObjectName = $this->getFormObjectName();
if ($formObjectName !== NULL) {
- $this->viewHelperVariableContainer->add('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObjectName', $formObjectName);
+ $this->viewHelperVariableContainer->add(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObjectName', $formObjectName);
}
}
protected function removeFormObjectNameFromViewHelperVariableContainer() {
$formObjectName = $this->getFormObjectName();
if ($formObjectName !== NULL) {
- $this->viewHelperVariableContainer->remove('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObjectName');
+ $this->viewHelperVariableContainer->remove(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObjectName');
}
}
*/
protected function addFormObjectToViewHelperVariableContainer() {
if ($this->hasArgument('object')) {
- $this->viewHelperVariableContainer->add('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObject', $this->arguments['object']);
- $this->viewHelperVariableContainer->add('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'additionalIdentityProperties', array());
+ $this->viewHelperVariableContainer->add(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObject', $this->arguments['object']);
+ $this->viewHelperVariableContainer->add(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'additionalIdentityProperties', array());
}
}
*/
protected function removeFormObjectFromViewHelperVariableContainer() {
if ($this->hasArgument('object')) {
- $this->viewHelperVariableContainer->remove('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObject');
- $this->viewHelperVariableContainer->remove('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'additionalIdentityProperties');
+ $this->viewHelperVariableContainer->remove(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObject');
+ $this->viewHelperVariableContainer->remove(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'additionalIdentityProperties');
}
}
*/
protected function addFieldNamePrefixToViewHelperVariableContainer() {
$fieldNamePrefix = $this->getFieldNamePrefix();
- $this->viewHelperVariableContainer->add('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'fieldNamePrefix', $fieldNamePrefix);
+ $this->viewHelperVariableContainer->add(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'fieldNamePrefix', $fieldNamePrefix);
}
/**
* @return void
*/
protected function removeFieldNamePrefixFromViewHelperVariableContainer() {
- $this->viewHelperVariableContainer->remove('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'fieldNamePrefix');
+ $this->viewHelperVariableContainer->remove(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'fieldNamePrefix');
}
/**
* @return void
*/
protected function addFormFieldNamesToViewHelperVariableContainer() {
- $this->viewHelperVariableContainer->add('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formFieldNames', array());
+ $this->viewHelperVariableContainer->add(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formFieldNames', array());
}
/**
* @return void
*/
protected function removeFormFieldNamesFromViewHelperVariableContainer() {
- $this->viewHelperVariableContainer->remove('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formFieldNames');
+ $this->viewHelperVariableContainer->remove(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formFieldNames');
}
/**
* @return string the hmac field
*/
protected function renderRequestHashField() {
- $formFieldNames = $this->viewHelperVariableContainer->get('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formFieldNames');
+ $formFieldNames = $this->viewHelperVariableContainer->get(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formFieldNames');
$this->postProcessUriArgumentsForRequesthash($this->formActionUriArguments, $formFieldNames);
$requestHash = $this->requestHashService->generateRequestHash($formFieldNames, $this->getFieldNamePrefix());
// in v4, we need to prefix __hmac as well to make it show up in the request object.
* Remove Checkbox field names from ViewHelper variable container, to start from scratch when a new form starts.
*/
protected function removeCheckboxFieldNamesFromViewHelperVariableContainer() {
- if ($this->viewHelperVariableContainer->exists('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\CheckboxViewHelper', 'checkboxFieldNames')) {
- $this->viewHelperVariableContainer->remove('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\CheckboxViewHelper', 'checkboxFieldNames');
+ if ($this->viewHelperVariableContainer->exists(\TYPO3\CMS\Fluid\ViewHelpers\Form\CheckboxViewHelper::class, 'checkboxFieldNames')) {
+ $this->viewHelperVariableContainer->remove(\TYPO3\CMS\Fluid\ViewHelpers\Form\CheckboxViewHelper::class, 'checkboxFieldNames');
}
}
* @return string The hmac field
*/
protected function renderTrustedPropertiesField() {
- $formFieldNames = $this->viewHelperVariableContainer->get('TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper', 'formFieldNames');
+ $formFieldNames = $this->viewHelperVariableContainer->get(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formFieldNames');
$requestHash = $this->mvcPropertyMappingConfigurationService->generateTrustedPropertiesToken($formFieldNames, $this->getFieldNamePrefix());
return '<input type="hidden" name="' . $this->prefixFieldName('__trustedProperties') . '" value="' . htmlspecialchars($requestHash) . '" />';
}
* @api
*/
public function render() {
- if ($this->viewHelperVariableContainer->exists('TYPO3\\CMS\\Fluid\\ViewHelpers\\SectionViewHelper', 'isCurrentlyRenderingSection')) {
- $this->viewHelperVariableContainer->remove('TYPO3\\CMS\\Fluid\\ViewHelpers\\SectionViewHelper', 'isCurrentlyRenderingSection');
+ if ($this->viewHelperVariableContainer->exists(\TYPO3\CMS\Fluid\ViewHelpers\SectionViewHelper::class, 'isCurrentlyRenderingSection')) {
+ $this->viewHelperVariableContainer->remove(\TYPO3\CMS\Fluid\ViewHelpers\SectionViewHelper::class, 'isCurrentlyRenderingSection');
return $this->renderChildren();
}
return '';
$this->backupSwitchState();
$templateVariableContainer = $this->renderingContext->getViewHelperVariableContainer();
- $templateVariableContainer->addOrUpdate('TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper', 'switchExpression', $expression);
- $templateVariableContainer->addOrUpdate('TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper', 'break', FALSE);
+ $templateVariableContainer->addOrUpdate(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'switchExpression', $expression);
+ $templateVariableContainer->addOrUpdate(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'break', FALSE);
foreach ($this->childNodes as $childNode) {
if (
!$childNode instanceof \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode
- || $childNode->getViewHelperClassName() !== 'TYPO3\CMS\Fluid\ViewHelpers\CaseViewHelper'
+ || $childNode->getViewHelperClassName() !== \TYPO3\CMS\Fluid\ViewHelpers\CaseViewHelper::class
) {
continue;
}
$content = $childNode->evaluate($this->renderingContext);
- if ($templateVariableContainer->get('TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper', 'break') === TRUE) {
+ if ($templateVariableContainer->get(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'break') === TRUE) {
break;
}
}
- $templateVariableContainer->remove('TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper', 'switchExpression');
- $templateVariableContainer->remove('TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper', 'break');
+ $templateVariableContainer->remove(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'switchExpression');
+ $templateVariableContainer->remove(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'break');
$this->restoreSwitchState();
return $content;
* @return void
*/
protected function backupSwitchState() {
- if ($this->renderingContext->getViewHelperVariableContainer()->exists('TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper', 'switchExpression')) {
- $this->backupSwitchExpression = $this->renderingContext->getViewHelperVariableContainer()->get('TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper', 'switchExpression');
+ if ($this->renderingContext->getViewHelperVariableContainer()->exists(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'switchExpression')) {
+ $this->backupSwitchExpression = $this->renderingContext->getViewHelperVariableContainer()->get(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'switchExpression');
}
- if ($this->renderingContext->getViewHelperVariableContainer()->exists('TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper', 'break')) {
- $this->backupBreakState = $this->renderingContext->getViewHelperVariableContainer()->get('TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper', 'break');
+ if ($this->renderingContext->getViewHelperVariableContainer()->exists(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'break')) {
+ $this->backupBreakState = $this->renderingContext->getViewHelperVariableContainer()->get(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'break');
}
}
protected function restoreSwitchState() {
if ($this->backupSwitchExpression !== NULL) {
$this->renderingContext->getViewHelperVariableContainer()->addOrUpdate(
- 'TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper',
+ \TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class,
'switchExpression',
$this->backupSwitchExpression
);
}
if ($this->backupBreakState !== FALSE) {
- $this->renderingContext->getViewHelperVariableContainer()->addOrUpdate('TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper', 'break', TRUE);
+ $this->renderingContext->getViewHelperVariableContainer()->addOrUpdate(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'break', TRUE);
}
}
}
protected $mockParsingState;
public function setUp() {
- $this->escapeInterceptor = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\Interceptor\\Escape', array('dummy'));
- $this->mockViewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\AbstractViewHelper');
- $this->mockNode = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ViewHelperNode', array(), array(), '', FALSE);
- $this->mockParsingState = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState');
+ $this->escapeInterceptor = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\Interceptor\Escape::class, array('dummy'));
+ $this->mockViewHelper = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::class);
+ $this->mockNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class, array(), array(), '', FALSE);
+ $this->mockParsingState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
}
/**
*/
public function processWrapsCurrentViewHelperInHtmlspecialcharsViewHelperOnObjectAccessor() {
$interceptorPosition = \TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface::INTERCEPT_OBJECTACCESSOR;
- $mockNode = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ObjectAccessorNode', array(), array(), '', FALSE);
- $mockEscapeViewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\HtmlspecialcharsViewHelper');
- $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
- $mockObjectManager->expects($this->at(0))->method('get')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\HtmlspecialcharsViewHelper')->will($this->returnValue($mockEscapeViewHelper));
- $mockObjectManager->expects($this->at(1))->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ViewHelperNode', $mockEscapeViewHelper, array('value' => $mockNode))->will($this->returnValue($this->mockNode));
+ $mockNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode::class, array(), array(), '', FALSE);
+ $mockEscapeViewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlspecialcharsViewHelper::class);
+ $mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
+ $mockObjectManager->expects($this->at(0))->method('get')->with(\TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlspecialcharsViewHelper::class)->will($this->returnValue($mockEscapeViewHelper));
+ $mockObjectManager->expects($this->at(1))->method('get')->with(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class, $mockEscapeViewHelper, array('value' => $mockNode))->will($this->returnValue($this->mockNode));
$this->escapeInterceptor->_set('objectManager', $mockObjectManager);
$actualResult = $this->escapeInterceptor->process($mockNode, $interceptorPosition, $this->mockParsingState);
* @test
*/
public function renderCallsTheRightMethodsOnTheRootNode() {
- $renderingContext = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Rendering\\RenderingContextInterface');
+ $renderingContext = $this->getMock(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface::class);
- $rootNode = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode');
+ $rootNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode::class);
$rootNode->expects($this->once())->method('evaluate')->with($renderingContext)->will($this->returnValue('T3DD09 Rock!'));
$this->parsingState->setRootNode($rootNode);
$renderedValue = $this->parsingState->render($renderingContext);
protected $childNode;
public function setUp() {
- $this->renderingContext = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Rendering\\RenderingContext', array(), array(), '', FALSE);
+ $this->renderingContext = $this->getMock(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContext::class, array(), array(), '', FALSE);
- $this->abstractNode = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\AbstractNode', array('evaluate'));
+ $this->abstractNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode::class, array('evaluate'));
- $this->childNode = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\AbstractNode');
+ $this->childNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode::class);
$this->abstractNode->addChildNode($this->childNode);
}
* Setup fixture
*/
public function setUp() {
- $this->renderingContext = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Rendering\\RenderingContextInterface');
+ $this->renderingContext = $this->getMock(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface::class);
}
/**
* @expectedException \TYPO3\CMS\Fluid\Core\Parser\Exception
*/
public function havingMoreThanThreeElementsInTheSyntaxTreeThrowsException() {
- $rootNode = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode');
+ $rootNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode::class);
$rootNode->expects($this->once())->method('getChildNodes')->will($this->returnValue(array(1, 2, 3, 4)));
new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
$rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
- $object1Node = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ObjectAccessorNode', array('evaluate'), array('foo'));
+ $object1Node = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode::class, array('evaluate'), array('foo'));
$object1Node->expects($this->any())->method('evaluate')->will($this->returnValue($object1));
- $object2Node = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ObjectAccessorNode', array('evaluate'), array('foo'));
+ $object2Node = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode::class, array('evaluate'), array('foo'));
$object2Node->expects($this->any())->method('evaluate')->will($this->returnValue($object2));
$rootNode->addChildNode($object1Node);
$rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
- $object1Node = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ObjectAccessorNode', array('evaluate'), array('foo'));
+ $object1Node = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode::class, array('evaluate'), array('foo'));
$object1Node->expects($this->any())->method('evaluate')->will($this->returnValue($object1));
- $object2Node = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ObjectAccessorNode', array('evaluate'), array('foo'));
+ $object2Node = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode::class, array('evaluate'), array('foo'));
$object2Node->expects($this->any())->method('evaluate')->will($this->returnValue($object2));
$rootNode->addChildNode($object1Node);
public function renderReturnsProperIntegerGivenInConstructor() {
$string = '1';
$node = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NumericNode($string);
- $this->assertEquals($node->evaluate($this->getMock('TYPO3\CMS\Fluid\Core\Rendering\RenderingContext')), 1, 'The rendered value of a numeric node does not match the string given in the constructor.');
+ $this->assertEquals($node->evaluate($this->getMock(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContext::class)), 1, 'The rendered value of a numeric node does not match the string given in the constructor.');
}
/**
public function renderReturnsProperFloatGivenInConstructor() {
$string = '1.1';
$node = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NumericNode($string);
- $this->assertEquals($node->evaluate($this->getMock('TYPO3\CMS\Fluid\Core\Rendering\RenderingContext')), 1.1, 'The rendered value of a numeric node does not match the string given in the constructor.');
+ $this->assertEquals($node->evaluate($this->getMock(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContext::class)), 1.1, 'The rendered value of a numeric node does not match the string given in the constructor.');
}
/**
public function renderReturnsSameStringAsGivenInConstructor() {
$string = 'I can work quite effectively in a train!';
$node = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode($string);
- $this->assertEquals($node->evaluate($this->getMock('TYPO3\\CMS\\Fluid\\Core\\Rendering\\RenderingContext')), $string, 'The rendered string of a text node is not the same as the string given in the constructor.');
+ $this->assertEquals($node->evaluate($this->getMock(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContext::class)), $string, 'The rendered string of a text node is not the same as the string given in the constructor.');
}
/**
* Setup fixture
*/
public function setUp() {
- $this->renderingContext = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Rendering\\RenderingContext');
+ $this->renderingContext = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContext::class);
- $this->mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
+ $this->mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
$this->renderingContext->_set('objectManager', $this->mockObjectManager);
- $this->templateVariableContainer = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TemplateVariableContainer');
+ $this->templateVariableContainer = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer::class);
$this->renderingContext->injectTemplateVariableContainer($this->templateVariableContainer);
- $this->controllerContext = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ControllerContext', array(), array(), '', FALSE);
+ $this->controllerContext = $this->getMock(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext::class, array(), array(), '', FALSE);
$this->renderingContext->setControllerContext($this->controllerContext);
- $this->viewHelperVariableContainer = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\ViewHelperVariableContainer');
+ $this->viewHelperVariableContainer = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer::class);
$this->renderingContext->_set('viewHelperVariableContainer', $this->viewHelperVariableContainer);
}
* @test
*/
public function constructorSetsViewHelperAndArguments() {
- $viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\AbstractViewHelper');
+ $viewHelper = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::class);
$arguments = array('foo' => 'bar');
- $viewHelperNode = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ViewHelperNode', array('dummy'), array($viewHelper, $arguments));
+ $viewHelperNode = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class, array('dummy'), array($viewHelper, $arguments));
$this->assertEquals(get_class($viewHelper), $viewHelperNode->getViewHelperClassName());
$this->assertEquals($arguments, $viewHelperNode->_get('arguments'));
* @test
*/
public function childNodeAccessFacetWorksAsExpected() {
- $childNode = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\TextNode', array(), array('foo'));
+ $childNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode::class, array(), array('foo'));
- $mockViewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\Tests\\Unit\\Core\\Parser\\Fixtures\\ChildNodeAccessFacetViewHelper', array('setChildNodes', 'initializeArguments', 'render', 'prepareArguments'));
+ $mockViewHelper = $this->getMock(\TYPO3\CMS\Fluid\Tests\Unit\Core\Parser\Fixtures\ChildNodeAccessFacetViewHelper::class, array('setChildNodes', 'initializeArguments', 'render', 'prepareArguments'));
$viewHelperNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode($mockViewHelper, array());
$viewHelperNode->addChildNode($childNode);
* @test
*/
public function initializeArgumentsAndRenderIsCalledByViewHelperNode() {
- $mockViewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\AbstractViewHelper', array('initializeArgumentsAndRender', 'prepareArguments'));
+ $mockViewHelper = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::class, array('initializeArgumentsAndRender', 'prepareArguments'));
$mockViewHelper->expects($this->once())->method('initializeArgumentsAndRender');
$viewHelperNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode($mockViewHelper, array());
'param2' => new \TYPO3\CMS\Fluid\Core\ViewHelper\ArgumentDefinition('param2', 'string', 'Hallo', TRUE, NULL, TRUE)
);
- $mockViewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\AbstractViewHelper', array('initializeArgumentsAndRender', 'prepareArguments'));
+ $mockViewHelper = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::class, array('initializeArgumentsAndRender', 'prepareArguments'));
$mockViewHelper->expects($this->any())->method('prepareArguments')->will($this->returnValue($arguments));
$mockViewHelper->expects($this->once())->method('initializeArgumentsAndRender');
* @test
*/
public function evaluateMethodPassesRenderingContextToViewHelper() {
- $mockViewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\AbstractViewHelper', array('render', 'validateArguments', 'prepareArguments', 'setRenderingContext'));
+ $mockViewHelper = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::class, array('render', 'validateArguments', 'prepareArguments', 'setRenderingContext'));
$mockViewHelper->expects($this->once())->method('setRenderingContext')->with($this->renderingContext);
$viewHelperNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode($mockViewHelper, array());
* @test
*/
public function multipleEvaluateCallsShareTheSameViewHelperInstance() {
- $mockViewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\AbstractViewHelper', array('render', 'validateArguments', 'prepareArguments', 'setViewHelperVariableContainer'));
+ $mockViewHelper = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::class, array('render', 'validateArguments', 'prepareArguments', 'setViewHelperVariableContainer'));
$mockViewHelper->expects($this->any())->method('render')->will($this->returnValue('String'));
$viewHelperNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode($mockViewHelper, array());
* @test
*/
public function extractNamespaceDefinitionsExtractsNamespacesCorrectly() {
- $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('dummy'));
+ $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
$templateParser->_call('extractNamespaceDefinitions', ' \\{namespace f4=F7\\Rocks} {namespace f4=TYPO3\Rocks\Really}');
$expected = array(
- 'f' => 'TYPO3\CMS\Fluid\ViewHelpers',
+ 'f' => \TYPO3\CMS\Fluid\ViewHelpers::class,
'f4' => 'TYPO3\Rocks\Really'
);
$this->assertEquals($expected, $templateParser->getNamespaces(), 'Namespaces do not match.');
'http://otherdomain.tld/ns/other/viewhelpers' => 'My\Other\Namespace'
)
);
- $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('dummy'));
+ $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
$templateParser->injectSettings($mockSettings);
$templateParser->_call('extractNamespaceDefinitions', 'Some content <html xmlns="http://www.w3.org/1999/xhtml" xmlns:f5="http://domain.tld/ns/my/viewhelpers"
xmlns:xyz="http://otherdomain.tld/ns/other/viewhelpers" />');
$expected = array(
- 'f' => 'TYPO3\CMS\Fluid\ViewHelpers',
+ 'f' => \TYPO3\CMS\Fluid\ViewHelpers::class,
'f5' => 'My\Namespace',
'xyz' => 'My\Other\Namespace'
);
* @test
*/
public function extractNamespaceDefinitionsResolveNamespacesWithDefaultPattern() {
- $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('dummy'));
+ $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
$templateParser->_call('extractNamespaceDefinitions', '<xml xmlns="http://www.w3.org/1999/xhtml" xmlns:xyz="http://typo3.org/ns/Some/Package/ViewHelpers" />');
$expected = array(
- 'f' => 'TYPO3\CMS\Fluid\ViewHelpers',
+ 'f' => \TYPO3\CMS\Fluid\ViewHelpers::class,
'xyz' => 'Some\Package\ViewHelpers'
);
$this->assertEquals($expected, $templateParser->getNamespaces(), 'Namespaces do not match.');
'http://domain.tld/ns/my/viewhelpers' => 'My\Namespace'
)
);
- $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('dummy'));
+ $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
$templateParser->injectSettings($mockSettings);
$templateParser->_call('extractNamespaceDefinitions', '<xml xmlns="http://www.w3.org/1999/xhtml" xmlns:f5="http://domain.tld/ns/my/viewhelpers"
xmlns:xyz="http://otherdomain.tld/ns/other/viewhelpers" />');
$expected = array(
- 'f' => 'TYPO3\CMS\Fluid\ViewHelpers',
+ 'f' => \TYPO3\CMS\Fluid\ViewHelpers::class,
'f5' => 'My\Namespace'
);
$this->assertEquals($expected, $templateParser->getNamespaces(), 'Namespaces do not match.');
* @test
*/
public function extractNamespaceDefinitionsSilentlySkipsXmlNamespaceDeclarationForTheDefaultFluidNamespace() {
- $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('dummy'));
+ $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
$templateParser->_call('extractNamespaceDefinitions', '<foo xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://domain.tld/this/will/be/ignored" />');
$expected = array(
- 'f' => 'TYPO3\CMS\Fluid\ViewHelpers'
+ 'f' => \TYPO3\CMS\Fluid\ViewHelpers::class
);
$this->assertEquals($expected, $templateParser->getNamespaces(), 'Namespaces do not match.');
}
* @expectedException \TYPO3\CMS\Fluid\Core\Parser\Exception
*/
public function extractNamespaceDefinitionsThrowsExceptionIfNamespaceIsRedeclared() {
- $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('dummy'));
+ $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
$templateParser->_call('extractNamespaceDefinitions', '{namespace typo3=TYPO3\CMS\Fluid\Blablubb} {namespace typo3= TYPO3\Rocks\Blu}');
}
'http://domain.tld/ns/my/viewhelpers' => 'My\Namespace'
)
);
- $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('dummy'));
+ $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
$templateParser->injectSettings($mockSettings);
$templateParser->_call('extractNamespaceDefinitions', '<foo xmlns="http://www.w3.org/1999/xhtml" xmlns:typo3="http://domain.tld/ns/my/viewhelpers" />{namespace typo3=TYPO3\CMS\Fluid\Blablubb}');
}
'http://domain.tld/ns/my/viewhelpers' => 'My\Namespace'
)
);
- $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('dummy'));
+ $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
$templateParser->injectSettings($mockSettings);
$templateParser->_call('extractNamespaceDefinitions', '{namespace typo3=TYPO3\CMS\Fluid\Blablubb} <foo xmlns="http://www.w3.org/1999/xhtml" xmlns:typo3="http://domain.tld/ns/my/viewhelpers" />');
}
* @test
*/
public function viewHelperNameWithMultipleLevelsCanBeResolvedByResolveViewHelperName() {
- $mockTemplateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('dummy'), array(), '', FALSE);
+ $mockTemplateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'), array(), '', FALSE);
$result = $mockTemplateParser->_call('resolveViewHelperName', 'f', 'foo.bar.baz');
$expected = 'TYPO3\CMS\Fluid\ViewHelpers\Foo\Bar\BazViewHelper';
$this->assertEquals($expected, $result, 'The name of the View Helper Name could not be resolved.');
* @test
*/
public function viewHelperNameWithOneLevelCanBeResolvedByResolveViewHelperName() {
- $mockTemplateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('dummy'), array(), '', FALSE);
+ $mockTemplateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'), array(), '', FALSE);
$actual = $mockTemplateParser->_call('resolveViewHelperName', 'f', 'myown');
$expected = 'TYPO3\CMS\Fluid\ViewHelpers\MyownViewHelper';
$this->assertEquals($expected, $actual);
* @test
*/
public function unquoteStringReturnsUnquotedStrings($quoted, $unquoted) {
- $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('dummy'));
+ $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
$this->assertEquals($unquoted, $templateParser->_call('unquoteString', $quoted));
}
public function splitTemplateAtDynamicTagsReturnsCorrectlySplitTemplate($templateName) {
$template = file_get_contents(__DIR__ . '/Fixtures/' . $templateName . '.html', FILE_TEXT);
$expectedResult = require(__DIR__ . '/Fixtures/' . $templateName . '-split.php');
- $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('dummy'));
+ $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
$this->assertSame($expectedResult, $templateParser->_call('splitTemplateAtDynamicTags', $template), 'Filed for ' . $templateName);
}
* @test
*/
public function buildObjectTreeCreatesRootNodeAndSetsUpParsingState() {
- $mockRootNode = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode');
+ $mockRootNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode::class);
- $mockState = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState');
+ $mockState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
$mockState->expects($this->once())->method('setRootNode')->with($mockRootNode);
$mockState->expects($this->once())->method('pushNodeToStack')->with($mockRootNode);
$mockState->expects($this->once())->method('countNodeStack')->will($this->returnValue(1));
- $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
- $mockObjectManager->expects($this->at(0))->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState')->will($this->returnValue($mockState));
- $mockObjectManager->expects($this->at(1))->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode')->will($this->returnValue($mockRootNode));
+ $mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
+ $mockObjectManager->expects($this->at(0))->method('get')->with(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class)->will($this->returnValue($mockState));
+ $mockObjectManager->expects($this->at(1))->method('get')->with(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode::class)->will($this->returnValue($mockRootNode));
- $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('dummy'));
+ $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
$templateParser->_set('objectManager', $mockObjectManager);
$templateParser->_call('buildObjectTree', array(), \TYPO3\CMS\Fluid\Core\Parser\TemplateParser::CONTEXT_OUTSIDE_VIEWHELPER_ARGUMENTS);
}
* @expectedException \TYPO3\CMS\Fluid\Core\Parser\Exception
*/
public function buildObjectTreeThrowsExceptionIfOpenTagsRemain() {
- $mockRootNode = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode');
+ $mockRootNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode::class);
- $mockState = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState');
+ $mockState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
$mockState->expects($this->once())->method('countNodeStack')->will($this->returnValue(2));
- $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
- $mockObjectManager->expects($this->at(0))->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState')->will($this->returnValue($mockState));
- $mockObjectManager->expects($this->at(1))->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode')->will($this->returnValue($mockRootNode));
+ $mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
+ $mockObjectManager->expects($this->at(0))->method('get')->with(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class)->will($this->returnValue($mockState));
+ $mockObjectManager->expects($this->at(1))->method('get')->with(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode::class)->will($this->returnValue($mockRootNode));
- $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('dummy'));
+ $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
$templateParser->_set('objectManager', $mockObjectManager);
$templateParser->_call('buildObjectTree', array(), \TYPO3\CMS\Fluid\Core\Parser\TemplateParser::CONTEXT_OUTSIDE_VIEWHELPER_ARGUMENTS);
}
* @test
*/
public function buildObjectTreeDelegatesHandlingOfTemplateElements() {
- $mockRootNode = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode');
- $mockState = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState');
+ $mockRootNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode::class);
+ $mockState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
$mockState->expects($this->once())->method('countNodeStack')->will($this->returnValue(1));
- $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
- $mockObjectManager->expects($this->at(0))->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState')->will($this->returnValue($mockState));
- $mockObjectManager->expects($this->at(1))->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode')->will($this->returnValue($mockRootNode));
+ $mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
+ $mockObjectManager->expects($this->at(0))->method('get')->with(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class)->will($this->returnValue($mockState));
+ $mockObjectManager->expects($this->at(1))->method('get')->with(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode::class)->will($this->returnValue($mockRootNode));
- $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('textHandler', 'openingViewHelperTagHandler', 'closingViewHelperTagHandler', 'textAndShorthandSyntaxHandler'));
+ $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('textHandler', 'openingViewHelperTagHandler', 'closingViewHelperTagHandler', 'textAndShorthandSyntaxHandler'));
$templateParser->_set('objectManager', $mockObjectManager);
$templateParser->expects($this->at(0))->method('textAndShorthandSyntaxHandler')->with($mockState, 'The first part is simple');
$templateParser->expects($this->at(1))->method('textHandler')->with($mockState, '<f:for each="{a: {a: 0, b: 2, c: 4}}" as="array"><f:for each="{array}" as="value">{value} </f:for>');
* @test
*/
public function openingViewHelperTagHandlerDelegatesViewHelperInitialization() {
- $mockState = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState');
+ $mockState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
$mockState->expects($this->never())->method('popNodeFromStack');
- $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('parseArguments', 'initializeViewHelperAndAddItToStack'));
+ $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('parseArguments', 'initializeViewHelperAndAddItToStack'));
$templateParser->expects($this->once())->method('parseArguments')->with(array('arguments'))->will($this->returnValue(array('parsedArguments')));
$templateParser->expects($this->once())->method('initializeViewHelperAndAddItToStack')->with($mockState, 'namespaceIdentifier', 'methodIdentifier', array('parsedArguments'));
* @test
*/
public function openingViewHelperTagHandlerPopsNodeFromStackForSelfClosingTags() {
- $mockState = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState');
- $mockState->expects($this->once())->method('popNodeFromStack')->will($this->returnValue($this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\NodeInterface')));
+ $mockState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
+ $mockState->expects($this->once())->method('popNodeFromStack')->will($this->returnValue($this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NodeInterface::class)));
- $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('parseArguments', 'initializeViewHelperAndAddItToStack'));
+ $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('parseArguments', 'initializeViewHelperAndAddItToStack'));
$templateParser->_call('openingViewHelperTagHandler', $mockState, '', '', array(), TRUE);
}
* @test
*/
public function initializeViewHelperAndAddItToStackCreatesRequestedViewHelperAndViewHelperNode() {
- $mockViewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\AbstractViewHelper');
- $mockViewHelperNode = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ViewHelperNode', array(), array(), '', FALSE);
+ $mockViewHelper = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::class);
+ $mockViewHelperNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class, array(), array(), '', FALSE);
- $mockNodeOnStack = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\NodeInterface');
+ $mockNodeOnStack = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NodeInterface::class);
$mockNodeOnStack->expects($this->once())->method('addChildNode')->with($mockViewHelperNode);
- $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
+ $mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
$mockObjectManager->expects($this->at(0))->method('get')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\MyownViewHelper')->will($this->returnValue($mockViewHelper));
- $mockObjectManager->expects($this->at(1))->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ViewHelperNode')->will($this->returnValue($mockViewHelperNode));
+ $mockObjectManager->expects($this->at(1))->method('get')->with(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class)->will($this->returnValue($mockViewHelperNode));
- $mockState = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState');
+ $mockState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
$mockState->expects($this->once())->method('getNodeFromStack')->will($this->returnValue($mockNodeOnStack));
$mockState->expects($this->once())->method('pushNodeToStack')->with($mockViewHelperNode);
- $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('abortIfUnregisteredArgumentsExist', 'abortIfRequiredArgumentsAreMissing', 'rewriteBooleanNodesInArgumentsObjectTree'));
+ $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('abortIfUnregisteredArgumentsExist', 'abortIfRequiredArgumentsAreMissing', 'rewriteBooleanNodesInArgumentsObjectTree'));
$templateParser->_set('objectManager', $mockObjectManager);
$templateParser->_call('initializeViewHelperAndAddItToStack', $mockState, 'f', 'myown', array('arguments'));
$expectedArguments = array('expectedArguments');
$argumentsObjectTree = array('arguments');
- $mockViewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\AbstractViewHelper');
+ $mockViewHelper = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::class);
$mockViewHelper->expects($this->once())->method('prepareArguments')->will($this->returnValue($expectedArguments));
- $mockViewHelperNode = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ViewHelperNode', array(), array(), '', FALSE);
+ $mockViewHelperNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class, array(), array(), '', FALSE);
- $mockNodeOnStack = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\NodeInterface');
+ $mockNodeOnStack = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NodeInterface::class);
- $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
+ $mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
$mockObjectManager->expects($this->at(0))->method('get')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\MyownViewHelper')->will($this->returnValue($mockViewHelper));
- $mockObjectManager->expects($this->at(1))->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ViewHelperNode')->will($this->returnValue($mockViewHelperNode));
+ $mockObjectManager->expects($this->at(1))->method('get')->with(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class)->will($this->returnValue($mockViewHelperNode));
- $mockState = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState');
+ $mockState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
$mockState->expects($this->once())->method('getNodeFromStack')->will($this->returnValue($mockNodeOnStack));
- $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('abortIfUnregisteredArgumentsExist', 'abortIfRequiredArgumentsAreMissing', 'rewriteBooleanNodesInArgumentsObjectTree'));
+ $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('abortIfUnregisteredArgumentsExist', 'abortIfRequiredArgumentsAreMissing', 'rewriteBooleanNodesInArgumentsObjectTree'));
$templateParser->_set('objectManager', $mockObjectManager);
$templateParser->expects($this->once())->method('abortIfUnregisteredArgumentsExist')->with($expectedArguments, $argumentsObjectTree);
$templateParser->expects($this->once())->method('abortIfRequiredArgumentsAreMissing')->with($expectedArguments, $argumentsObjectTree);
* @test
*/
public function initializeViewHelperAndAddItToStackHandlesPostParseFacets() {
- $mockViewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\Tests\\Unit\\Core\\Parser\\Fixtures\\PostParseFacetViewHelper', array('prepareArguments'));
- $mockViewHelperNode = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ViewHelperNode', array(), array(), '', FALSE);
+ $mockViewHelper = $this->getMock(\TYPO3\CMS\Fluid\Tests\Unit\Core\Parser\Fixtures\PostParseFacetViewHelper::class, array('prepareArguments'));
+ $mockViewHelperNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class, array(), array(), '', FALSE);
- $mockNodeOnStack = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\NodeInterface');
+ $mockNodeOnStack = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NodeInterface::class);
$mockNodeOnStack->expects($this->once())->method('addChildNode')->with($mockViewHelperNode);
- $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
+ $mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
$mockObjectManager->expects($this->at(0))->method('get')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\MyownViewHelper')->will($this->returnValue($mockViewHelper));
- $mockObjectManager->expects($this->at(1))->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ViewHelperNode')->will($this->returnValue($mockViewHelperNode));
+ $mockObjectManager->expects($this->at(1))->method('get')->with(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class)->will($this->returnValue($mockViewHelperNode));
- $mockState = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState');
+ $mockState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
$mockState->expects($this->once())->method('getNodeFromStack')->will($this->returnValue($mockNodeOnStack));
- $mockState->expects($this->once())->method('getVariableContainer')->will($this->returnValue($this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TemplateVariableContainer')));
+ $mockState->expects($this->once())->method('getVariableContainer')->will($this->returnValue($this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer::class)));
- $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('abortIfUnregisteredArgumentsExist', 'abortIfRequiredArgumentsAreMissing', 'rewriteBooleanNodesInArgumentsObjectTree'));
+ $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('abortIfUnregisteredArgumentsExist', 'abortIfRequiredArgumentsAreMissing', 'rewriteBooleanNodesInArgumentsObjectTree'));
$templateParser->_set('objectManager', $mockObjectManager);
$templateParser->_call('initializeViewHelperAndAddItToStack', $mockState, 'f', 'myown', array('arguments'));
$expected = array(new \TYPO3\CMS\Fluid\Core\ViewHelper\ArgumentDefinition('firstArgument', 'string', '', FALSE));
$actual = array('firstArgument' => 'foo', 'secondArgument' => 'bar');
- $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('dummy'));
+ $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
$templateParser->_call('abortIfUnregisteredArgumentsExist', $expected, $actual);
}
'name1' => 'bla'
);
- $mockTemplateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('dummy'));
+ $mockTemplateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
$mockTemplateParser->_call('abortIfUnregisteredArgumentsExist', $expectedArguments, $actualArguments);
// dummy assertion to avoid "did not perform any assertions" error
new \TYPO3\CMS\Fluid\Core\ViewHelper\ArgumentDefinition('secondArgument', 'string', '', TRUE)
);
- $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('dummy'));
+ $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
$templateParser->_call('abortIfRequiredArgumentsAreMissing', $expected, array());
}
'name2' => 'bla'
);
- $mockTemplateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('dummy'));
+ $mockTemplateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
$mockTemplateParser->_call('abortIfRequiredArgumentsAreMissing', $expectedArguments, $actualArguments);
// dummy assertion to avoid "did not perform any assertions" error
* @expectedException \TYPO3\CMS\Fluid\Core\Parser\Exception
*/
public function closingViewHelperTagHandlerThrowsExceptionBecauseOfClosingTagWhichWasNeverOpened() {
- $mockNodeOnStack = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\NodeInterface', array(), array(), '', FALSE);
- $mockState = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState');
+ $mockNodeOnStack = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NodeInterface::class, array(), array(), '', FALSE);
+ $mockState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
$mockState->expects($this->once())->method('popNodeFromStack')->will($this->returnValue($mockNodeOnStack));
- $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('dummy'));
+ $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
$templateParser->_call('closingViewHelperTagHandler', $mockState, 'f', 'method');
}
* @expectedException \TYPO3\CMS\Fluid\Core\Parser\Exception
*/
public function closingViewHelperTagHandlerThrowsExceptionBecauseOfWrongTagNesting() {
- $mockNodeOnStack = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ViewHelperNode', array(), array(), '', FALSE);
- $mockState = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState');
+ $mockNodeOnStack = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class, array(), array(), '', FALSE);
+ $mockState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
$mockState->expects($this->once())->method('popNodeFromStack')->will($this->returnValue($mockNodeOnStack));
- $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('dummy'));
+ $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
$templateParser->_call('closingViewHelperTagHandler', $mockState, 'f', 'method');
}
* @test
*/
public function objectAccessorHandlerCallsInitializeViewHelperAndAddItToStackIfViewHelperSyntaxIsPresent() {
- $mockState = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState');
- $mockState->expects($this->exactly(2))->method('popNodeFromStack')->will($this->returnValue($this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\NodeInterface')));
+ $mockState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
+ $mockState->expects($this->exactly(2))->method('popNodeFromStack')->will($this->returnValue($this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NodeInterface::class)));
- $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('recursiveArrayHandler', 'postProcessArgumentsForObjectAccessor', 'initializeViewHelperAndAddItToStack'));
+ $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('recursiveArrayHandler', 'postProcessArgumentsForObjectAccessor', 'initializeViewHelperAndAddItToStack'));
$templateParser->expects($this->at(0))->method('recursiveArrayHandler')->with('format: "H:i"')->will($this->returnValue(array('format' => 'H:i')));
$templateParser->expects($this->at(1))->method('postProcessArgumentsForObjectAccessor')->with(array('format' => 'H:i'))->will($this->returnValue(array('processedArguments')));
$templateParser->expects($this->at(2))->method('initializeViewHelperAndAddItToStack')->with($mockState, 'f', 'format.date', array('processedArguments'));
* @test
*/
public function objectAccessorHandlerCreatesObjectAccessorNodeWithExpectedValueAndAddsItToStack() {
- $objectAccessorNode = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ObjectAccessorNode', array(), array(), '', FALSE);
+ $objectAccessorNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode::class, array(), array(), '', FALSE);
- $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
- $mockObjectManager->expects($this->once())->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ObjectAccessorNode', 'objectAccessorString')->will($this->returnValue($objectAccessorNode));
+ $mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
+ $mockObjectManager->expects($this->once())->method('get')->with(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode::class, 'objectAccessorString')->will($this->returnValue($objectAccessorNode));
- $mockNodeOnStack = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\AbstractNode', array(), array(), '', FALSE);
+ $mockNodeOnStack = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode::class, array(), array(), '', FALSE);
$mockNodeOnStack->expects($this->once())->method('addChildNode')->with($objectAccessorNode);
- $mockState = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState');
+ $mockState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
$mockState->expects($this->once())->method('getNodeFromStack')->will($this->returnValue($mockNodeOnStack));
- $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('dummy'));
+ $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
$templateParser->_set('objectManager', $mockObjectManager);
$templateParser->_call('objectAccessorHandler', $mockState, 'objectAccessorString', '', '', '');
* @test
*/
public function valuesFromObjectAccessorsAreRunThroughValueInterceptorsByDefault() {
- $objectAccessorNode = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ObjectAccessorNode', array(), array(), '', FALSE);
- $objectAccessorNodeInterceptor = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\InterceptorInterface');
+ $objectAccessorNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode::class, array(), array(), '', FALSE);
+ $objectAccessorNodeInterceptor = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface::class);
$objectAccessorNodeInterceptor->expects($this->once())->method('process')->with($objectAccessorNode)->will($this->returnArgument(0));
- $parserConfiguration = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\Configuration');
+ $parserConfiguration = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\Configuration::class);
$parserConfiguration->expects($this->once())->method('getInterceptors')->with(\TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface::INTERCEPT_OBJECTACCESSOR)->will($this->returnValue(array($objectAccessorNodeInterceptor)));
- $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
+ $mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
$mockObjectManager->expects($this->once())->method('get')->will($this->returnValue($objectAccessorNode));
- $mockNodeOnStack = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\AbstractNode', array(), array(), '', FALSE);
- $mockState = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState');
+ $mockNodeOnStack = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode::class, array(), array(), '', FALSE);
+ $mockState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
$mockState->expects($this->once())->method('getNodeFromStack')->will($this->returnValue($mockNodeOnStack));
- $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('dummy'));
+ $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
$templateParser->_set('objectManager', $mockObjectManager);
$templateParser->_set('configuration', $parserConfiguration);
* @param array $expected
*/
public function parseArgumentsWorksAsExpected($argumentsString, array $expected) {
- $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('buildArgumentObjectTree'));
+ $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('buildArgumentObjectTree'));
$templateParser->expects($this->any())->method('buildArgumentObjectTree')->will($this->returnArgument(0));
$this->assertSame($expected, $templateParser->_call('parseArguments', $argumentsString));
* @test
*/
public function buildArgumentObjectTreeReturnsTextNodeForSimplyString() {
- $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
- $mockObjectManager->expects($this->once())->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\TextNode', 'a very plain string')->will($this->returnValue('theTextNode'));
+ $mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
+ $mockObjectManager->expects($this->once())->method('get')->with(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode::class, 'a very plain string')->will($this->returnValue('theTextNode'));
- $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('dummy'));
+ $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('dummy'));
$templateParser->_set('objectManager', $mockObjectManager);
$this->assertEquals('theTextNode', $templateParser->_call('buildArgumentObjectTree', 'a very plain string'));
* @test
*/
public function buildArgumentObjectTreeBuildsObjectTreeForComlexString() {
- $objectTree = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState');
+ $objectTree = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
$objectTree->expects($this->once())->method('getRootNode')->will($this->returnValue('theRootNode'));
- $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('splitTemplateAtDynamicTags', 'buildObjectTree'));
+ $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('splitTemplateAtDynamicTags', 'buildObjectTree'));
$templateParser->expects($this->at(0))->method('splitTemplateAtDynamicTags')->with('a <very> {complex} string')->will($this->returnValue('split string'));
$templateParser->expects($this->at(1))->method('buildObjectTree')->with('split string')->will($this->returnValue($objectTree));
* @test
*/
public function textAndShorthandSyntaxHandlerDelegatesAppropriately() {
- $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
+ $mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
$mockObjectManager->expects($this->any())->method('get')->will($this->returnArgument(1));
- $mockState = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState');
+ $mockState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
- $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('objectAccessorHandler', 'arrayHandler', 'textHandler'));
+ $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('objectAccessorHandler', 'arrayHandler', 'textHandler'));
$templateParser->_set('objectManager', $mockObjectManager);
$templateParser->expects($this->at(0))->method('objectAccessorHandler')->with($mockState, 'someThing.absolutely', '', '', '');
$templateParser->expects($this->at(1))->method('textHandler')->with($mockState, ' "fishy" is \'going\' ');
* @test
*/
public function arrayHandlerAddsArrayNodeWithProperContentToStack() {
- $arrayNode = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ArrayNode', array(), array(array()));
- $mockNodeOnStack = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\AbstractNode', array(), array(), '', FALSE);
+ $arrayNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ArrayNode::class, array(), array(array()));
+ $mockNodeOnStack = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode::class, array(), array(), '', FALSE);
$mockNodeOnStack->expects($this->once())->method('addChildNode')->with($arrayNode);
- $mockState = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState');
+ $mockState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
$mockState->expects($this->once())->method('getNodeFromStack')->will($this->returnValue($mockNodeOnStack));
- $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
- $mockObjectManager->expects($this->once())->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ArrayNode', 'processedArrayText')->will($this->returnValue($arrayNode));
+ $mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
+ $mockObjectManager->expects($this->once())->method('get')->with(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ArrayNode::class, 'processedArrayText')->will($this->returnValue($arrayNode));
- $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('recursiveArrayHandler'));
+ $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('recursiveArrayHandler'));
$templateParser->_set('objectManager', $mockObjectManager);
$templateParser->expects($this->once())->method('recursiveArrayHandler')->with('arrayText')->will($this->returnValue('processedArrayText'));
* @dataProvider arrayTexts
*/
public function recursiveArrayHandlerReturnsExpectedArray($arrayText, $expectedArray) {
- $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
+ $mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
$mockObjectManager->expects($this->any())->method('get')->will($this->returnArgument(1));
- $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('buildArgumentObjectTree'));
+ $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('buildArgumentObjectTree'));
$templateParser->_set('objectManager', $mockObjectManager);
$templateParser->expects($this->any())->method('buildArgumentObjectTree')->will($this->returnArgument(0));
* @test
*/
public function textNodesAreRunThroughTextInterceptors() {
- $textNode = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\TextNode', array(), array(), '', FALSE);
- $textInterceptor = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\InterceptorInterface');
+ $textNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode::class, array(), array(), '', FALSE);
+ $textInterceptor = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface::class);
$textInterceptor->expects($this->once())->method('process')->with($textNode)->will($this->returnArgument(0));
- $parserConfiguration = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\Configuration');
+ $parserConfiguration = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\Configuration::class);
$parserConfiguration->expects($this->once())->method('getInterceptors')->with(\TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface::INTERCEPT_TEXT)->will($this->returnValue(array($textInterceptor)));
- $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
- $mockObjectManager->expects($this->once())->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\TextNode', 'string')->will($this->returnValue($textNode));
+ $mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
+ $mockObjectManager->expects($this->once())->method('get')->with(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode::class, 'string')->will($this->returnValue($textNode));
- $mockNodeOnStack = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\AbstractNode', array(), array(), '', FALSE);
+ $mockNodeOnStack = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode::class, array(), array(), '', FALSE);
$mockNodeOnStack->expects($this->once())->method('addChildNode')->with($textNode);
- $mockState = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState');
+ $mockState = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsingState::class);
$mockState->expects($this->once())->method('getNodeFromStack')->will($this->returnValue($mockNodeOnStack));
- $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('splitTemplateAtDynamicTags', 'buildObjectTree'));
+ $templateParser = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class, array('splitTemplateAtDynamicTags', 'buildObjectTree'));
$templateParser->_set('objectManager', $mockObjectManager);
$templateParser->_set('configuration', $parserConfiguration);
protected $renderingContext;
public function setUp() {
- $this->renderingContext = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Rendering\\RenderingContext', array('dummy'));
+ $this->renderingContext = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContext::class, array('dummy'));
}
/**
* @test
*/
public function templateVariableContainerCanBeReadCorrectly() {
- $templateVariableContainer = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TemplateVariableContainer');
+ $templateVariableContainer = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer::class);
$this->renderingContext->injectTemplateVariableContainer($templateVariableContainer);
$this->assertSame($this->renderingContext->getTemplateVariableContainer(), $templateVariableContainer, 'Template Variable Container could not be read out again.');
}
* @test
*/
public function controllerContextCanBeReadCorrectly() {
- $controllerContext = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ControllerContext', array(), array(), '', FALSE);
+ $controllerContext = $this->getMock(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext::class, array(), array(), '', FALSE);
$this->renderingContext->setControllerContext($controllerContext);
$this->assertSame($this->renderingContext->getControllerContext(), $controllerContext);
}
* @test
*/
public function viewHelperVariableContainerCanBeReadCorrectly() {
- $viewHelperVariableContainer = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\ViewHelperVariableContainer');
+ $viewHelperVariableContainer = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer::class);
$this->renderingContext->_set('viewHelperVariableContainer', $viewHelperVariableContainer);
$this->assertSame($viewHelperVariableContainer, $this->renderingContext->getViewHelperVariableContainer());
}
public function setUp() {
parent::setUp();
- $this->viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\AbstractConditionViewHelper', array('getRenderingContext', 'renderChildren', 'hasArgument'));
+ $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractConditionViewHelper::class, array('getRenderingContext', 'renderChildren', 'hasArgument'));
$this->viewHelper->expects($this->any())->method('getRenderingContext')->will($this->returnValue($this->renderingContext));
$this->injectDependenciesIntoViewHelper($this->viewHelper);
}
* @test
*/
public function renderThenChildReturnsThenViewHelperChildIfConditionIsTrueAndThenViewHelperChildExists() {
- $mockThenViewHelperNode = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ViewHelperNode', array('getViewHelperClassName', 'evaluate'), array(), '', FALSE);
- $mockThenViewHelperNode->expects($this->at(0))->method('getViewHelperClassName')->will($this->returnValue('TYPO3\\CMS\\Fluid\\ViewHelpers\\ThenViewHelper'));
+ $mockThenViewHelperNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class, array('getViewHelperClassName', 'evaluate'), array(), '', FALSE);
+ $mockThenViewHelperNode->expects($this->at(0))->method('getViewHelperClassName')->will($this->returnValue(\TYPO3\CMS\Fluid\ViewHelpers\ThenViewHelper::class));
$mockThenViewHelperNode->expects($this->at(1))->method('evaluate')->with($this->renderingContext)->will($this->returnValue('ThenViewHelperResults'));
$this->viewHelper->setChildNodes(array($mockThenViewHelperNode));
* @test
*/
public function renderElseChildRendersElseViewHelperChildIfConditionIsFalseAndNoThenViewHelperChildExists() {
- $mockElseViewHelperNode = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ViewHelperNode', array('getViewHelperClassName', 'evaluate', 'setRenderingContext'), array(), '', FALSE);
- $mockElseViewHelperNode->expects($this->at(0))->method('getViewHelperClassName')->will($this->returnValue('TYPO3\\CMS\\Fluid\\ViewHelpers\\ElseViewHelper'));
+ $mockElseViewHelperNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class, array('getViewHelperClassName', 'evaluate', 'setRenderingContext'), array(), '', FALSE);
+ $mockElseViewHelperNode->expects($this->at(0))->method('getViewHelperClassName')->will($this->returnValue(\TYPO3\CMS\Fluid\ViewHelpers\ElseViewHelper::class));
$mockElseViewHelperNode->expects($this->at(1))->method('evaluate')->with($this->renderingContext)->will($this->returnValue('ElseViewHelperResults'));
$this->viewHelper->setChildNodes(array($mockElseViewHelperNode));
* @test
*/
public function renderThenChildReturnsEmptyStringIfChildNodesOnlyContainElseViewHelper() {
- $mockElseViewHelperNode = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ViewHelperNode', array('getViewHelperClassName', 'evaluate'), array(), '', FALSE);
- $mockElseViewHelperNode->expects($this->any())->method('getViewHelperClassName')->will($this->returnValue('TYPO3\\CMS\\Fluid\\ViewHelpers\\ElseViewHelper'));
+ $mockElseViewHelperNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class, array('getViewHelperClassName', 'evaluate'), array(), '', FALSE);
+ $mockElseViewHelperNode->expects($this->any())->method('getViewHelperClassName')->will($this->returnValue(\TYPO3\CMS\Fluid\ViewHelpers\ElseViewHelper::class));
$this->viewHelper->setChildNodes(array($mockElseViewHelperNode));
$this->viewHelper->expects($this->never())->method('renderChildren')->will($this->returnValue('Child nodes'));
* @test
*/
public function thenArgumentHasPriorityOverChildNodesIfConditionIsTrue() {
- $mockThenViewHelperNode = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ViewHelperNode', array('getViewHelperClassName', 'evaluate', 'setRenderingContext'), array(), '', FALSE);
+ $mockThenViewHelperNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class, array('getViewHelperClassName', 'evaluate', 'setRenderingContext'), array(), '', FALSE);
$mockThenViewHelperNode->expects($this->never())->method('evaluate');
$this->viewHelper->setChildNodes(array($mockThenViewHelperNode));
* @test
*/
public function elseArgumentHasPriorityOverChildNodesIfConditionIsFalse() {
- $mockElseViewHelperNode = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ViewHelperNode', array('getViewHelperClassName', 'evaluate', 'setRenderingContext'), array(), '', FALSE);
- $mockElseViewHelperNode->expects($this->any())->method('getViewHelperClassName')->will($this->returnValue('TYPO3\\CMS\\Fluid\\ViewHelpers\\ElseViewHelper'));
+ $mockElseViewHelperNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class, array('getViewHelperClassName', 'evaluate', 'setRenderingContext'), array(), '', FALSE);
+ $mockElseViewHelperNode->expects($this->any())->method('getViewHelperClassName')->will($this->returnValue(\TYPO3\CMS\Fluid\ViewHelpers\ElseViewHelper::class));
$mockElseViewHelperNode->expects($this->never())->method('evaluate');
$this->viewHelper->setChildNodes(array($mockElseViewHelperNode));
protected $viewHelper;
public function setUp() {
- $this->viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\AbstractTagBasedViewHelper', array('dummy'), array(), '', FALSE);
+ $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper::class, array('dummy'), array(), '', FALSE);
}
/**
* @test
*/
public function initializeResetsUnderlyingTagBuilder() {
- $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('reset'), array(), '', FALSE);
+ $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('reset'), array(), '', FALSE);
$mockTagBuilder->expects($this->once())->method('reset');
$this->viewHelper->_set('tag', $mockTagBuilder);
* @test
*/
public function oneTagAttributeIsRenderedCorrectly() {
- $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('addAttribute'), array(), '', FALSE);
+ $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('addAttribute'), array(), '', FALSE);
$mockTagBuilder->expects($this->once())->method('addAttribute')->with('foo', 'bar');
$this->viewHelper->_set('tag', $mockTagBuilder);
* @test
*/
public function additionalTagAttributesAreRenderedCorrectly() {
- $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('addAttribute'), array(), '', FALSE);
+ $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('addAttribute'), array(), '', FALSE);
$mockTagBuilder->expects($this->once())->method('addAttribute')->with('foo', 'bar');
$this->viewHelper->_set('tag', $mockTagBuilder);
* @test
*/
public function dataAttributesAreRenderedCorrectly() {
- $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('addAttribute'), array(), '', FALSE);
+ $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('addAttribute'), array(), '', FALSE);
$mockTagBuilder->expects($this->at(0))->method('addAttribute')->with('data-foo', 'bar');
$mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('data-baz', 'foos');
$this->viewHelper->_set('tag', $mockTagBuilder);
* @test
*/
public function standardTagAttributesAreRegistered() {
- $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('addAttribute'), array(), '', FALSE);
+ $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('addAttribute'), array(), '', FALSE);
$mockTagBuilder->expects($this->at(0))->method('addAttribute')->with('class', 'classAttribute');
$mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('dir', 'dirAttribute');
$mockTagBuilder->expects($this->at(2))->method('addAttribute')->with('id', 'idAttribute');
* @test
*/
public function registerTagAttributeRegistersArgumentWithDefaultValue() {
- $this->viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\AbstractTagBasedViewHelper', array('registerArgument'), array(), '', FALSE);
+ $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper::class, array('registerArgument'), array(), '', FALSE);
$this->viewHelper->expects($this->once())->method('registerArgument')->with('foo', 'string', 'Description', FALSE, 'defaultValue');
$this->viewHelper->_call('registerTagAttribute', 'foo', 'string', 'Description', FALSE, 'defaultValue');
}
* @test
*/
public function registerTagAttributeRegistersArgumentWithNullIfNoDefaultValueIsSet() {
- $this->viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\AbstractTagBasedViewHelper', array('registerArgument'), array(), '', FALSE);
+ $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper::class, array('registerArgument'), array(), '', FALSE);
$this->viewHelper->expects($this->once())->method('registerArgument')->with('foo', 'string', 'Description', FALSE, NULL);
$this->viewHelper->_call('registerTagAttribute', 'foo', 'string', 'Description', FALSE);
}
);
public function setUp() {
- $this->mockReflectionService = $this->getMock('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService', array(), array(), '', FALSE);
+ $this->mockReflectionService = $this->getMock(\TYPO3\CMS\Extbase\Reflection\ReflectionService::class, array(), array(), '', FALSE);
}
/**
* @test
*/
public function argumentsCanBeRegistered() {
- $viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\AbstractViewHelper', array('render'), array(), '', FALSE);
+ $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::class, array('render'), array(), '', FALSE);
$viewHelper->injectReflectionService($this->mockReflectionService);
$name = 'This is a name';
* @expectedException \TYPO3\CMS\Fluid\Core\ViewHelper\Exception
*/
public function registeringTheSameArgumentNameAgainThrowsException() {
- $viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\AbstractViewHelper', array('render'), array(), '', FALSE);
+ $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::class, array('render'), array(), '', FALSE);
$name = 'shortName';
$description = 'Example desc';
* @test
*/
public function overrideArgumentOverwritesExistingArgumentDefinition() {
- $viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\AbstractViewHelper', array('render'), array(), '', FALSE);
+ $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::class, array('render'), array(), '', FALSE);
$viewHelper->injectReflectionService($this->mockReflectionService);
$name = 'argumentName';
* @expectedException \TYPO3\CMS\Fluid\Core\ViewHelper\Exception
*/
public function overrideArgumentThrowsExceptionWhenTryingToOverwriteAnNonexistingArgument() {
- $viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\AbstractViewHelper', array('render'), array(), '', FALSE);
+ $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::class, array('render'), array(), '', FALSE);
$viewHelper->injectReflectionService($this->mockReflectionService);
$viewHelper->_call('overrideArgument', 'argumentName', 'string', 'description', TRUE);
* @test
*/
public function prepareArgumentsCallsInitializeArguments() {
- $viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\AbstractViewHelper', array('render', 'initializeArguments'), array(), '', FALSE);
+ $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::class, array('render', 'initializeArguments'), array(), '', FALSE);
$viewHelper->injectReflectionService($this->mockReflectionService);
$viewHelper->expects($this->once())->method('initializeArguments');
\TYPO3\CMS\Fluid\Fluid::$debugMode = TRUE;
- $dataCacheMock = $this->getMock('TYPO3\\CMS\\Core\\Cache\\Frontend\\VariableFrontend', array(), array(), '', FALSE);
+ $dataCacheMock = $this->getMock(\TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class, array(), array(), '', FALSE);
$dataCacheMock->expects($this->any())->method('has')->will($this->returnValue(TRUE));
$dataCacheMock->expects($this->any())->method('get')->will($this->returnValue(array()));
$viewHelper = new \TYPO3\CMS\Fluid\Tests\Unit\Core\Fixtures\TestViewHelper();
- $this->mockReflectionService->expects($this->once())->method('getMethodParameters')->with('TYPO3\\CMS\\Fluid\\Tests\\Unit\\Core\\Fixtures\\TestViewHelper', 'render')->will($this->returnValue($this->fixtureMethodParameters));
- $this->mockReflectionService->expects($this->once())->method('getMethodTagsValues')->with('TYPO3\\CMS\\Fluid\\Tests\\Unit\\Core\\Fixtures\\TestViewHelper', 'render')->will($this->returnValue($this->fixtureMethodTags));
+ $this->mockReflectionService->expects($this->once())->method('getMethodParameters')->with(\TYPO3\CMS\Fluid\Tests\Unit\Core\Fixtures\TestViewHelper::class, 'render')->will($this->returnValue($this->fixtureMethodParameters));
+ $this->mockReflectionService->expects($this->once())->method('getMethodTagsValues')->with(\TYPO3\CMS\Fluid\Tests\Unit\Core\Fixtures\TestViewHelper::class, 'render')->will($this->returnValue($this->fixtureMethodTags));
$viewHelper->injectReflectionService($this->mockReflectionService);
$expected = array(
\TYPO3\CMS\Fluid\Fluid::$debugMode = FALSE;
- $dataCacheMock = $this->getMock('TYPO3\\CMS\\Core\\Cache\\Frontend\\VariableFrontend', array(), array(), '', FALSE);
+ $dataCacheMock = $this->getMock(\TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class, array(), array(), '', FALSE);
$dataCacheMock->expects($this->any())->method('has')->will($this->returnValue(TRUE));
$dataCacheMock->expects($this->any())->method('get')->will($this->returnValue(array()));
$viewHelper = new \TYPO3\CMS\Fluid\Tests\Unit\Core\Fixtures\TestViewHelper2();
- $this->mockReflectionService->expects($this->once())->method('getMethodParameters')->with('TYPO3\\CMS\\Fluid\\Tests\\Unit\\Core\\Fixtures\\TestViewHelper2', 'render')->will($this->returnValue($this->fixtureMethodParameters));
+ $this->mockReflectionService->expects($this->once())->method('getMethodParameters')->with(\TYPO3\CMS\Fluid\Tests\Unit\Core\Fixtures\TestViewHelper2::class, 'render')->will($this->returnValue($this->fixtureMethodParameters));
$this->mockReflectionService->expects($this->never())->method('getMethodTagsValues');
$viewHelper->injectReflectionService($this->mockReflectionService);
* @test
*/
public function validateArgumentsCallsPrepareArguments() {
- $viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\AbstractViewHelper', array('render', 'prepareArguments'), array(), '', FALSE);
+ $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::class, array('render', 'prepareArguments'), array(), '', FALSE);
$viewHelper->injectReflectionService($this->mockReflectionService);
$viewHelper->expects($this->once())->method('prepareArguments')->will($this->returnValue(array()));
* @test
*/
public function validateArgumentsAcceptsAllObjectsImplemtingArrayAccessAsAnArray() {
- $viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\AbstractViewHelper', array('render', 'prepareArguments'), array(), '', FALSE);
+ $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::class, array('render', 'prepareArguments'), array(), '', FALSE);
$viewHelper->setArguments(array('test' => new \ArrayObject));
$viewHelper->expects($this->once())->method('prepareArguments')->will($this->returnValue(array('test' => new \TYPO3\CMS\Fluid\Core\ViewHelper\ArgumentDefinition('test', 'array', FALSE, 'documentation'))));
* @test
*/
public function validateArgumentsCallsTheRightValidators() {
- $viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\AbstractViewHelper', array('render', 'prepareArguments'), array(), '', FALSE);
+ $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::class, array('render', 'prepareArguments'), array(), '', FALSE);
$viewHelper->injectReflectionService($this->mockReflectionService);
$viewHelper->setArguments(array('test' => 'Value of argument'));
* @expectedException \InvalidArgumentException
*/
public function validateArgumentsCallsTheRightValidatorsAndThrowsExceptionIfValidationIsWrong() {
- $viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\AbstractViewHelper', array('render', 'prepareArguments'), array(), '', FALSE);
+ $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::class, array('render', 'prepareArguments'), array(), '', FALSE);
$viewHelper->injectReflectionService($this->mockReflectionService);
$viewHelper->setArguments(array('test' => 'test'));
* @test
*/
public function initializeArgumentsAndRenderCallsTheCorrectSequenceOfMethods() {
- $viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\AbstractViewHelper', array('validateArguments', 'initialize', 'callRenderMethod'));
+ $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::class, array('validateArguments', 'initialize', 'callRenderMethod'));
$viewHelper->expects($this->at(0))->method('validateArguments');
$viewHelper->expects($this->at(1))->method('initialize');
$viewHelper->expects($this->at(2))->method('callRenderMethod')->will($this->returnValue('Output'));
* @test
*/
public function setRenderingContextShouldSetInnerVariables() {
- $templateVariableContainer = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TemplateVariableContainer');
- $viewHelperVariableContainer = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\ViewHelperVariableContainer');
- $controllerContext = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ControllerContext', array(), array(), '', FALSE);
+ $templateVariableContainer = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer::class);
+ $viewHelperVariableContainer = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer::class);
+ $controllerContext = $this->getMock(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext::class, array(), array(), '', FALSE);
- $renderingContext = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Rendering\\RenderingContext', array('dummy'));
+ $renderingContext = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContext::class, array('dummy'));
$renderingContext->injectTemplateVariableContainer($templateVariableContainer);
$renderingContext->_set('viewHelperVariableContainer', $viewHelperVariableContainer);
$renderingContext->setControllerContext($controllerContext);
- $viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\AbstractViewHelper', array('render', 'prepareArguments'), array(), '', FALSE);
+ $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::class, array('render', 'prepareArguments'), array(), '', FALSE);
$viewHelper->setRenderingContext($renderingContext);
* @test
*/
public function resetResetsTagBuilder() {
- $tagBuilder = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('dummy'));
+ $tagBuilder = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('dummy'));
$tagBuilder->setTagName('tagName');
$tagBuilder->setContent('some content');
$tagBuilder->forceClosingTag(TRUE);
*/
public function storedDataCanBeReadOutAgain() {
$variable = 'Hello world';
- $this->assertFalse($this->viewHelperVariableContainer->exists('TYPO3\\CMS\\Fluid\\ViewHelpers\\TestViewHelper', 'test'));
- $this->viewHelperVariableContainer->add('TYPO3\\CMS\\Fluid\\ViewHelpers\\TestViewHelper', 'test', $variable);
- $this->assertTrue($this->viewHelperVariableContainer->exists('TYPO3\\CMS\\Fluid\\ViewHelpers\\TestViewHelper', 'test'));
+ $this->assertFalse($this->viewHelperVariableContainer->exists(\TYPO3\CMS\Fluid\ViewHelpers\TestViewHelper::class, 'test'));
+ $this->viewHelperVariableContainer->add(\TYPO3\CMS\Fluid\ViewHelpers\TestViewHelper::class, 'test', $variable);
+ $this->assertTrue($this->viewHelperVariableContainer->exists(\TYPO3\CMS\Fluid\ViewHelpers\TestViewHelper::class, 'test'));
- $this->assertEquals($variable, $this->viewHelperVariableContainer->get('TYPO3\\CMS\\Fluid\\ViewHelpers\\TestViewHelper', 'test'));
+ $this->assertEquals($variable, $this->viewHelperVariableContainer->get(\TYPO3\CMS\Fluid\ViewHelpers\TestViewHelper::class, 'test'));
}
/**
* @test
*/
public function viewCanBeReadOutAgain() {
- $view = $this->getMock('TYPO3\\CMS\\Fluid\\View\\AbstractTemplateView', array('getTemplateSource', 'getLayoutSource', 'getPartialSource', 'hasTemplate', 'canRender', 'getTemplateIdentifier', 'getLayoutIdentifier', 'getPartialIdentifier'));
+ $view = $this->getMock(\TYPO3\CMS\Fluid\View\AbstractTemplateView::class, array('getTemplateSource', 'getLayoutSource', 'getPartialSource', 'hasTemplate', 'canRender', 'getTemplateIdentifier', 'getLayoutIdentifier', 'getPartialIdentifier'));
$this->viewHelperVariableContainer->setView($view);
$this->assertSame($view, $this->viewHelperVariableContainer->getView());
}
*/
public function canHandleWidgetRequest() {
/** @var WidgetRequest|\PHPUnit_Framework_MockObject_MockObject $request */
- $request = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequest', array('dummy'), array(), '', FALSE);
+ $request = $this->getMock(\TYPO3\CMS\Fluid\Core\Widget\WidgetRequest::class, array('dummy'), array(), '', FALSE);
/** @var AbstractWidgetController|\PHPUnit_Framework_MockObject_MockObject $abstractWidgetController */
- $abstractWidgetController = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\AbstractWidgetController', array('dummy'), array(), '', FALSE);
+ $abstractWidgetController = $this->getMock(\TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetController::class, array('dummy'), array(), '', FALSE);
$this->assertTrue($abstractWidgetController->canProcessRequest($request));
}
* @test
*/
public function processRequestSetsWidgetConfiguration() {
- $widgetContext = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetContext');
+ $widgetContext = $this->getMock(\TYPO3\CMS\Fluid\Core\Widget\WidgetContext::class);
$widgetContext->expects($this->once())->method('getWidgetConfiguration')->will($this->returnValue('myConfiguration'));
/** @var WidgetRequest|\PHPUnit_Framework_MockObject_MockObject $request */
- $request = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequest', array(), array(), '', FALSE);
+ $request = $this->getMock(\TYPO3\CMS\Fluid\Core\Widget\WidgetRequest::class, array(), array(), '', FALSE);
$request->expects($this->once())->method('getWidgetContext')->will($this->returnValue($widgetContext));
/** @var ResponseInterface|\PHPUnit_Framework_MockObject_MockObject $response */
- $response = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\ResponseInterface');
+ $response = $this->getMock(\TYPO3\CMS\Extbase\Mvc\ResponseInterface::class);
/** @var AbstractWidgetController|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface $abstractWidgetController */
- $abstractWidgetController = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\AbstractWidgetController', array('resolveActionMethodName', 'initializeActionMethodArguments', 'initializeActionMethodValidators', 'initializeAction', 'checkRequestHash', 'mapRequestArgumentsToControllerArguments', 'buildControllerContext', 'resolveView', 'callActionMethod'), array(), '', FALSE);
- $mockUriBuilder = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder');
- $objectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
- $objectManager->expects($this->any())->method('get')->with('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder')->will($this->returnValue($mockUriBuilder));
+ $abstractWidgetController = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetController::class, array('resolveActionMethodName', 'initializeActionMethodArguments', 'initializeActionMethodValidators', 'initializeAction', 'checkRequestHash', 'mapRequestArgumentsToControllerArguments', 'buildControllerContext', 'resolveView', 'callActionMethod'), array(), '', FALSE);
+ $mockUriBuilder = $this->getMock(\TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::class);
+ $objectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
+ $objectManager->expects($this->any())->method('get')->with(\TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::class)->will($this->returnValue($mockUriBuilder));
- $configurationService = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\MvcPropertyMappingConfigurationService');
+ $configurationService = $this->getMock(\TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService::class);
$abstractWidgetController->_set('mvcPropertyMappingConfigurationService', $configurationService);
$abstractWidgetController->_set('arguments', new Arguments());
$frameworkConfiguration = array(
'view' => array(
'widget' => array(
- 'TYPO3\\CMS\\Fluid\\ViewHelpers\\Widget\\PaginateViewHelper' => array(
+ \TYPO3\CMS\Fluid\ViewHelpers\Widget\PaginateViewHelper::class => array(
'templateRootPath' => 'EXT:fluid/Resources/Private/DummyTestTemplates'
)
)
)
);
- $widgetContext = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetContext');
- $widgetContext->expects($this->any())->method('getWidgetViewHelperClassName')->will($this->returnValue('TYPO3\\CMS\\Fluid\\ViewHelpers\\Widget\\PaginateViewHelper'));
- $request = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequest', array(), array(), '', FALSE);
+ $widgetContext = $this->getMock(\TYPO3\CMS\Fluid\Core\Widget\WidgetContext::class);
+ $widgetContext->expects($this->any())->method('getWidgetViewHelperClassName')->will($this->returnValue(\TYPO3\CMS\Fluid\ViewHelpers\Widget\PaginateViewHelper::class));
+ $request = $this->getMock(\TYPO3\CMS\Fluid\Core\Widget\WidgetRequest::class, array(), array(), '', FALSE);
$request->expects($this->any())->method('getWidgetContext')->will($this->returnValue($widgetContext));
- $configurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager');
+ $configurationManager = $this->getMock(\TYPO3\CMS\Extbase\Configuration\ConfigurationManager::class);
$configurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($frameworkConfiguration));
- $view = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('dummy'), array(), '', FALSE);
- $abstractWidgetController = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\AbstractWidgetController', array('dummy'));
+ $view = $this->getAccessibleMock(\TYPO3\CMS\Fluid\View\TemplateView::class, array('dummy'), array(), '', FALSE);
+ $abstractWidgetController = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetController::class, array('dummy'));
$abstractWidgetController->_set('configurationManager', $configurationManager);
$abstractWidgetController->_set('request', $request);
$abstractWidgetController->_call('setViewConfiguration', $view);
*/
public function setUp() {
- $this->viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\AbstractWidgetViewHelper', array('validateArguments', 'initialize', 'callRenderMethod', 'getWidgetConfiguration', 'getRenderingContext'));
- $this->mockExtensionService = $this->getMock('TYPO3\\CMS\\Extbase\\Service\\ExtensionService');
+ $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetViewHelper::class, array('validateArguments', 'initialize', 'callRenderMethod', 'getWidgetConfiguration', 'getRenderingContext'));
+ $this->mockExtensionService = $this->getMock(\TYPO3\CMS\Extbase\Service\ExtensionService::class);
$this->viewHelper->_set('extensionService', $this->mockExtensionService);
- $this->ajaxWidgetContextHolder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\AjaxWidgetContextHolder', array(), array(), '', FALSE);
+ $this->ajaxWidgetContextHolder = $this->getMock(\TYPO3\CMS\Fluid\Core\Widget\AjaxWidgetContextHolder::class, array(), array(), '', FALSE);
$this->viewHelper->injectAjaxWidgetContextHolder($this->ajaxWidgetContextHolder);
- $this->widgetContext = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetContext');
- $this->objectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
- $this->objectManager->expects($this->at(0))->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetContext')->will($this->returnValue($this->widgetContext));
+ $this->widgetContext = $this->getMock(\TYPO3\CMS\Fluid\Core\Widget\WidgetContext::class);
+ $this->objectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
+ $this->objectManager->expects($this->at(0))->method('get')->with(\TYPO3\CMS\Fluid\Core\Widget\WidgetContext::class)->will($this->returnValue($this->widgetContext));
$this->viewHelper->injectObjectManager($this->objectManager);
- $this->request = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request');
- $this->controllerContext = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ControllerContext', array(), array(), '', FALSE);
+ $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('getRequest')->will($this->returnValue($this->request));
$this->viewHelper->_set('controllerContext', $this->controllerContext);
}
* @return void
*/
public function callViewHelper() {
- $mockViewHelperVariableContainer = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\ViewHelperVariableContainer');
- $mockRenderingContext = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Rendering\\RenderingContextInterface');
+ $mockViewHelperVariableContainer = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer::class);
+ $mockRenderingContext = $this->getMock(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface::class);
$mockRenderingContext->expects($this->atLeastOnce())->method('getViewHelperVariableContainer')->will($this->returnValue($mockViewHelperVariableContainer));
$this->viewHelper->setRenderingContext($mockRenderingContext);
$this->viewHelper->expects($this->once())->method('getWidgetConfiguration')->will($this->returnValue('Some Widget Configuration'));
* @test
*/
public function setChildNodesAddsChildNodesToWidgetContext() {
- $node1 = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\AbstractNode');
- $node2 = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\TextNode', array(), array(), '', FALSE);
- $node3 = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\AbstractNode');
- $rootNode = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode');
+ $node1 = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode::class);
+ $node2 = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode::class, array(), array(), '', FALSE);
+ $node3 = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode::class);
+ $rootNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode::class);
$rootNode->expects($this->at(0))->method('addChildNode')->with($node1);
$rootNode->expects($this->at(1))->method('addChildNode')->with($node2);
$rootNode->expects($this->at(2))->method('addChildNode')->with($node3);
- $this->objectManager->expects($this->once())->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode')->will($this->returnValue($rootNode));
- $renderingContext = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Rendering\\RenderingContextInterface');
+ $this->objectManager->expects($this->once())->method('get')->with(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode::class)->will($this->returnValue($rootNode));
+ $renderingContext = $this->getMock(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface::class);
$this->viewHelper->_set('renderingContext', $renderingContext);
$this->widgetContext->expects($this->once())->method('setViewHelperChildNodes')->with($rootNode, $renderingContext);
$this->viewHelper->setChildNodes(array($node1, $node2, $node3));
* @test
*/
public function initiateSubRequestBuildsRequestProperly() {
- $controller = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\AbstractWidgetController', array(), array(), '', FALSE);
+ $controller = $this->getMock(\TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetController::class, array(), array(), '', FALSE);
$this->viewHelper->_set('controller', $controller);
// Initial Setup
- $widgetRequest = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequest');
- $response = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Response');
- $this->objectManager->expects($this->at(0))->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequest')->will($this->returnValue($widgetRequest));
- $this->objectManager->expects($this->at(1))->method('get')->with('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Response')->will($this->returnValue($response));
+ $widgetRequest = $this->getMock(\TYPO3\CMS\Fluid\Core\Widget\WidgetRequest::class);
+ $response = $this->getMock(\TYPO3\CMS\Extbase\Mvc\Web\Response::class);
+ $this->objectManager->expects($this->at(0))->method('get')->with(\TYPO3\CMS\Fluid\Core\Widget\WidgetRequest::class)->will($this->returnValue($widgetRequest));
+ $this->objectManager->expects($this->at(1))->method('get')->with(\TYPO3\CMS\Extbase\Mvc\Web\Response::class)->will($this->returnValue($response));
// Widget Context is set
$widgetRequest->expects($this->once())->method('setWidgetContext')->with($this->widgetContext);
// The namespaced arguments are passed to the sub-request
*/
public function getThrowsExceptionIfWidgetContextIsNotFound() {
/** @var \TYPO3\CMS\Fluid\Core\Widget\AjaxWidgetContextHolder $ajaxWidgetContextHolder */
- $ajaxWidgetContextHolder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\AjaxWidgetContextHolder', array('dummy'), array(), '', FALSE);
+ $ajaxWidgetContextHolder = $this->getMock(\TYPO3\CMS\Fluid\Core\Widget\AjaxWidgetContextHolder::class, array('dummy'), array(), '', FALSE);
$ajaxWidgetContextHolder->get(42);
}
}
* @test
*/
public function viewHelperChildNodesCanBeReadAgain() {
- $viewHelperChildNodes = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode');
- $renderingContext = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Rendering\\RenderingContextInterface');
+ $viewHelperChildNodes = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode::class);
+ $renderingContext = $this->getMock(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface::class);
$this->widgetContext->setViewHelperChildNodes($viewHelperChildNodes, $renderingContext);
$this->assertSame($viewHelperChildNodes, $this->widgetContext->getViewHelperChildNodes());
$this->assertSame($renderingContext, $this->widgetContext->getViewHelperChildNodeRenderingContext());
protected $mockWidgetContext;
public function setUp() {
- $this->widgetRequestBuilder = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequestBuilder', array('setArgumentsFromRawRequestData'));
- $this->mockWidgetRequest = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequest');
- $this->mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
- $this->mockObjectManager->expects($this->once())->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequest')->will($this->returnValue($this->mockWidgetRequest));
+ $this->widgetRequestBuilder = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Widget\WidgetRequestBuilder::class, array('setArgumentsFromRawRequestData'));
+ $this->mockWidgetRequest = $this->getMock(\TYPO3\CMS\Fluid\Core\Widget\WidgetRequest::class);
+ $this->mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
+ $this->mockObjectManager->expects($this->once())->method('get')->with(\TYPO3\CMS\Fluid\Core\Widget\WidgetRequest::class)->will($this->returnValue($this->mockWidgetRequest));
$this->widgetRequestBuilder->_set('objectManager', $this->mockObjectManager);
- $this->mockWidgetContext = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetContext');
- $this->mockAjaxWidgetContextHolder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\AjaxWidgetContextHolder', array(), array(), '', FALSE);
+ $this->mockWidgetContext = $this->getMock(\TYPO3\CMS\Fluid\Core\Widget\WidgetContext::class);
+ $this->mockAjaxWidgetContextHolder = $this->getMock(\TYPO3\CMS\Fluid\Core\Widget\AjaxWidgetContextHolder::class, array(), array(), '', FALSE);
$this->widgetRequestBuilder->injectAjaxWidgetContextHolder($this->mockAjaxWidgetContextHolder);
$this->mockAjaxWidgetContextHolder->expects($this->once())->method('get')->will($this->returnValue($this->mockWidgetContext));
}
* Set up
*/
public function setUp() {
- $this->widgetRequestHandler = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequestHandler', array('dummy'), array(), '', FALSE);
+ $this->widgetRequestHandler = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\Widget\WidgetRequestHandler::class, array('dummy'), array(), '', FALSE);
}
/**
* @test
*/
public function priorityIsHigherThanDefaultRequestHandler() {
- $defaultWebRequestHandler = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Web\\AbstractRequestHandler', array('handleRequest'), array(), '', FALSE);
+ $defaultWebRequestHandler = $this->getMock(\TYPO3\CMS\Extbase\Mvc\Web\AbstractRequestHandler::class, array('handleRequest'), array(), '', FALSE);
$this->assertTrue($this->widgetRequestHandler->getPriority() > $defaultWebRequestHandler->getPriority());
}
}
* @test
*/
public function setWidgetContextAlsoSetsControllerObjectName() {
- $widgetContext = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetContext', array('getControllerObjectName'));
+ $widgetContext = $this->getMock(\TYPO3\CMS\Fluid\Core\Widget\WidgetContext::class, array('getControllerObjectName'));
$widgetContext->expects($this->once())->method('getControllerObjectName')->will($this->returnValue('Tx_Fluid_ControllerObjectName'));
- $widgetRequest = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequest', array('setControllerObjectName'));
+ $widgetRequest = $this->getMock(\TYPO3\CMS\Fluid\Core\Widget\WidgetRequest::class, array('setControllerObjectName'));
$widgetRequest->expects($this->once())->method('setControllerObjectName')->with('Tx_Fluid_ControllerObjectName');
$widgetRequest->setWidgetContext($widgetContext);
}
* @test
*/
public function widgetContextCanBeReadAgain() {
- $widgetContext = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetContext');
- $widgetRequest = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequest', array('setControllerObjectName'));
+ $widgetContext = $this->getMock(\TYPO3\CMS\Fluid\Core\Widget\WidgetContext::class);
+ $widgetRequest = $this->getMock(\TYPO3\CMS\Fluid\Core\Widget\WidgetRequest::class, array('setControllerObjectName'));
$widgetRequest->setWidgetContext($widgetContext);
$this->assertSame($widgetContext, $widgetRequest->getWidgetContext());
}
* @return void
*/
public function setUp() {
- $this->templateVariableContainer = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TemplateVariableContainer', array('exists', 'remove', 'add'));
- $this->viewHelperVariableContainer = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\ViewHelperVariableContainer', array('setView'));
- $this->renderingContext = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Rendering\\RenderingContext', array('getViewHelperVariableContainer', 'getTemplateVariableContainer'));
+ $this->templateVariableContainer = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer::class, array('exists', 'remove', 'add'));
+ $this->viewHelperVariableContainer = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer::class, array('setView'));
+ $this->renderingContext = $this->getMock(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContext::class, array('getViewHelperVariableContainer', 'getTemplateVariableContainer'));
$this->renderingContext->expects($this->any())->method('getViewHelperVariableContainer')->will($this->returnValue($this->viewHelperVariableContainer));
$this->renderingContext->expects($this->any())->method('getTemplateVariableContainer')->will($this->returnValue($this->templateVariableContainer));
- $this->view = $this->getMock('TYPO3\\CMS\\Fluid\\View\\AbstractTemplateView', array('getTemplateSource', 'getLayoutSource', 'getPartialSource', 'canRender', 'getTemplateIdentifier', 'getLayoutIdentifier', 'getPartialIdentifier'));
+ $this->view = $this->getMock(\TYPO3\CMS\Fluid\View\AbstractTemplateView::class, array('getTemplateSource', 'getLayoutSource', 'getPartialSource', 'canRender', 'getTemplateIdentifier', 'getLayoutIdentifier', 'getPartialIdentifier'));
$this->view->setRenderingContext($this->renderingContext);
}
*/
public function setUp() {
$this->singletonInstances = GeneralUtility::getSingletonInstances();
- $this->view = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\StandaloneView', array('testFileExistence', 'buildParserConfiguration'), array(), '', FALSE);
- $this->mockTemplateParser = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser');
- $this->mockParsedTemplate = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsedTemplateInterface');
+ $this->view = $this->getAccessibleMock(\TYPO3\CMS\Fluid\View\StandaloneView::class, array('testFileExistence', 'buildParserConfiguration'), array(), '', FALSE);
+ $this->mockTemplateParser = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class);
+ $this->mockParsedTemplate = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsedTemplateInterface::class);
$this->mockTemplateParser->expects($this->any())->method('parse')->will($this->returnValue($this->mockParsedTemplate));
- $this->mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
- $this->mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
+ $this->mockConfigurationManager = $this->getMock(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::class);
+ $this->mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
$this->mockObjectManager->expects($this->any())->method('get')->will($this->returnCallback(array($this, 'objectManagerCallback')));
- $this->mockRequest = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request');
- $this->mockUriBuilder = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder');
- $this->mockContentObject = $this->getMock('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer');
- $this->mockControllerContext = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ControllerContext');
+ $this->mockRequest = $this->getMock(\TYPO3\CMS\Extbase\Mvc\Web\Request::class);
+ $this->mockUriBuilder = $this->getMock(\TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::class);
+ $this->mockContentObject = $this->getMock(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class);
+ $this->mockControllerContext = $this->getMock(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext::class);
$this->mockControllerContext->expects($this->any())->method('getRequest')->will($this->returnValue($this->mockRequest));
- $this->mockViewHelperVariableContainer = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\ViewHelperVariableContainer');
- $this->mockRenderingContext = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Rendering\\RenderingContext');
+ $this->mockViewHelperVariableContainer = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer::class);
+ $this->mockRenderingContext = $this->getMock(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContext::class);
$this->mockRenderingContext->expects($this->any())->method('getControllerContext')->will($this->returnValue($this->mockControllerContext));
$this->mockRenderingContext->expects($this->any())->method('getViewHelperVariableContainer')->will($this->returnValue($this->mockViewHelperVariableContainer));
$this->view->_set('templateParser', $this->mockTemplateParser);
$this->view->_set('objectManager', $this->mockObjectManager);
$this->view->setRenderingContext($this->mockRenderingContext);
- $this->mockTemplateCompiler = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Compiler\\TemplateCompiler');
+ $this->mockTemplateCompiler = $this->getMock(\TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler::class);
$this->view->_set('templateCompiler', $this->mockTemplateCompiler);
- GeneralUtility::setSingletonInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager', $this->mockObjectManager);
- GeneralUtility::addInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer', $this->mockContentObject);
+ GeneralUtility::setSingletonInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class, $this->mockObjectManager);
+ GeneralUtility::addInstance(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class, $this->mockContentObject);
- $mockCacheManager = $this->getMock('TYPO3\\CMS\\Core\\Cache\\CacheManager', array(), array(), '', FALSE);
- $mockCache = $this->getMock('TYPO3\\CMS\\Core\\Cache\\Frontend\\PhpFrontend', array(), array(), '', FALSE);
+ $mockCacheManager = $this->getMock(\TYPO3\CMS\Core\Cache\CacheManager::class, array(), array(), '', FALSE);
+ $mockCache = $this->getMock(\TYPO3\CMS\Core\Cache\Frontend\PhpFrontend::class, array(), array(), '', FALSE);
$mockCacheManager->expects($this->any())->method('getCache')->will($this->returnValue($mockCache));
- GeneralUtility::setSingletonInstance('TYPO3\\CMS\\Core\\Cache\\CacheManager', $mockCacheManager);
+ GeneralUtility::setSingletonInstance(\TYPO3\CMS\Core\Cache\CacheManager::class, $mockCacheManager);
}
/**
*/
public function objectManagerCallback($className) {
switch ($className) {
- case 'TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface':
+ case \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::class:
return $this->mockConfigurationManager;
- case 'TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser':
+ case \TYPO3\CMS\Fluid\Core\Parser\TemplateParser::class:
return $this->mockTemplateParser;
- case 'TYPO3\\CMS\\Fluid\\Core\\Rendering\\RenderingContext':
+ case \TYPO3\CMS\Fluid\Core\Rendering\RenderingContext::class:
return $this->mockRenderingContext;
- case 'TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request':
+ case \TYPO3\CMS\Extbase\Mvc\Web\Request::class:
return $this->mockRequest;
- case 'TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder':
+ case \TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::class:
return $this->mockUriBuilder;
- case 'TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ControllerContext':
+ case \TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext::class:
return $this->mockControllerContext;
- case 'TYPO3\\CMS\\Fluid\\Core\\Compiler\\TemplateCompiler':
+ case \TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler::class:
return $this->mockTemplateCompiler;
}
throw new \InvalidArgumentException('objectManagerCallback cannot handle class "' . $className . '". Looks like incomplete mocking in the tests.', 1417105493);
* @test
*/
public function constructorSetsSpecifiedContentObject() {
- $mockContentObject = $this->getMock('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer');
+ $mockContentObject = $this->getMock(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class);
$this->mockConfigurationManager->expects($this->once())->method('setContentObject')->with($this->identicalTo($mockContentObject));
new StandaloneView($mockContentObject);
}
*/
public function expandGenericPathPatternWorksWithOldNamingSchemeOfSubPackage() {
$mockControllerContext = $this->setupMockControllerContextForPathResolving('MyPackage', 'ViewHelpers_Widget', 'Paginate', 'html');
- $templateView = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('dummy'), array(), '', FALSE);
+ $templateView = $this->getAccessibleMock(\TYPO3\CMS\Fluid\View\TemplateView::class, array('dummy'), array(), '', FALSE);
$templateView->_set('controllerContext', $mockControllerContext);
$expected = array(ExtensionManagementUtility::extPath('frontend') . 'Resources/Private/Templates/ViewHelpers/Widget/Paginate/@action.html');
$actual = $templateView->_call('expandGenericPathPattern', '@templateRoot/@subpackage/@controller/@action.@format', FALSE, FALSE);
*/
public function expandGenericPathPatternWorksWithNewNamingSchemeOfSubPackage() {
$mockControllerContext = $this->setupMockControllerContextForPathResolving('MyPackage', 'ViewHelpers\\Widget', 'Paginate', 'html');
- $templateView = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('dummy'), array(), '', FALSE);
+ $templateView = $this->getAccessibleMock(\TYPO3\CMS\Fluid\View\TemplateView::class, array('dummy'), array(), '', FALSE);
$templateView->_set('controllerContext', $mockControllerContext);
$expected = array(ExtensionManagementUtility::extPath('frontend') . 'Resources/Private/Templates/ViewHelpers/Widget/Paginate/@action.html');
$actual = $templateView->_call('expandGenericPathPattern', '@templateRoot/@subpackage/@controller/@action.@format', FALSE, FALSE);
*/
protected function setupMockControllerContextForPathResolving($packageKey, $subPackageKey, $controllerName, $format) {
$controllerObjectName = "TYPO3\\$packageKey\\" . ($subPackageKey != $subPackageKey . '\\' ? : '') . 'Controller\\' . $controllerName . 'Controller';
- $mockRequest = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request');
+ $mockRequest = $this->getMock(\TYPO3\CMS\Extbase\Mvc\Web\Request::class);
$mockRequest->expects($this->any())->method('getControllerExtensionKey')->will($this->returnValue('frontend'));
$mockRequest->expects($this->any())->method('getControllerPackageKey')->will($this->returnValue($packageKey));
$mockRequest->expects($this->any())->method('getControllerSubPackageKey')->will($this->returnValue($subPackageKey));
$mockRequest->expects($this->any())->method('getControllerObjectName')->will($this->returnValue($controllerObjectName));
$mockRequest->expects($this->any())->method('getFormat')->will($this->returnValue($format));
- $mockControllerContext = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ControllerContext', array('getRequest'), array(), '', FALSE);
+ $mockControllerContext = $this->getMock(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext::class, array('getRequest'), array(), '', FALSE);
$mockControllerContext->expects($this->any())->method('getRequest')->will($this->returnValue($mockRequest));
return $mockControllerContext;
$mockControllerContext = $this->setupMockControllerContextForPathResolving($package, $subPackage, $controller, $format);
/** @var TemplateView|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface $templateView */
- $templateView = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('dummy'), array(), '', FALSE);
+ $templateView = $this->getAccessibleMock(\TYPO3\CMS\Fluid\View\TemplateView::class, array('dummy'), array(), '', FALSE);
$templateView->setControllerContext($mockControllerContext);
if ($templateRootPath !== NULL) {
$templateView->setTemplateRootPath($templateRootPath);
public function expandGenericPathPatternWorksWithBubblingDisabledAndFormatNotOptional() {
$mockControllerContext = $this->setupMockControllerContextForPathResolving('MyPackage', NULL, 'My', 'html');
- $templateView = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('getTemplateRootPaths'), array(), '', FALSE);
+ $templateView = $this->getAccessibleMock(\TYPO3\CMS\Fluid\View\TemplateView::class, array('getTemplateRootPaths'), array(), '', FALSE);
$templateView->_set('controllerContext', $mockControllerContext);
$templateView->expects($this->any())->method('getTemplateRootPaths')->will($this->returnValue(array('Resources/Private/')));
public function expandGenericPathPatternWorksWithSubpackageAndBubblingDisabledAndFormatNotOptional() {
$mockControllerContext = $this->setupMockControllerContextForPathResolving('MyPackage', 'MySubPackage', 'My', 'html');
- $templateView = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('getTemplateRootPaths'), array(), '', FALSE);
+ $templateView = $this->getAccessibleMock(\TYPO3\CMS\Fluid\View\TemplateView::class, array('getTemplateRootPaths'), array(), '', FALSE);
$templateView->_set('controllerContext', $mockControllerContext);
$templateView->expects($this->any())->method('getTemplateRootPaths')->will($this->returnValue(array('Resources/Private/')));
$actual = $templateView->_call('expandGenericPathPattern', '@templateRoot/Templates/@subpackage/@controller/@action.@format', FALSE, FALSE);
public function expandGenericPathPatternWorksWithSubpackageAndBubblingDisabledAndFormatOptional() {
$mockControllerContext = $this->setupMockControllerContextForPathResolving('MyPackage', 'MySubPackage', 'My', 'html');
- $templateView = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('getTemplateRootPaths'), array(), '', FALSE);
+ $templateView = $this->getAccessibleMock(\TYPO3\CMS\Fluid\View\TemplateView::class, array('getTemplateRootPaths'), array(), '', FALSE);
$templateView->_set('controllerContext', $mockControllerContext);
$templateView->expects($this->any())->method('getTemplateRootPaths')->will($this->returnValue(array('Resources/Private/')));
$actual = $templateView->_call('expandGenericPathPattern', '@templateRoot/Templates/@subpackage/@controller/@action.@format', FALSE, TRUE);
public function expandGenericPathPatternWorksWithSubpackageAndBubblingEnabledAndFormatOptional() {
$mockControllerContext = $this->setupMockControllerContextForPathResolving('MyPackage', 'MySubPackage', 'My', 'html');
- $templateView = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('getTemplateRootPaths'), array(), '', FALSE);
+ $templateView = $this->getAccessibleMock(\TYPO3\CMS\Fluid\View\TemplateView::class, array('getTemplateRootPaths'), array(), '', FALSE);
$templateView->_set('controllerContext', $mockControllerContext);
$templateView->expects($this->any())->method('getTemplateRootPaths')->will($this->returnValue(array('Resources/Private/')));
$actual = $templateView->_call('expandGenericPathPattern', '@templateRoot/Templates/@subpackage/@controller/@action.@format', TRUE, TRUE);
*/
public function getTemplateRootPathsReturnsUserSpecifiedTemplatePaths() {
/** @var TemplateView|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface $templateView */
- $templateView = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('dummy'), array(), '', FALSE);
+ $templateView = $this->getAccessibleMock(\TYPO3\CMS\Fluid\View\TemplateView::class, array('dummy'), array(), '', FALSE);
$templateView->setTemplateRootPath('/foo/bar');
$expected = array('/foo/bar');
$actual = $templateView->_call('getTemplateRootPaths');
*/
public function setTemplateRootPathOverrulesSetTemplateRootPaths() {
/** @var TemplateView|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface $templateView */
- $templateView = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('dummy'), array(), '', FALSE);
+ $templateView = $this->getAccessibleMock(\TYPO3\CMS\Fluid\View\TemplateView::class, array('dummy'), array(), '', FALSE);
$templateView->setTemplateRootPath('/foo/bar');
$templateView->setTemplateRootPaths(array('/overruled/path'));
$expected = array('/overruled/path');
*/
public function getPartialRootPathsReturnsUserSpecifiedPartialPath() {
/** @var TemplateView|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface $templateView */
- $templateView = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('dummy'), array(), '', FALSE);
+ $templateView = $this->getAccessibleMock(\TYPO3\CMS\Fluid\View\TemplateView::class, array('dummy'), array(), '', FALSE);
$templateView->setPartialRootPath('/foo/bar');
$expected = array('/foo/bar');
$actual = $templateView->_call('getPartialRootPaths');
*/
public function getLayoutRootPathsReturnsUserSpecifiedPartialPath() {
/** @var TemplateView|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface $templateView */
- $templateView = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('dummy'), array(), '', FALSE);
+ $templateView = $this->getAccessibleMock(\TYPO3\CMS\Fluid\View\TemplateView::class, array('dummy'), array(), '', FALSE);
$templateView->setLayoutRootPath('/foo/bar');
$expected = array('/foo/bar');
$actual = $templateView->_call('getLayoutRootPaths');
);
/** @var TemplateView|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface $templateView */
- $templateView = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('expandGenericPathPattern', 'resolveFileNamePath'), array(), '', FALSE);
+ $templateView = $this->getAccessibleMock(\TYPO3\CMS\Fluid\View\TemplateView::class, array('expandGenericPathPattern', 'resolveFileNamePath'), array(), '', FALSE);
$templateView->expects($this->once())->method('expandGenericPathPattern')->with('@partialRoot/@subpackage/@partial.@format', TRUE, TRUE)->will($this->returnValue($paths));
$templateView->expects($this->any())->method('resolveFileNamePath')->will($this->onConsecutiveCalls(
$paths[0],
);
/** @var TemplateView|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface $templateView */
- $templateView = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('expandGenericPathPattern', 'resolveFileNamePath'), array(), '', FALSE);
+ $templateView = $this->getAccessibleMock(\TYPO3\CMS\Fluid\View\TemplateView::class, array('expandGenericPathPattern', 'resolveFileNamePath'), array(), '', FALSE);
$templateView->expects($this->once())->method('expandGenericPathPattern')->with('@templateRoot/@subpackage/@controller/@action.@format', FALSE, FALSE)->will($this->returnValue($paths));
$templateView->expects($this->any())->method('resolveFileNamePath')->will($this->onConsecutiveCalls(
$paths[0],
mkdir('vfs://MyTemplates');
\file_put_contents('vfs://MyTemplates/MyCoolAction.html', 'contentsOfMyCoolAction');
- $templateView = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('dummy'), array(), '', FALSE);
+ $templateView = $this->getAccessibleMock(\TYPO3\CMS\Fluid\View\TemplateView::class, array('dummy'), array(), '', FALSE);
$templateView->_set('templatePathAndFilename', 'vfs://MyTemplates/MyCoolAction.html');
$this->assertSame('contentsOfMyCoolAction', $templateView->_call('getTemplateSource'));
public function renderAddsSingleValueToTemplateVariableContainerAndRemovesItAfterRendering() {
$viewHelper = new \TYPO3\CMS\Fluid\ViewHelpers\AliasViewHelper();
- $mockViewHelperNode = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ViewHelperNode', array('evaluateChildNodes'), array(), '', FALSE);
+ $mockViewHelperNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class, array('evaluateChildNodes'), array(), '', FALSE);
$mockViewHelperNode->expects($this->once())->method('evaluateChildNodes')->will($this->returnValue('foo'));
$this->templateVariableContainer->expects($this->at(0))->method('add')->with('someAlias', 'someValue');
public function renderAddsMultipleValuesToTemplateVariableContainerAndRemovesThemAfterRendering() {
$viewHelper = new \TYPO3\CMS\Fluid\ViewHelpers\AliasViewHelper();
- $mockViewHelperNode = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ViewHelperNode', array('evaluateChildNodes'), array(), '', FALSE);
+ $mockViewHelperNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class, array('evaluateChildNodes'), array(), '', FALSE);
$mockViewHelperNode->expects($this->once())->method('evaluateChildNodes')->will($this->returnValue('foo'));
$this->templateVariableContainer->expects($this->at(0))->method('add')->with('someAlias', 'someValue');
public function renderDoesNotTouchTemplateVariableContainerAndReturnsChildNodesIfMapIsEmpty() {
$viewHelper = new \TYPO3\CMS\Fluid\ViewHelpers\AliasViewHelper();
- $mockViewHelperNode = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ViewHelperNode', array('evaluateChildNodes'), array(), '', FALSE);
+ $mockViewHelperNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class, array('evaluateChildNodes'), array(), '', FALSE);
$mockViewHelperNode->expects($this->once())->method('evaluateChildNodes')->will($this->returnValue('foo'));
$this->templateVariableContainer->expects($this->never())->method('add');
public function setUp() {
parent::setUp();
$GLOBALS['BE_USER'] = new \stdClass();
- $this->viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Be\\Security\\IfAuthenticatedViewHelper', array('renderThenChild', 'renderElseChild'));
+ $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Be\Security\IfAuthenticatedViewHelper::class, array('renderThenChild', 'renderElseChild'));
$this->viewHelper->expects($this->any())->method('renderThenChild')->will($this->returnValue('then child'));
$this->viewHelper->expects($this->any())->method('renderElseChild')->will($this->returnValue('else child'));
$this->injectDependenciesIntoViewHelper($this->viewHelper);
'title' => 'OtherRole'
)
);
- $this->viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Be\\Security\\IfHasRoleViewHelper', array('renderThenChild', 'renderElseChild'));
+ $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Be\Security\IfHasRoleViewHelper::class, array('renderThenChild', 'renderElseChild'));
$this->viewHelper->expects($this->any())->method('renderThenChild')->will($this->returnValue('then child'));
$this->viewHelper->expects($this->any())->method('renderElseChild')->will($this->returnValue('else child'));
$this->injectDependenciesIntoViewHelper($this->viewHelper);
public function setUp() {
parent::setUp();
- $this->viewHelper = $this->getMock('TYPO3\CMS\Fluid\ViewHelpers\CaseViewHelper', array('renderChildren'));
+ $this->viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\CaseViewHelper::class, array('renderChildren'));
$this->injectDependenciesIntoViewHelper($this->viewHelper);
$this->viewHelper->initializeArguments();
}
* @expectedException \TYPO3\CMS\Fluid\Core\ViewHelper\Exception
*/
public function renderThrowsExceptionIfSwitchExpressionIsNotSetInViewHelperVariableContainer() {
- $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('exists')->with('TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper', 'switchExpression')->will($this->returnValue(FALSE));
+ $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('exists')->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'switchExpression')->will($this->returnValue(FALSE));
$this->viewHelper->render('foo');
}
* @test
*/
public function renderReturnsChildNodesIfTheSpecifiedValueIsEqualToTheSwitchExpression() {
- $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('exists')->with('TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper', 'switchExpression')->will($this->returnValue(TRUE));
- $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('get')->with('TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper', 'switchExpression')->will($this->returnValue('someValue'));
+ $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('exists')->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'switchExpression')->will($this->returnValue(TRUE));
+ $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('get')->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'switchExpression')->will($this->returnValue('someValue'));
$renderedChildNodes = 'ChildNodes';
$this->viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue($renderedChildNodes));
* @test
*/
public function renderSetsBreakStateInViewHelperVariableContainerIfTheSpecifiedValueIsEqualToTheSwitchExpression() {
- $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('exists')->with('TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper', 'switchExpression')->will($this->returnValue(TRUE));
- $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('get')->with('TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper', 'switchExpression')->will($this->returnValue('someValue'));
+ $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('exists')->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'switchExpression')->will($this->returnValue(TRUE));
+ $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('get')->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'switchExpression')->will($this->returnValue('someValue'));
- $this->viewHelperVariableContainer->expects($this->once())->method('addOrUpdate')->with('TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper', 'break', TRUE);
+ $this->viewHelperVariableContainer->expects($this->once())->method('addOrUpdate')->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'break', TRUE);
$this->viewHelper->render('someValue');
}
$numericValue = 123;
$stringValue = '123';
- $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('exists')->with('TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper', 'switchExpression')->will($this->returnValue(TRUE));
- $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('get')->with('TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper', 'switchExpression')->will($this->returnValue($numericValue));
+ $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('exists')->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'switchExpression')->will($this->returnValue(TRUE));
+ $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('get')->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'switchExpression')->will($this->returnValue($numericValue));
- $this->viewHelperVariableContainer->expects($this->once())->method('addOrUpdate')->with('TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper', 'break', TRUE);
+ $this->viewHelperVariableContainer->expects($this->once())->method('addOrUpdate')->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'break', TRUE);
$this->viewHelper->render($stringValue);
}
* @test
*/
public function renderReturnsAnEmptyStringIfTheSpecifiedValueIsNotEqualToTheSwitchExpression() {
- $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('exists')->with('TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper', 'switchExpression')->will($this->returnValue(TRUE));
- $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('get')->with('TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper', 'switchExpression')->will($this->returnValue('someValue'));
+ $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('exists')->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'switchExpression')->will($this->returnValue(TRUE));
+ $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('get')->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'switchExpression')->will($this->returnValue('someValue'));
$this->assertSame('', $this->viewHelper->render('someOtherValue'));
}
$this->viewHelperVariableContainer->expects(
$this->atLeastOnce())
->method('exists')
- ->with('TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper', 'switchExpression')
+ ->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'switchExpression')
->will($this->returnValue(TRUE)
);
$this->viewHelperVariableContainer->expects(
$this->atLeastOnce())->method('get')
- ->with('TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper', 'switchExpression')
+ ->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'switchExpression')
->will($this->returnValue(NULL)
);
$this->viewHelperVariableContainer->expects(
$this->atLeastOnce())
->method('exists')
- ->with('TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper', 'switchExpression')
+ ->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'switchExpression')
->will($this->returnValue(TRUE)
);
$this->viewHelperVariableContainer->expects($this->never())->method('get');
$this->viewHelperVariableContainer->expects(
$this->atLeastOnce())
->method('exists')
- ->with('TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper', 'switchExpression')
+ ->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'switchExpression')
->will($this->returnValue(TRUE)
);
$this->viewHelperVariableContainer->expects(
$this->atLeastOnce())->method('get')
- ->with('TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper', 'switchExpression')
+ ->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'switchExpression')
->will($this->returnValue('someValue')
);
public function setUp() {
parent::setUp();
- $this->viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\CountViewHelper', array('renderChildren'));
+ $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\CountViewHelper::class, array('renderChildren'));
$this->injectDependenciesIntoViewHelper($this->viewHelper);
$this->viewHelper->initializeArguments();
}
public function setUp() {
parent::setUp();
- $this->viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\CycleViewHelper', array('renderChildren'));
+ $this->viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\CycleViewHelper::class, array('renderChildren'));
$this->injectDependenciesIntoViewHelper($this->viewHelper);
$this->viewHelper->initializeArguments();
}
* @test
*/
public function renderRendersChildren() {
- $viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\ElseViewHelper', array('renderChildren'));
+ $viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\ElseViewHelper::class, array('renderChildren'));
$viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue('foo'));
$actualResult = $viewHelper->render();
*/
public function setUp() {
/** @var \TYPO3\CMS\Core\Messaging\FlashMessageQueue|\PHPUnit_Framework_MockObject_MockObject $mockFlashMessagingQueue */
- $mockFlashMessagingQueue = $this->getMock('TYPO3\\CMS\\Core\\Messaging\\FlashMessageQueue', array('getAllMessagesAndFlush'), array('foo'));
+ $mockFlashMessagingQueue = $this->getMock(\TYPO3\CMS\Core\Messaging\FlashMessageQueue::class, array('getAllMessagesAndFlush'), array('foo'));
$mockFlashMessagingQueue->expects($this->once())->method('getAllMessagesAndFlush')->will($this->returnValue(array()));
- $mockControllerContext = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ControllerContext', array(), array(), '', FALSE);
+ $mockControllerContext = $this->getMock(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext::class, array(), array(), '', FALSE);
$mockControllerContext->expects($this->any())->method('getFlashMessageQueue')->will($this->returnValue($mockFlashMessagingQueue));
- $this->mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder');
- $this->viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\FlashMessagesViewHelper', array('dummy'));
+ $this->mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class);
+ $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\FlashMessagesViewHelper::class, array('dummy'));
$this->viewHelper->_set('controllerContext', $mockControllerContext);
$this->viewHelper->_set('tag', $this->mockTagBuilder);
$this->viewHelper->initialize();
* @test
*/
public function ifAnAttributeValueIsAnObjectMaintainedByThePersistenceManagerItIsConvertedToAUID() {
- $mockPersistenceManager = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\PersistenceManagerInterface');
+ $mockPersistenceManager = $this->getMock(\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::class);
$mockPersistenceManager->expects($this->any())->method('getIdentifierByObject')->will($this->returnValue('6f487e40-4483-11de-8a39-0800200c9a66'));
$className = 'Object' . uniqid();
$object = $this->getMock($fullClassName);
$object->expects($this->any())->method('FLOW3_Persistence_isNew')->will($this->returnValue(FALSE));
- $formViewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormFieldViewHelper', array('dummy'), array(), '', FALSE);
+ $formViewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper::class, array('dummy'), array(), '', FALSE);
$this->injectDependenciesIntoViewHelper($formViewHelper);
$formViewHelper->_set('persistenceManager', $mockPersistenceManager);
* @test
*/
public function getNameBuildsNameFromFieldNamePrefixFormObjectNameAndPropertyIfInObjectAccessorMode() {
- $formViewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormFieldViewHelper', array('isObjectAccessorMode'), array(), '', FALSE);
+ $formViewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper::class, array('isObjectAccessorMode'), array(), '', FALSE);
$this->injectDependenciesIntoViewHelper($formViewHelper);
$formViewHelper->expects($this->any())->method('isObjectAccessorMode')->will($this->returnValue(TRUE));
- $this->viewHelperVariableContainer->expects($this->at(0))->method('get')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObjectName')->will($this->returnValue('myObjectName'));
- $this->viewHelperVariableContainer->expects($this->at(1))->method('exists')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'fieldNamePrefix')->will($this->returnValue(TRUE));
- $this->viewHelperVariableContainer->expects($this->at(2))->method('get')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'fieldNamePrefix')->will($this->returnValue('formPrefix'));
+ $this->viewHelperVariableContainer->expects($this->at(0))->method('get')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObjectName')->will($this->returnValue('myObjectName'));
+ $this->viewHelperVariableContainer->expects($this->at(1))->method('exists')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'fieldNamePrefix')->will($this->returnValue(TRUE));
+ $this->viewHelperVariableContainer->expects($this->at(2))->method('get')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'fieldNamePrefix')->will($this->returnValue('formPrefix'));
$arguments = array('name' => 'fieldName', 'value' => 'fieldValue', 'property' => 'bla');
$formViewHelper->_set('arguments', $arguments);
* @test
*/
public function getNameBuildsNameFromFieldNamePrefixFormObjectNameAndHierarchicalPropertyIfInObjectAccessorMode() {
- $formViewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormFieldViewHelper', array('isObjectAccessorMode'), array(), '', FALSE);
+ $formViewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper::class, array('isObjectAccessorMode'), array(), '', FALSE);
$this->injectDependenciesIntoViewHelper($formViewHelper);
$formViewHelper->expects($this->any())->method('isObjectAccessorMode')->will($this->returnValue(TRUE));
- $this->viewHelperVariableContainer->expects($this->at(0))->method('get')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObjectName')->will($this->returnValue('myObjectName'));
- $this->viewHelperVariableContainer->expects($this->at(1))->method('exists')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'fieldNamePrefix')->will($this->returnValue(TRUE));
- $this->viewHelperVariableContainer->expects($this->at(2))->method('get')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'fieldNamePrefix')->will($this->returnValue('formPrefix'));
+ $this->viewHelperVariableContainer->expects($this->at(0))->method('get')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObjectName')->will($this->returnValue('myObjectName'));
+ $this->viewHelperVariableContainer->expects($this->at(1))->method('exists')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'fieldNamePrefix')->will($this->returnValue(TRUE));
+ $this->viewHelperVariableContainer->expects($this->at(2))->method('get')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'fieldNamePrefix')->will($this->returnValue('formPrefix'));
$arguments = array('name' => 'fieldName', 'value' => 'fieldValue', 'property' => 'bla.blubb');
$formViewHelper->_set('arguments', $arguments);
* @test
*/
public function getNameBuildsNameFromFieldNamePrefixAndPropertyIfInObjectAccessorModeAndNoFormObjectNameIsSpecified() {
- $formViewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormFieldViewHelper', array('isObjectAccessorMode'), array(), '', FALSE);
+ $formViewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper::class, array('isObjectAccessorMode'), array(), '', FALSE);
$this->injectDependenciesIntoViewHelper($formViewHelper);
$formViewHelper->expects($this->any())->method('isObjectAccessorMode')->will($this->returnValue(TRUE));
- $this->viewHelperVariableContainer->expects($this->at(0))->method('get')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObjectName')->will($this->returnValue(NULL));
- $this->viewHelperVariableContainer->expects($this->at(1))->method('exists')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'fieldNamePrefix')->will($this->returnValue(TRUE));
- $this->viewHelperVariableContainer->expects($this->at(2))->method('get')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'fieldNamePrefix')->will($this->returnValue('formPrefix'));
+ $this->viewHelperVariableContainer->expects($this->at(0))->method('get')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObjectName')->will($this->returnValue(NULL));
+ $this->viewHelperVariableContainer->expects($this->at(1))->method('exists')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'fieldNamePrefix')->will($this->returnValue(TRUE));
+ $this->viewHelperVariableContainer->expects($this->at(2))->method('get')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'fieldNamePrefix')->will($this->returnValue('formPrefix'));
$arguments = array('name' => 'fieldName', 'value' => 'fieldValue', 'property' => 'bla');
$formViewHelper->_set('arguments', $arguments);
* @test
*/
public function getNameBuildsNameFromFieldNamePrefixAndFieldNameIfNotInObjectAccessorMode() {
- $formViewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormFieldViewHelper', array('isObjectAccessorMode'), array(), '', FALSE);
+ $formViewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper::class, array('isObjectAccessorMode'), array(), '', FALSE);
$this->injectDependenciesIntoViewHelper($formViewHelper);
$formViewHelper->expects($this->any())->method('isObjectAccessorMode')->will($this->returnValue(FALSE));
- $this->viewHelperVariableContainer->expects($this->at(0))->method('exists')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'fieldNamePrefix')->will($this->returnValue(TRUE));
- $this->viewHelperVariableContainer->expects($this->at(1))->method('get')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'fieldNamePrefix')->will($this->returnValue('formPrefix'));
+ $this->viewHelperVariableContainer->expects($this->at(0))->method('exists')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'fieldNamePrefix')->will($this->returnValue(TRUE));
+ $this->viewHelperVariableContainer->expects($this->at(1))->method('get')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'fieldNamePrefix')->will($this->returnValue('formPrefix'));
$arguments = array('name' => 'fieldName', 'value' => 'fieldValue', 'property' => 'bla');
$formViewHelper->_set('arguments', $arguments);
* @test
*/
public function getValueBuildsValueFromPropertyAndFormObjectIfInObjectAccessorMode() {
- $formViewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormFieldViewHelper', array('isObjectAccessorMode', 'addAdditionalIdentityPropertiesIfNeeded'), array(), '', FALSE);
+ $formViewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper::class, array('isObjectAccessorMode', 'addAdditionalIdentityPropertiesIfNeeded'), array(), '', FALSE);
$this->injectDependenciesIntoViewHelper($formViewHelper);
$className = 'test_' . uniqid();
$formViewHelper->expects($this->any())->method('isObjectAccessorMode')->will($this->returnValue(TRUE));
$formViewHelper->expects($this->once())->method('addAdditionalIdentityPropertiesIfNeeded');
- $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('get')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObject')->will($this->returnValue($mockObject));
- $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('exists')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObject')->will($this->returnValue(TRUE));
+ $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('get')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObject')->will($this->returnValue($mockObject));
+ $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('exists')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObject')->will($this->returnValue(TRUE));
$arguments = array('name' => NULL, 'value' => NULL, 'property' => 'value.something');
$formViewHelper->_set('arguments', $arguments);
* @test
*/
public function getValueReturnsNullIfNotInObjectAccessorModeAndValueArgumentIsNoSet() {
- $formViewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormFieldViewHelper', array('isObjectAccessorMode'), array(), '', FALSE);
+ $formViewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper::class, array('isObjectAccessorMode'), array(), '', FALSE);
$this->injectDependenciesIntoViewHelper($formViewHelper);
$formViewHelper->expects($this->any())->method('isObjectAccessorMode')->will($this->returnValue(FALSE));
* @test
*/
public function getValueReturnsValueArgumentIfSpecified() {
- $formViewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormFieldViewHelper', array('isObjectAccessorMode'), array(), '', FALSE);
+ $formViewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper::class, array('isObjectAccessorMode'), array(), '', FALSE);
$formViewHelper->expects($this->any())->method('isObjectAccessorMode')->will($this->returnValue(FALSE));
$this->injectDependenciesIntoViewHelper($formViewHelper);
public function getValueConvertsObjectsToIdentifiersByDefault() {
$mockObject = $this->getMock('stdClass');
- $mockPersistenceManager = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\PersistenceManagerInterface');
+ $mockPersistenceManager = $this->getMock(\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::class);
$mockPersistenceManager->expects($this->atLeastOnce())->method('getIdentifierByObject')->with($mockObject)->will($this->returnValue('6f487e40-4483-11de-8a39-0800200c9a66'));
- $formViewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormFieldViewHelper', array('isObjectAccessorMode'), array(), '', FALSE);
+ $formViewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper::class, array('isObjectAccessorMode'), array(), '', FALSE);
$formViewHelper->expects($this->any())->method('isObjectAccessorMode')->will($this->returnValue(FALSE));
$this->injectDependenciesIntoViewHelper($formViewHelper);
$formViewHelper->_set('persistenceManager', $mockPersistenceManager);
public function getValueDoesNotConvertObjectsIfConvertObjectsIsFalse() {
$mockObject = $this->getMock('stdClass');
- $mockPersistenceManager = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\PersistenceManagerInterface');
+ $mockPersistenceManager = $this->getMock(\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::class);
$mockPersistenceManager->expects($this->any())->method('getIdentifierByObject')->will($this->returnValue('6f487e40-4483-11de-8a39-0800200c9a66'));
- $formViewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormFieldViewHelper', array('isObjectAccessorMode'), array(), '', FALSE);
+ $formViewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper::class, array('isObjectAccessorMode'), array(), '', FALSE);
$formViewHelper->expects($this->any())->method('isObjectAccessorMode')->will($this->returnValue(FALSE));
$this->injectDependenciesIntoViewHelper($formViewHelper);
$formViewHelper->_set('persistenceManager', $mockPersistenceManager);
* @test
*/
public function isObjectAccessorModeReturnsTrueIfPropertyIsSetAndFormObjectIsGiven() {
- $formViewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormFieldViewHelper', array('dummy'), array(), '', FALSE);
+ $formViewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper::class, array('dummy'), array(), '', FALSE);
$this->injectDependenciesIntoViewHelper($formViewHelper);
- $this->viewHelperVariableContainer->expects($this->once())->method('exists')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObjectName')->will($this->returnValue(TRUE));
+ $this->viewHelperVariableContainer->expects($this->once())->method('exists')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObjectName')->will($this->returnValue(TRUE));
$formViewHelper->_set('arguments', array('name' => NULL, 'value' => NULL, 'property' => 'bla'));
$this->assertTrue($formViewHelper->_call('isObjectAccessorMode'));
* @test
*/
public function addAdditionalIdentityPropertiesIfNeededDoesNotCreateAnythingIfPropertyIsWithoutDot() {
- $formFieldViewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormFieldViewHelper', array('renderHiddenIdentityField'), array(), '', FALSE);
+ $formFieldViewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper::class, array('renderHiddenIdentityField'), array(), '', FALSE);
$this->injectDependenciesIntoViewHelper($formFieldViewHelper);
$arguments = array('property' => 'simple');
$formFieldViewHelper->expects($this->any())->method('renderHiddenIdentityField')->will($this->throwException(new \Exception('Should not be executed!!!')));
$objectName = 'myObject';
$expectedProperty = 'myObject[value]';
- $formFieldViewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormFieldViewHelper', array('renderHiddenIdentityField'), array(), '', FALSE);
+ $formFieldViewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper::class, array('renderHiddenIdentityField'), array(), '', FALSE);
$this->injectDependenciesIntoViewHelper($formFieldViewHelper);
$arguments = array('property' => $property);
$formFieldViewHelper->_set('arguments', $arguments);
- $this->viewHelperVariableContainer->expects($this->at(0))->method('exists')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObject')->will($this->returnValue(TRUE));
- $this->viewHelperVariableContainer->expects($this->at(1))->method('get')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObject')->will($this->returnValue($mockFormObject));
- $this->viewHelperVariableContainer->expects($this->at(2))->method('get')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObjectName')->will($this->returnValue($objectName));
+ $this->viewHelperVariableContainer->expects($this->at(0))->method('exists')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObject')->will($this->returnValue(TRUE));
+ $this->viewHelperVariableContainer->expects($this->at(1))->method('get')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObject')->will($this->returnValue($mockFormObject));
+ $this->viewHelperVariableContainer->expects($this->at(2))->method('get')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObjectName')->will($this->returnValue($objectName));
$formFieldViewHelper->expects($this->once())->method('renderHiddenIdentityField')->with($mockFormObject, $expectedProperty);
$expectedProperty1 = 'myObject[value]';
$expectedProperty2 = 'myObject[value][value]';
- $formFieldViewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormFieldViewHelper', array('renderHiddenIdentityField'), array(), '', FALSE);
+ $formFieldViewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper::class, array('renderHiddenIdentityField'), array(), '', FALSE);
$this->injectDependenciesIntoViewHelper($formFieldViewHelper);
$arguments = array('property' => $property);
$formFieldViewHelper->_set('arguments', $arguments);
- $this->viewHelperVariableContainer->expects($this->at(0))->method('exists')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObject')->will($this->returnValue(TRUE));
- $this->viewHelperVariableContainer->expects($this->at(1))->method('get')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObject')->will($this->returnValue($mockFormObject));
- $this->viewHelperVariableContainer->expects($this->at(2))->method('get')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObjectName')->will($this->returnValue($objectName));
+ $this->viewHelperVariableContainer->expects($this->at(0))->method('exists')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObject')->will($this->returnValue(TRUE));
+ $this->viewHelperVariableContainer->expects($this->at(1))->method('get')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObject')->will($this->returnValue($mockFormObject));
+ $this->viewHelperVariableContainer->expects($this->at(2))->method('get')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObjectName')->will($this->returnValue($objectName));
$formFieldViewHelper->expects($this->at(0))->method('renderHiddenIdentityField')->with($mockFormObject, $expectedProperty1);
$formFieldViewHelper->expects($this->at(1))->method('renderHiddenIdentityField')->with($mockFormObject, $expectedProperty2);
* @test
*/
public function renderHiddenFieldForEmptyValueRendersHiddenFieldIfItHasNotBeenRenderedBefore() {
- $formViewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormFieldViewHelper', array('getName'), array(), '', FALSE);
+ $formViewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper::class, array('getName'), array(), '', FALSE);
$this->injectDependenciesIntoViewHelper($formViewHelper);
$formViewHelper->expects($this->any())->method('getName')->will($this->returnValue('SomeFieldName'));
- $this->viewHelperVariableContainer->expects($this->at(0))->method('exists')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'renderedHiddenFields')->will($this->returnValue(TRUE));
- $this->viewHelperVariableContainer->expects($this->at(1))->method('get')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'renderedHiddenFields')->will($this->returnValue(array()));
+ $this->viewHelperVariableContainer->expects($this->at(0))->method('exists')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'renderedHiddenFields')->will($this->returnValue(TRUE));
+ $this->viewHelperVariableContainer->expects($this->at(1))->method('get')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'renderedHiddenFields')->will($this->returnValue(array()));
$expected = '<input type="hidden" name="SomeFieldName" value="" />';
$actual = $formViewHelper->_call('renderHiddenFieldForEmptyValue');
$this->assertEquals($expected, $actual);
* @test
*/
public function renderHiddenFieldForEmptyValueAddsHiddenFieldNameToVariableContainerIfItHasBeenRendered() {
- $formViewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormFieldViewHelper', array('getName'), array(), '', FALSE);
+ $formViewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper::class, array('getName'), array(), '', FALSE);
$this->injectDependenciesIntoViewHelper($formViewHelper);
$formViewHelper->expects($this->any())->method('getName')->will($this->returnValue('NewFieldName'));
- $this->viewHelperVariableContainer->expects($this->at(0))->method('exists')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'renderedHiddenFields')->will($this->returnValue(TRUE));
- $this->viewHelperVariableContainer->expects($this->at(1))->method('get')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'renderedHiddenFields')->will($this->returnValue(array('OldFieldName')));
- $this->viewHelperVariableContainer->expects($this->at(2))->method('addOrUpdate')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'renderedHiddenFields', array('OldFieldName', 'NewFieldName'));
+ $this->viewHelperVariableContainer->expects($this->at(0))->method('exists')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'renderedHiddenFields')->will($this->returnValue(TRUE));
+ $this->viewHelperVariableContainer->expects($this->at(1))->method('get')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'renderedHiddenFields')->will($this->returnValue(array('OldFieldName')));
+ $this->viewHelperVariableContainer->expects($this->at(2))->method('addOrUpdate')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'renderedHiddenFields', array('OldFieldName', 'NewFieldName'));
$formViewHelper->_call('renderHiddenFieldForEmptyValue');
}
* @test
*/
public function renderHiddenFieldForEmptyValueDoesNotRenderHiddenFieldIfItHasBeenRenderedBefore() {
- $formViewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormFieldViewHelper', array('getName'), array(), '', FALSE);
+ $formViewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper::class, array('getName'), array(), '', FALSE);
$this->injectDependenciesIntoViewHelper($formViewHelper);
$formViewHelper->expects($this->any())->method('getName')->will($this->returnValue('SomeFieldName'));
- $this->viewHelperVariableContainer->expects($this->at(0))->method('exists')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'renderedHiddenFields')->will($this->returnValue(TRUE));
- $this->viewHelperVariableContainer->expects($this->at(1))->method('get')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'renderedHiddenFields')->will($this->returnValue(array('SomeFieldName')));
+ $this->viewHelperVariableContainer->expects($this->at(0))->method('exists')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'renderedHiddenFields')->will($this->returnValue(TRUE));
+ $this->viewHelperVariableContainer->expects($this->at(1))->method('get')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'renderedHiddenFields')->will($this->returnValue(array('SomeFieldName')));
$this->viewHelperVariableContainer->expects($this->never())->method('addOrUpdate');
$expected = '';
$actual = $formViewHelper->_call('renderHiddenFieldForEmptyValue');
* @test
*/
public function renderHiddenFieldForEmptyValueRemovesEmptySquareBracketsFromHiddenFieldName() {
- $formViewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormFieldViewHelper', array('getName'), array(), '', FALSE);
+ $formViewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper::class, array('getName'), array(), '', FALSE);
$this->injectDependenciesIntoViewHelper($formViewHelper);
$formViewHelper->expects($this->any())->method('getName')->will($this->returnValue('SomeFieldName[WithBrackets][]'));
- $this->viewHelperVariableContainer->expects($this->at(0))->method('exists')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'renderedHiddenFields')->will($this->returnValue(TRUE));
- $this->viewHelperVariableContainer->expects($this->at(1))->method('get')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'renderedHiddenFields')->will($this->returnValue(array()));
- $this->viewHelperVariableContainer->expects($this->at(2))->method('addOrUpdate')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'renderedHiddenFields', array('SomeFieldName[WithBrackets]'));
+ $this->viewHelperVariableContainer->expects($this->at(0))->method('exists')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'renderedHiddenFields')->will($this->returnValue(TRUE));
+ $this->viewHelperVariableContainer->expects($this->at(1))->method('get')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'renderedHiddenFields')->will($this->returnValue(array()));
+ $this->viewHelperVariableContainer->expects($this->at(2))->method('addOrUpdate')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'renderedHiddenFields', array('SomeFieldName[WithBrackets]'));
$expected = '<input type="hidden" name="SomeFieldName[WithBrackets]" value="" />';
$actual = $formViewHelper->_call('renderHiddenFieldForEmptyValue');
$this->assertEquals($expected, $actual);
* @test
*/
public function renderHiddenFieldForEmptyValueDoesNotRemoveNonEmptySquareBracketsFromHiddenFieldName() {
- $formViewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormFieldViewHelper', array('getName'), array(), '', FALSE);
+ $formViewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper::class, array('getName'), array(), '', FALSE);
$this->injectDependenciesIntoViewHelper($formViewHelper);
$formViewHelper->expects($this->any())->method('getName')->will($this->returnValue('SomeFieldName[WithBrackets][foo]'));
- $this->viewHelperVariableContainer->expects($this->at(0))->method('exists')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'renderedHiddenFields')->will($this->returnValue(TRUE));
- $this->viewHelperVariableContainer->expects($this->at(1))->method('get')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'renderedHiddenFields')->will($this->returnValue(array()));
- $this->viewHelperVariableContainer->expects($this->at(2))->method('addOrUpdate')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'renderedHiddenFields', array('SomeFieldName[WithBrackets][foo]'));
+ $this->viewHelperVariableContainer->expects($this->at(0))->method('exists')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'renderedHiddenFields')->will($this->returnValue(TRUE));
+ $this->viewHelperVariableContainer->expects($this->at(1))->method('get')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'renderedHiddenFields')->will($this->returnValue(array()));
+ $this->viewHelperVariableContainer->expects($this->at(2))->method('addOrUpdate')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'renderedHiddenFields', array('SomeFieldName[WithBrackets][foo]'));
$expected = '<input type="hidden" name="SomeFieldName[WithBrackets][foo]" value="" />';
$actual = $formViewHelper->_call('renderHiddenFieldForEmptyValue');
$this->assertEquals($expected, $actual);
public function renderHiddenIdentityFieldReturnsAHiddenInputFieldContainingTheObjectsUID() {
$className = 'Object' . uniqid();
$fullClassName = '\\TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\' . $className;
- eval('namespace TYPO3\\CMS\\Fluid\\ViewHelpers\\Form; class ' . $className . ' extends \\TYPO3\\CMS\\Extbase\\DomainObject\\AbstractEntity {
+ eval('namespace TYPO3\\CMS\\Fluid\\ViewHelpers\\Form; class ' . $className . ' extends \\' . \TYPO3\CMS\Extbase\DomainObject\AbstractEntity::class . ' {
}');
$object = $this->getAccessibleMock($fullClassName, array('dummy'));
$object->_set('uid', 123);
$expectedResult = chr(10) . '<input type="hidden" name="prefix[theName][__identity]" value="123" />' . chr(10);
- $viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', array('prefixFieldName', 'registerFieldNameForFormTokenGeneration'), array(), '', FALSE);
+ $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, array('prefixFieldName', 'registerFieldNameForFormTokenGeneration'), array(), '', FALSE);
$viewHelper->expects($this->any())->method('prefixFieldName')->with('theName')->will($this->returnValue('prefix[theName]'));
$actualResult = $viewHelper->_call('renderHiddenIdentityField', $object, 'theName');
$this->assertSame($expectedResult, $actualResult);
$object->_set('uid', 123);
$object = clone $object;
$expectedResult = chr(10) . '<input type="hidden" name="prefix[theName][__identity]" value="123" />' . chr(10);
- $viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', array('prefixFieldName', 'registerFieldNameForFormTokenGeneration'), array(), '', FALSE);
+ $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, array('prefixFieldName', 'registerFieldNameForFormTokenGeneration'), array(), '', FALSE);
$viewHelper->expects($this->any())->method('prefixFieldName')->with('theName')->will($this->returnValue('prefix[theName]'));
$actualResult = $viewHelper->_call('renderHiddenIdentityField', $object, 'theName');
$this->assertSame($expectedResult, $actualResult);
* @test
*/
public function prefixFieldNameReturnsEmptyStringIfGivenFieldNameIsNULL() {
- $viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormViewHelper', array('dummy'), array(), '', FALSE);
+ $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormViewHelper::class, array('dummy'), array(), '', FALSE);
$this->injectDependenciesIntoViewHelper($viewHelper);
$this->assertSame('', $viewHelper->_call('prefixFieldName', NULL));
}
* @test
*/
public function prefixFieldNameReturnsEmptyStringIfGivenFieldNameIsEmpty() {
- $viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormViewHelper', array('dummy'), array(), '', FALSE);
+ $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormViewHelper::class, array('dummy'), array(), '', FALSE);
$this->injectDependenciesIntoViewHelper($viewHelper);
$this->assertSame('', $viewHelper->_call('prefixFieldName', ''));
}
* @test
*/
public function prefixFieldNameReturnsGivenFieldNameIfFieldNamePrefixIsEmpty() {
- $viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormViewHelper', array('dummy'), array(), '', FALSE);
+ $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormViewHelper::class, array('dummy'), array(), '', FALSE);
$this->injectDependenciesIntoViewHelper($viewHelper);
- $this->viewHelperVariableContainer->expects($this->any())->method('exists')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'fieldNamePrefix')->will($this->returnValue(TRUE));
- $this->viewHelperVariableContainer->expects($this->once())->method('get')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'fieldNamePrefix')->will($this->returnValue(''));
+ $this->viewHelperVariableContainer->expects($this->any())->method('exists')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'fieldNamePrefix')->will($this->returnValue(TRUE));
+ $this->viewHelperVariableContainer->expects($this->once())->method('get')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'fieldNamePrefix')->will($this->returnValue(''));
$this->assertSame('someFieldName', $viewHelper->_call('prefixFieldName', 'someFieldName'));
}
* @test
*/
public function prefixFieldNamePrefixesGivenFieldNameWithFieldNamePrefix() {
- $viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormViewHelper', array('dummy'), array(), '', FALSE);
+ $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormViewHelper::class, array('dummy'), array(), '', FALSE);
$this->injectDependenciesIntoViewHelper($viewHelper);
- $this->viewHelperVariableContainer->expects($this->any())->method('exists')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'fieldNamePrefix')->will($this->returnValue(TRUE));
- $this->viewHelperVariableContainer->expects($this->once())->method('get')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'fieldNamePrefix')->will($this->returnValue('somePrefix'));
+ $this->viewHelperVariableContainer->expects($this->any())->method('exists')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'fieldNamePrefix')->will($this->returnValue(TRUE));
+ $this->viewHelperVariableContainer->expects($this->once())->method('get')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'fieldNamePrefix')->will($this->returnValue('somePrefix'));
$this->assertSame('somePrefix[someFieldName]', $viewHelper->_call('prefixFieldName', 'someFieldName'));
}
* @test
*/
public function prefixFieldNamePreservesSquareBracketsOfFieldName() {
- $viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormViewHelper', array('dummy'), array(), '', FALSE);
+ $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormViewHelper::class, array('dummy'), array(), '', FALSE);
$this->injectDependenciesIntoViewHelper($viewHelper);
- $this->viewHelperVariableContainer->expects($this->any())->method('exists')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'fieldNamePrefix')->will($this->returnValue(TRUE));
- $this->viewHelperVariableContainer->expects($this->once())->method('get')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'fieldNamePrefix')->will($this->returnValue('somePrefix[foo]'));
+ $this->viewHelperVariableContainer->expects($this->any())->method('exists')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'fieldNamePrefix')->will($this->returnValue(TRUE));
+ $this->viewHelperVariableContainer->expects($this->once())->method('get')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'fieldNamePrefix')->will($this->returnValue('somePrefix[foo]'));
$this->assertSame('somePrefix[foo][someFieldName][bar]', $viewHelper->_call('prefixFieldName', 'someFieldName[bar]'));
}
}
public function setUp() {
parent::setUp();
- $this->viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\ButtonViewHelper', array('renderChildren'));
+ $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\ButtonViewHelper::class, array('renderChildren'));
$this->arguments['name'] = '';
$this->injectDependenciesIntoViewHelper($this->viewHelper);
$this->viewHelper->initializeArguments();
* @test
*/
public function renderCorrectlySetsTagNameAndDefaultAttributes() {
- $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('setTagName', 'addAttribute', 'setContent'));
+ $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('setTagName', 'addAttribute', 'setContent'));
$mockTagBuilder->expects($this->once())->method('setTagName')->with('button');
$mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('type', 'submit');
$mockTagBuilder->expects($this->at(2))->method('addAttribute')->with('name', '');
public function setUp() {
parent::setUp();
- $this->viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\CheckboxViewHelper', array('setErrorClassAttribute', 'getName', 'getValue', 'isObjectAccessorMode', 'getPropertyValue', 'registerFieldNameForFormTokenGeneration'));
+ $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\CheckboxViewHelper::class, array('setErrorClassAttribute', 'getName', 'getValue', 'isObjectAccessorMode', 'getPropertyValue', 'registerFieldNameForFormTokenGeneration'));
$this->arguments['property'] = '';
$this->injectDependenciesIntoViewHelper($this->viewHelper);
$this->viewHelper->initializeArguments();
* @test
*/
public function renderCorrectlySetsTagNameAndDefaultAttributes() {
- $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('setTagName', 'addAttribute'));
+ $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('setTagName', 'addAttribute'));
$mockTagBuilder->expects($this->once())->method('setTagName')->with('input');
$mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('type', 'checkbox');
$mockTagBuilder->expects($this->at(2))->method('addAttribute')->with('name', 'foo');
* @test
*/
public function renderSetsCheckedAttributeIfSpecified() {
- $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('setTagName', 'addAttribute'));
+ $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('setTagName', 'addAttribute'));
$mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('type', 'checkbox');
$mockTagBuilder->expects($this->at(2))->method('addAttribute')->with('name', 'foo');
$mockTagBuilder->expects($this->at(3))->method('addAttribute')->with('value', 'bar');
* @test
*/
public function renderIgnoresValueOfBoundPropertyIfCheckedIsSet() {
- $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('setTagName', 'addAttribute'));
+ $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('setTagName', 'addAttribute'));
$mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('type', 'checkbox');
$mockTagBuilder->expects($this->at(2))->method('addAttribute')->with('name', 'foo');
$mockTagBuilder->expects($this->at(3))->method('addAttribute')->with('value', 'bar');
* @test
*/
public function renderCorrectlySetsCheckedAttributeIfCheckboxIsBoundToAPropertyOfTypeBoolean() {
- $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('setTagName', 'addAttribute'));
+ $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('setTagName', 'addAttribute'));
$mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('type', 'checkbox');
$mockTagBuilder->expects($this->at(2))->method('addAttribute')->with('name', 'foo');
$mockTagBuilder->expects($this->at(3))->method('addAttribute')->with('value', 'bar');
* @test
*/
public function renderAppendsSquareBracketsToNameAttributeIfBoundToAPropertyOfTypeArray() {
- $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('setTagName', 'addAttribute'));
+ $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('setTagName', 'addAttribute'));
$mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('type', 'checkbox');
$mockTagBuilder->expects($this->at(2))->method('addAttribute')->with('name', 'foo[]');
$this->viewHelper->expects($this->once())->method('registerFieldNameForFormTokenGeneration')->with('foo[]');
* @test
*/
public function renderCorrectlySetsCheckedAttributeIfCheckboxIsBoundToAPropertyOfTypeArray() {
- $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('setTagName', 'addAttribute'));
+ $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('setTagName', 'addAttribute'));
$mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('type', 'checkbox');
$mockTagBuilder->expects($this->at(2))->method('addAttribute')->with('name', 'foo[]');
$mockTagBuilder->expects($this->at(3))->method('addAttribute')->with('value', 'bar');
* @test
*/
public function renderCorrectlySetsCheckedAttributeIfCheckboxIsBoundToAPropertyOfTypeArrayObject() {
- $mockTagBuilder = $this->getMock('TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder', array('setTagName', 'addAttribute'));
+ $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('setTagName', 'addAttribute'));
$mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('type', 'checkbox');
$mockTagBuilder->expects($this->at(2))->method('addAttribute')->with('name', 'foo[]');
$mockTagBuilder->expects($this->at(3))->method('addAttribute')->with('value', 'bar');
* @test
*/
public function renderSetsCheckedAttributeIfBoundPropertyIsNotNull() {
- $mockTagBuilder = $this->getMock('TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder', array('setTagName', 'addAttribute'));
+ $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('setTagName', 'addAttribute'));
$mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('type', 'checkbox');
$mockTagBuilder->expects($this->at(2))->method('addAttribute')->with('name', 'foo');
$mockTagBuilder->expects($this->at(3))->method('addAttribute')->with('value', 'bar');
*/
public function setUp() {
parent::setUp();
- $this->mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
+ $this->mockConfigurationManager = $this->getMock(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::class);
}
/**
public function setUp() {
parent::setUp();
- $this->viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\HiddenViewHelper', array('setErrorClassAttribute', 'getName', 'getValue', 'registerFieldNameForFormTokenGeneration'));
+ $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\HiddenViewHelper::class, array('setErrorClassAttribute', 'getName', 'getValue', 'registerFieldNameForFormTokenGeneration'));
$this->injectDependenciesIntoViewHelper($this->viewHelper);
$this->viewHelper->initializeArguments();
}
* @test
*/
public function renderCorrectlySetsTagNameAndDefaultAttributes() {
- $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('setTagName', 'addAttribute'));
+ $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('setTagName', 'addAttribute'));
$mockTagBuilder->expects($this->once())->method('setTagName')->with('input');
$mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('type', 'hidden');
$mockTagBuilder->expects($this->at(2))->method('addAttribute')->with('name', 'foo');
public function setUp() {
parent::setUp();
- $this->viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\PasswordViewHelper', array('setErrorClassAttribute', 'registerFieldNameForFormTokenGeneration'));
+ $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\PasswordViewHelper::class, array('setErrorClassAttribute', 'registerFieldNameForFormTokenGeneration'));
$this->arguments['name'] = '';
$this->injectDependenciesIntoViewHelper($this->viewHelper);
$this->viewHelper->initializeArguments();
* @test
*/
public function renderCorrectlySetsTagName() {
- $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('setTagName'), array(), '', FALSE);
+ $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('setTagName'), array(), '', FALSE);
$mockTagBuilder->expects($this->once())->method('setTagName')->with('input');
$this->viewHelper->_set('tag', $mockTagBuilder);
* @test
*/
public function renderCorrectlySetsTypeNameAndValueAttributes() {
- $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('addAttribute', 'setContent', 'render'), array(), '', FALSE);
+ $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('addAttribute', 'setContent', 'render'), array(), '', FALSE);
$mockTagBuilder->expects($this->at(0))->method('addAttribute')->with('type', 'password');
$mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('name', 'NameOfTextbox');
$this->viewHelper->expects($this->once())->method('registerFieldNameForFormTokenGeneration')->with('NameOfTextbox');
public function setUp() {
parent::setUp();
- $this->viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\RadioViewHelper', array('setErrorClassAttribute', 'getName', 'getValue', 'isObjectAccessorMode', 'getPropertyValue', 'registerFieldNameForFormTokenGeneration'));
+ $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\RadioViewHelper::class, array('setErrorClassAttribute', 'getName', 'getValue', 'isObjectAccessorMode', 'getPropertyValue', 'registerFieldNameForFormTokenGeneration'));
$this->injectDependenciesIntoViewHelper($this->viewHelper);
$this->viewHelper->initializeArguments();
}
* @test
*/
public function renderCorrectlySetsTagNameAndDefaultAttributes() {
- $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('setTagName', 'addAttribute'));
+ $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('setTagName', 'addAttribute'));
$mockTagBuilder->expects($this->once())->method('setTagName')->with('input');
$mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('type', 'radio');
$mockTagBuilder->expects($this->at(2))->method('addAttribute')->with('name', 'foo');
* @test
*/
public function renderSetsCheckedAttributeIfSpecified() {
- $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('setTagName', 'addAttribute'));
+ $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('setTagName', 'addAttribute'));
$mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('type', 'radio');
$mockTagBuilder->expects($this->at(2))->method('addAttribute')->with('name', 'foo');
$this->viewHelper->expects($this->once())->method('registerFieldNameForFormTokenGeneration')->with('foo');
* @test
*/
public function renderIgnoresBoundPropertyIfCheckedIsSet() {
- $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('setTagName', 'addAttribute'));
+ $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('setTagName', 'addAttribute'));
$mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('type', 'radio');
$mockTagBuilder->expects($this->at(2))->method('addAttribute')->with('name', 'foo');
$mockTagBuilder->expects($this->at(3))->method('addAttribute')->with('value', 'bar');
* @test
*/
public function renderCorrectlySetsCheckedAttributeIfCheckboxIsBoundToAPropertyOfTypeBoolean() {
- $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('setTagName', 'addAttribute'));
+ $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('setTagName', 'addAttribute'));
$mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('type', 'radio');
$mockTagBuilder->expects($this->at(2))->method('addAttribute')->with('name', 'foo');
$this->viewHelper->expects($this->once())->method('registerFieldNameForFormTokenGeneration')->with('foo');
* @test
*/
public function renderDoesNotAppendSquareBracketsToNameAttributeIfBoundToAPropertyOfTypeArray() {
- $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('setTagName', 'addAttribute'));
+ $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('setTagName', 'addAttribute'));
$mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('type', 'radio');
$mockTagBuilder->expects($this->at(2))->method('addAttribute')->with('name', 'foo');
$this->viewHelper->expects($this->once())->method('registerFieldNameForFormTokenGeneration')->with('foo');
* @test
*/
public function renderCorrectlySetsCheckedAttributeIfCheckboxIsBoundToAPropertyOfTypeString() {
- $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('setTagName', 'addAttribute'));
+ $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('setTagName', 'addAttribute'));
$mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('type', 'radio');
$mockTagBuilder->expects($this->at(2))->method('addAttribute')->with('name', 'foo');
$this->viewHelper->expects($this->once())->method('registerFieldNameForFormTokenGeneration')->with('foo');
);
$this->arguments['name'] = '';
$this->arguments['sortByOptionLabel'] = FALSE;
- $this->viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\SelectViewHelper', array('setErrorClassAttribute', 'registerFieldNameForFormTokenGeneration'));
+ $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\SelectViewHelper::class, array('setErrorClassAttribute', 'registerFieldNameForFormTokenGeneration'));
}
public function tearDown() {
* @test
*/
public function selectOnDomainObjectsCreatesExpectedOptions() {
- $mockPersistenceManager = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\PersistenceManagerInterface');
+ $mockPersistenceManager = $this->getMock(\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::class);
$mockPersistenceManager->expects($this->any())->method('getIdentifierByObject')->will($this->returnValue(NULL));
$this->viewHelper->_set('persistenceManager', $mockPersistenceManager);
*/
public function multipleSelectOnDomainObjectsCreatesExpectedOptionsWithoutOptionValueField() {
/** @var $mockPersistenceManager \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface */
- $mockPersistenceManager = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\PersistenceManagerInterface');
+ $mockPersistenceManager = $this->getMock(\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::class);
$mockPersistenceManager->expects($this->any())->method('getIdentifierByObject')->will($this->returnCallback(
function ($object) {
return $object->getId();
* @test
*/
public function selectWithoutFurtherConfigurationOnDomainObjectsUsesUuidForValueAndLabel() {
- $mockPersistenceManager = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\PersistenceManagerInterface');
+ $mockPersistenceManager = $this->getMock(\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::class);
$mockPersistenceManager->expects($this->any())->method('getIdentifierByObject')->will($this->returnValue('fakeUID'));
$this->viewHelper->_set('persistenceManager', $mockPersistenceManager);
* @test
*/
public function selectWithoutFurtherConfigurationOnDomainObjectsUsesToStringForLabelIfAvailable() {
- $mockPersistenceManager = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\PersistenceManagerInterface');
+ $mockPersistenceManager = $this->getMock(\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::class);
$mockPersistenceManager->expects($this->any())->method('getIdentifierByObject')->will($this->returnValue('fakeUID'));
$this->viewHelper->_set('persistenceManager', $mockPersistenceManager);
$this->tagBuilder->expects($this->once())->method('setContent')->with('<option value="fakeUID">toStringResult</option>' . chr(10));
$this->tagBuilder->expects($this->once())->method('render');
- $user = $this->getMock('TYPO3\\CMS\\Fluid\\Tests\\Unit\\ViewHelpers\\Form\\Fixtures\\UserDomainClass', array('__toString'), array(1, 'Ingmar', 'Schlecht'));
+ $user = $this->getMock(\TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\Fixtures\UserDomainClass::class, array('__toString'), array(1, 'Ingmar', 'Schlecht'));
$user->expects($this->atLeastOnce())->method('__toString')->will($this->returnValue('toStringResult'));
$this->arguments['options'] = array(
* @expectedException \TYPO3\CMS\Fluid\Core\ViewHelper\Exception
*/
public function selectOnDomainObjectsThrowsExceptionIfNoValueCanBeFound() {
- $mockPersistenceManager = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\PersistenceManagerInterface');
+ $mockPersistenceManager = $this->getMock(\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::class);
$mockPersistenceManager->expects($this->any())->method('getIdentifierByObject')->will($this->returnValue(NULL));
$this->viewHelper->_set('persistenceManager', $mockPersistenceManager);
public function setUp() {
parent::setUp();
- $this->viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\SubmitViewHelper', array('dummy'));
+ $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\SubmitViewHelper::class, array('dummy'));
$this->arguments['name'] = '';
$this->injectDependenciesIntoViewHelper($this->viewHelper);
$this->viewHelper->initializeArguments();
* @test
*/
public function renderCorrectlySetsTagNameAndDefaultAttributes() {
- $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('setTagName', 'addAttribute'));
+ $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('setTagName', 'addAttribute'));
$mockTagBuilder->expects($this->once())->method('setTagName')->with('input');
$mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('type', 'submit');
public function setUp() {
parent::setUp();
- $this->viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\TextareaViewHelper', array('setErrorClassAttribute', 'registerFieldNameForFormTokenGeneration'));
+ $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\TextareaViewHelper::class, array('setErrorClassAttribute', 'registerFieldNameForFormTokenGeneration'));
$this->arguments['name'] = '';
$this->injectDependenciesIntoViewHelper($this->viewHelper);
$this->viewHelper->initializeArguments();
* @test
*/
public function renderCorrectlySetsTagName() {
- $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('setTagName'), array(), '', FALSE);
+ $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('setTagName'), array(), '', FALSE);
$mockTagBuilder->expects($this->once())->method('setTagName')->with('textarea');
$this->viewHelper->_set('tag', $mockTagBuilder);
* @test
*/
public function renderCorrectlySetsNameAttributeAndContent() {
- $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('addAttribute', 'setContent', 'render'), array(), '', FALSE);
+ $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('addAttribute', 'setContent', 'render'), array(), '', FALSE);
$mockTagBuilder->expects($this->once())->method('addAttribute')->with('name', 'NameOfTextarea');
$this->viewHelper->expects($this->once())->method('registerFieldNameForFormTokenGeneration')->with('NameOfTextarea');
$mockTagBuilder->expects($this->once())->method('setContent')->with('Current value');
* @test
*/
public function renderEscapesTextareaContent() {
- $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('addAttribute', 'setContent', 'render'), array(), '', FALSE);
+ $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('addAttribute', 'setContent', 'render'), array(), '', FALSE);
$mockTagBuilder->expects($this->once())->method('addAttribute')->with('name', 'NameOfTextarea');
$this->viewHelper->expects($this->once())->method('registerFieldNameForFormTokenGeneration')->with('NameOfTextarea');
$mockTagBuilder->expects($this->once())->method('setContent')->with('some <tag> & "quotes"');
* @test
*/
public function renderAddsPlaceholder() {
- $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('addAttribute', 'setContent', 'render'), array(), '', FALSE);
+ $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('addAttribute', 'setContent', 'render'), array(), '', FALSE);
$mockTagBuilder->expects($this->at(0))->method('addAttribute')->with('placeholder', 'SomePlaceholder');
$mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('name', 'NameOfTextarea');
$mockTagBuilder->expects($this->once())->method('render');
public function setUp() {
parent::setUp();
- $this->viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\TextfieldViewHelper', array('setErrorClassAttribute', 'registerFieldNameForFormTokenGeneration'));
+ $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\TextfieldViewHelper::class, array('setErrorClassAttribute', 'registerFieldNameForFormTokenGeneration'));
$this->arguments['name'] = '';
$this->injectDependenciesIntoViewHelper($this->viewHelper);
$this->viewHelper->initializeArguments();
* @test
*/
public function renderCorrectlySetsTagName() {
- $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('setTagName'), array(), '', FALSE);
+ $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('setTagName'), array(), '', FALSE);
$mockTagBuilder->expects($this->once())->method('setTagName')->with('input');
$this->viewHelper->_set('tag', $mockTagBuilder);
* @test
*/
public function renderCorrectlySetsTypeNameAndValueAttributes() {
- $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('addAttribute', 'setContent', 'render'), array(), '', FALSE);
+ $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('addAttribute', 'setContent', 'render'), array(), '', FALSE);
$mockTagBuilder->expects($this->at(0))->method('addAttribute')->with('type', 'text');
$mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('name', 'NameOfTextfield');
$this->viewHelper->expects($this->once())->method('registerFieldNameForFormTokenGeneration')->with('NameOfTextfield');
* @test
*/
public function renderAddsPlaceholder() {
- $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('addAttribute', 'setContent', 'render'), array(), '', FALSE);
+ $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('addAttribute', 'setContent', 'render'), array(), '', FALSE);
$mockTagBuilder->expects($this->at(0))->method('addAttribute')->with('placeholder', 'SomePlaceholder');
$mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('type', 'text');
$mockTagBuilder->expects($this->at(2))->method('addAttribute')->with('name', 'NameOfTextfield');
public function setUp() {
parent::setUp();
- $this->viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\UploadViewHelper', array('setErrorClassAttribute', 'registerFieldNameForFormTokenGeneration'));
+ $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\UploadViewHelper::class, array('setErrorClassAttribute', 'registerFieldNameForFormTokenGeneration'));
$this->arguments['name'] = '';
$this->injectDependenciesIntoViewHelper($this->viewHelper);
$this->viewHelper->initializeArguments();
* @test
*/
public function renderCorrectlySetsTypeNameAndValueAttributes() {
- $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('addAttribute', 'setContent', 'render'), array(), '', FALSE);
+ $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('addAttribute', 'setContent', 'render'), array(), '', FALSE);
$mockTagBuilder->expects($this->at(0))->method('addAttribute')->with('type', 'file');
$mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('name', 'someName');
$this->viewHelper->expects($this->at(0))->method('registerFieldNameForFormTokenGeneration')->with('someName[name]');
public function setUp() {
parent::setUp();
- $this->mockExtensionService = $this->getMock('TYPO3\\CMS\\Extbase\\Service\\ExtensionService');
- $this->mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
+ $this->mockExtensionService = $this->getMock(\TYPO3\CMS\Extbase\Service\ExtensionService::class);
+ $this->mockConfigurationManager = $this->getMock(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::class);
}
/**
protected function injectDependenciesIntoViewHelper(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper $viewHelper) {
$viewHelper->_set('configurationManager', $this->mockConfigurationManager);
parent::injectDependenciesIntoViewHelper($viewHelper);
- $hashService = $this->getMock('TYPO3\CMS\Extbase\Security\Cryptography\HashService', array('appendHmac'));
+ $hashService = $this->getMock(\TYPO3\CMS\Extbase\Security\Cryptography\HashService::class, array('appendHmac'));
$hashService->expects($this->any())->method('appendHmac')->will($this->returnValue(''));
$this->mvcPropertyMapperConfigurationService->_set('hashService', $hashService);
$viewHelper->_set('mvcPropertyMapperConfigurationService', $this->mvcPropertyMapperConfigurationService);
*/
public function renderAddsObjectToViewHelperVariableContainer() {
$formObject = new \stdClass();
- $viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', array('renderChildren', 'renderHiddenIdentityField', 'renderAdditionalIdentityFields', 'renderHiddenReferrerFields', 'renderRequestHashField', 'addFormObjectNameToViewHelperVariableContainer', 'addFieldNamePrefixToViewHelperVariableContainer', 'removeFormObjectNameFromViewHelperVariableContainer', 'removeFieldNamePrefixFromViewHelperVariableContainer', 'addFormFieldNamesToViewHelperVariableContainer', 'removeFormFieldNamesFromViewHelperVariableContainer', 'renderTrustedPropertiesField'), array(), '', FALSE);
+ $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, array('renderChildren', 'renderHiddenIdentityField', 'renderAdditionalIdentityFields', 'renderHiddenReferrerFields', 'renderRequestHashField', 'addFormObjectNameToViewHelperVariableContainer', 'addFieldNamePrefixToViewHelperVariableContainer', 'removeFormObjectNameFromViewHelperVariableContainer', 'removeFieldNamePrefixFromViewHelperVariableContainer', 'addFormFieldNamesToViewHelperVariableContainer', 'removeFormFieldNamesFromViewHelperVariableContainer', 'renderTrustedPropertiesField'), array(), '', FALSE);
$this->injectDependenciesIntoViewHelper($viewHelper);
$viewHelper->setArguments(array('object' => $formObject));
- $this->viewHelperVariableContainer->expects($this->at(0))->method('add')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObject', $formObject);
- $this->viewHelperVariableContainer->expects($this->at(1))->method('add')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'additionalIdentityProperties', array());
- $this->viewHelperVariableContainer->expects($this->at(2))->method('remove')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObject');
- $this->viewHelperVariableContainer->expects($this->at(3))->method('remove')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'additionalIdentityProperties');
+ $this->viewHelperVariableContainer->expects($this->at(0))->method('add')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObject', $formObject);
+ $this->viewHelperVariableContainer->expects($this->at(1))->method('add')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'additionalIdentityProperties', array());
+ $this->viewHelperVariableContainer->expects($this->at(2))->method('remove')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObject');
+ $this->viewHelperVariableContainer->expects($this->at(3))->method('remove')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'additionalIdentityProperties');
$viewHelper->render();
}
*/
public function renderAddsObjectNameToTemplateVariableContainer() {
$objectName = 'someObjectName';
- $viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', array('renderChildren', 'renderHiddenIdentityField', 'renderHiddenReferrerFields', 'renderRequestHashField', 'addFormObjectToViewHelperVariableContainer', 'addFieldNamePrefixToViewHelperVariableContainer', 'removeFormObjectFromViewHelperVariableContainer', 'removeFieldNamePrefixFromViewHelperVariableContainer', 'addFormFieldNamesToViewHelperVariableContainer', 'removeFormFieldNamesFromViewHelperVariableContainer', 'renderTrustedPropertiesField'), array(), '', FALSE);
+ $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, array('renderChildren', 'renderHiddenIdentityField', 'renderHiddenReferrerFields', 'renderRequestHashField', 'addFormObjectToViewHelperVariableContainer', 'addFieldNamePrefixToViewHelperVariableContainer', 'removeFormObjectFromViewHelperVariableContainer', 'removeFieldNamePrefixFromViewHelperVariableContainer', 'addFormFieldNamesToViewHelperVariableContainer', 'removeFormFieldNamesFromViewHelperVariableContainer', 'renderTrustedPropertiesField'), array(), '', FALSE);
$this->injectDependenciesIntoViewHelper($viewHelper);
$viewHelper->setArguments(array('name' => $objectName));
- $this->viewHelperVariableContainer->expects($this->once())->method('add')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObjectName', $objectName);
- $this->viewHelperVariableContainer->expects($this->once())->method('remove')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObjectName');
+ $this->viewHelperVariableContainer->expects($this->once())->method('add')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObjectName', $objectName);
+ $this->viewHelperVariableContainer->expects($this->once())->method('remove')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObjectName');
$viewHelper->render();
}
*/
public function formObjectNameArgumentOverrulesNameArgument() {
$objectName = 'someObjectName';
- $viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', array('renderChildren', 'renderHiddenIdentityField', 'renderHiddenReferrerFields', 'renderRequestHashField', 'addFormObjectToViewHelperVariableContainer', 'addFieldNamePrefixToViewHelperVariableContainer', 'removeFormObjectFromViewHelperVariableContainer', 'removeFieldNamePrefixFromViewHelperVariableContainer', 'addFormFieldNamesToViewHelperVariableContainer', 'removeFormFieldNamesFromViewHelperVariableContainer', 'renderTrustedPropertiesField'), array(), '', FALSE);
+ $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, array('renderChildren', 'renderHiddenIdentityField', 'renderHiddenReferrerFields', 'renderRequestHashField', 'addFormObjectToViewHelperVariableContainer', 'addFieldNamePrefixToViewHelperVariableContainer', 'removeFormObjectFromViewHelperVariableContainer', 'removeFieldNamePrefixFromViewHelperVariableContainer', 'addFormFieldNamesToViewHelperVariableContainer', 'removeFormFieldNamesFromViewHelperVariableContainer', 'renderTrustedPropertiesField'), array(), '', FALSE);
$this->injectDependenciesIntoViewHelper($viewHelper);
$viewHelper->setArguments(array('name' => 'formName', 'objectName' => $objectName));
- $this->viewHelperVariableContainer->expects($this->once())->method('add')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObjectName', $objectName);
- $this->viewHelperVariableContainer->expects($this->once())->method('remove')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObjectName');
+ $this->viewHelperVariableContainer->expects($this->once())->method('add')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObjectName', $objectName);
+ $this->viewHelperVariableContainer->expects($this->once())->method('remove')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObjectName');
$viewHelper->render();
}
* @test
*/
public function renderCallsRenderHiddenReferrerFields() {
- $viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', array('renderChildren', 'renderRequestHashField', 'renderHiddenReferrerFields', 'renderTrustedPropertiesField'), array(), '', FALSE);
+ $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, array('renderChildren', 'renderRequestHashField', 'renderHiddenReferrerFields', 'renderTrustedPropertiesField'), array(), '', FALSE);
$viewHelper->expects($this->once())->method('renderHiddenReferrerFields');
$this->injectDependenciesIntoViewHelper($viewHelper);
$viewHelper->render();
*/
public function renderCallsRenderHiddenIdentityField() {
$object = new \stdClass();
- $viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', array('renderChildren', 'renderRequestHashField', 'renderHiddenReferrerFields', 'renderHiddenIdentityField', 'getFormObjectName', 'renderTrustedPropertiesField'), array(), '', FALSE);
+ $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, array('renderChildren', 'renderRequestHashField', 'renderHiddenReferrerFields', 'renderHiddenIdentityField', 'getFormObjectName', 'renderTrustedPropertiesField'), array(), '', FALSE);
$this->injectDependenciesIntoViewHelper($viewHelper);
$viewHelper->setArguments(array('object' => $object));
$viewHelper->expects($this->atLeastOnce())->method('getFormObjectName')->will($this->returnValue('MyName'));
* @test
*/
public function renderCallsRenderAdditionalIdentityFields() {
- $viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', array('renderChildren', 'renderRequestHashField', 'renderHiddenReferrerFields', 'renderAdditionalIdentityFields', 'renderTrustedPropertiesField'), array(), '', FALSE);
+ $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, array('renderChildren', 'renderRequestHashField', 'renderHiddenReferrerFields', 'renderAdditionalIdentityFields', 'renderTrustedPropertiesField'), array(), '', FALSE);
$viewHelper->expects($this->once())->method('renderAdditionalIdentityFields');
$this->injectDependenciesIntoViewHelper($viewHelper);
$viewHelper->render();
* @test
*/
public function renderWrapsHiddenFieldsWithDivForXhtmlCompatibilityWithRewrittenPropertyMapper() {
- $viewHelper = $this->getAccessibleMock($this->buildAccessibleProxy('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper'), array('renderChildren', 'renderHiddenIdentityField', 'renderAdditionalIdentityFields', 'renderHiddenReferrerFields', 'renderTrustedPropertiesField'), array(), '', FALSE);
+ $viewHelper = $this->getAccessibleMock($this->buildAccessibleProxy(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class), array('renderChildren', 'renderHiddenIdentityField', 'renderAdditionalIdentityFields', 'renderHiddenReferrerFields', 'renderTrustedPropertiesField'), array(), '', FALSE);
$this->mvcPropertyMapperConfigurationService->_set('hashService', new \TYPO3\CMS\Extbase\Security\Cryptography\HashService());
$viewHelper->_set('mvcPropertyMapperConfigurationService', $this->mvcPropertyMapperConfigurationService);
parent::injectDependenciesIntoViewHelper($viewHelper);
* @test
*/
public function renderWrapsHiddenFieldsWithDivAndAnAdditionalClassForXhtmlCompatibilityWithRewrittenPropertyMapper() {
- $viewHelper = $this->getMock($this->buildAccessibleProxy('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper'), array('renderChildren', 'renderHiddenIdentityField', 'renderAdditionalIdentityFields', 'renderHiddenReferrerFields', 'renderTrustedPropertiesField'), array(), '', FALSE);
+ $viewHelper = $this->getMock($this->buildAccessibleProxy(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class), array('renderChildren', 'renderHiddenIdentityField', 'renderAdditionalIdentityFields', 'renderHiddenReferrerFields', 'renderTrustedPropertiesField'), array(), '', FALSE);
$this->mvcPropertyMapperConfigurationService->_set('hashService', new \TYPO3\CMS\Extbase\Security\Cryptography\HashService());
$viewHelper->_set('mvcPropertyMapperConfigurationService', $this->mvcPropertyMapperConfigurationService);
parent::injectDependenciesIntoViewHelper($viewHelper);
'object1[object2]' => '<input type="hidden" name="object1[object2][__identity]" value="42" />',
'object1[object2][subobject]' => '<input type="hidden" name="object1[object2][subobject][__identity]" value="21" />'
);
- $this->viewHelperVariableContainer->expects($this->once())->method('exists')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'additionalIdentityProperties')->will($this->returnValue(TRUE));
- $this->viewHelperVariableContainer->expects($this->once())->method('get')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'additionalIdentityProperties')->will($this->returnValue($identityProperties));
- $viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', array('renderChildren'), array(), '', FALSE);
+ $this->viewHelperVariableContainer->expects($this->once())->method('exists')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'additionalIdentityProperties')->will($this->returnValue(TRUE));
+ $this->viewHelperVariableContainer->expects($this->once())->method('get')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'additionalIdentityProperties')->will($this->returnValue($identityProperties));
+ $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, array('renderChildren'), array(), '', FALSE);
$this->injectDependenciesIntoViewHelper($viewHelper);
$expected = chr(10) . '<input type="hidden" name="object1[object2][__identity]" value="42" />' . chr(10) . '<input type="hidden" name="object1[object2][subobject][__identity]" value="21" />';
$actual = $viewHelper->_call('renderAdditionalIdentityFields');
* @test
*/
public function renderHiddenReferrerFieldsAddCurrentControllerAndActionAsHiddenFields() {
- $viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', array('dummy'), array(), '', FALSE);
+ $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, array('dummy'), array(), '', FALSE);
$this->injectDependenciesIntoViewHelper($viewHelper);
$this->request->expects($this->atLeastOnce())->method('getControllerExtensionName')->will($this->returnValue('extensionName'));
$this->request->expects($this->never())->method('getControllerSubextensionName');
*/
public function renderAddsSpecifiedPrefixToTemplateVariableContainer() {
$prefix = 'somePrefix';
- $viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', array('renderChildren', 'renderHiddenIdentityField', 'renderHiddenReferrerFields', 'renderRequestHashField', 'addFormFieldNamesToViewHelperVariableContainer', 'removeFormFieldNamesFromViewHelperVariableContainer', 'renderTrustedPropertiesField'), array(), '', FALSE);
+ $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, array('renderChildren', 'renderHiddenIdentityField', 'renderHiddenReferrerFields', 'renderRequestHashField', 'addFormFieldNamesToViewHelperVariableContainer', 'removeFormFieldNamesFromViewHelperVariableContainer', 'renderTrustedPropertiesField'), array(), '', FALSE);
$this->injectDependenciesIntoViewHelper($viewHelper);
$viewHelper->setArguments(array('fieldNamePrefix' => $prefix));
- $this->viewHelperVariableContainer->expects($this->once())->method('add')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'fieldNamePrefix', $prefix);
- $this->viewHelperVariableContainer->expects($this->once())->method('remove')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'fieldNamePrefix');
+ $this->viewHelperVariableContainer->expects($this->once())->method('add')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'fieldNamePrefix', $prefix);
+ $this->viewHelperVariableContainer->expects($this->once())->method('remove')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'fieldNamePrefix');
$viewHelper->render();
}
*/
public function renderAddsDefaultFieldNamePrefixToTemplateVariableContainerIfNoPrefixIsSpecified() {
$expectedPrefix = 'tx_someextension_someplugin';
- $viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', array('renderChildren', 'renderHiddenIdentityField', 'renderHiddenReferrerFields', 'renderRequestHashField', 'addFormFieldNamesToViewHelperVariableContainer', 'removeFormFieldNamesFromViewHelperVariableContainer', 'renderTrustedPropertiesField'), array(), '', FALSE);
+ $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, array('renderChildren', 'renderHiddenIdentityField', 'renderHiddenReferrerFields', 'renderRequestHashField', 'addFormFieldNamesToViewHelperVariableContainer', 'removeFormFieldNamesFromViewHelperVariableContainer', 'renderTrustedPropertiesField'), array(), '', FALSE);
$this->mockExtensionService->expects($this->once())->method('getPluginNamespace')->with('SomeExtension', 'SomePlugin')->will($this->returnValue('tx_someextension_someplugin'));
$viewHelper->_set('extensionService', $this->mockExtensionService);
$this->injectDependenciesIntoViewHelper($viewHelper);
$viewHelper->setArguments(array('extensionName' => 'SomeExtension', 'pluginName' => 'SomePlugin'));
- $this->viewHelperVariableContainer->expects($this->once())->method('add')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'fieldNamePrefix', $expectedPrefix);
- $this->viewHelperVariableContainer->expects($this->once())->method('remove')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'fieldNamePrefix');
+ $this->viewHelperVariableContainer->expects($this->once())->method('add')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'fieldNamePrefix', $expectedPrefix);
+ $this->viewHelperVariableContainer->expects($this->once())->method('remove')->with(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'fieldNamePrefix');
$viewHelper->render();
}
* @dataProvider argumentsForPostProcessUriArgumentsForRequestHash
*/
public function postProcessUriArgumentsForRequestHashWorks($arguments, $expectedResults) {
- $viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', array('dummy'), array(), '', FALSE);
+ $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, array('dummy'), array(), '', FALSE);
$results = array();
$viewHelper->_callRef('postProcessUriArgumentsForRequestHash', $arguments, $results);
$this->assertEquals($expectedResults, $results);
protected $viewHelper;
public function setUp() {
- $this->viewHelper = $this->getMock('TYPO3\CMS\Fluid\ViewHelpers\Format\BytesViewHelper', array('renderChildren'));
+ $this->viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\BytesViewHelper::class, array('renderChildren'));
}
/**
public function setUp() {
parent::setUp();
- $this->mockContentObject = $this->getMock('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer', array(), array(), '', FALSE);
- $this->mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
+ $this->mockContentObject = $this->getMock(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class, array(), array(), '', FALSE);
+ $this->mockConfigurationManager = $this->getMock(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::class);
$this->mockConfigurationManager->expects($this->any())->method('getContentObject')->will($this->returnValue($this->mockContentObject));
- $this->viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\CropViewHelper', array('renderChildren'));
+ $this->viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\CropViewHelper::class, array('renderChildren'));
$this->viewHelper->injectConfigurationManager($this->mockConfigurationManager);
$this->viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue('Some Content'));
}
* @test
*/
public function viewHelperRoundsFloatCorrectly() {
- $viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\CurrencyViewHelper', array('renderChildren'));
+ $viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\CurrencyViewHelper::class, array('renderChildren'));
$viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue(123.456));
$actualResult = $viewHelper->render();
$this->assertEquals('123,46', $actualResult);
* @test
*/
public function viewHelperRendersCurrencySign() {
- $viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\CurrencyViewHelper', array('renderChildren'));
+ $viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\CurrencyViewHelper::class, array('renderChildren'));
$viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue(123));
$actualResult = $viewHelper->render('foo');
$this->assertEquals('123,00 foo', $actualResult);
* @test
*/
public function viewHelperRendersPrependedCurrencySign() {
- $viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\CurrencyViewHelper', array('renderChildren'));
+ $viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\CurrencyViewHelper::class, array('renderChildren'));
$viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue(123));
$actualResult = $viewHelper->render('foo', ',', '.', TRUE);
$this->assertEquals('foo 123,00', $actualResult);
* @test
*/
public function viewHelperRespectsCurrencySeparator() {
- $viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\CurrencyViewHelper', array('renderChildren'));
+ $viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\CurrencyViewHelper::class, array('renderChildren'));
$viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue(123));
$actualResult = $viewHelper->render('foo', ',', '.', TRUE, FALSE);
$this->assertEquals('foo123,00', $actualResult);
* @test
*/
public function viewHelperRespectsDecimalSeparator() {
- $viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\CurrencyViewHelper', array('renderChildren'));
+ $viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\CurrencyViewHelper::class, array('renderChildren'));
$viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue(12345));
$actualResult = $viewHelper->render('', '|');
$this->assertEquals('12.345|00', $actualResult);
* @test
*/
public function viewHelperRespectsThousandsSeparator() {
- $viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\CurrencyViewHelper', array('renderChildren'));
+ $viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\CurrencyViewHelper::class, array('renderChildren'));
$viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue(12345));
$actualResult = $viewHelper->render('', ',', '|');
$this->assertEquals('12|345,00', $actualResult);
* @test
*/
public function viewHelperRendersNullValues() {
- $viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\CurrencyViewHelper', array('renderChildren'));
+ $viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\CurrencyViewHelper::class, array('renderChildren'));
$viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue(NULL));
$actualResult = $viewHelper->render();
$this->assertEquals('0,00', $actualResult);
* @test
*/
public function viewHelperRendersEmptyString() {
- $viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\CurrencyViewHelper', array('renderChildren'));
+ $viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\CurrencyViewHelper::class, array('renderChildren'));
$viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue(''));
$actualResult = $viewHelper->render();
$this->assertEquals('0,00', $actualResult);
* @test
*/
public function viewHelperRendersZeroValues() {
- $viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\CurrencyViewHelper', array('renderChildren'));
+ $viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\CurrencyViewHelper::class, array('renderChildren'));
$viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue(0));
$actualResult = $viewHelper->render();
$this->assertEquals('0,00', $actualResult);
* @test
*/
public function viewHelperRendersNegativeAmounts() {
- $viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\CurrencyViewHelper', array('renderChildren'));
+ $viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\CurrencyViewHelper::class, array('renderChildren'));
$viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue(-123.456));
$actualResult = $viewHelper->render();
$this->assertEquals('-123,46', $actualResult);
* @test
*/
public function viewHelperRendersStringsToZeroValueFloat() {
- $viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\CurrencyViewHelper', array('renderChildren'));
+ $viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\CurrencyViewHelper::class, array('renderChildren'));
$viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue('TYPO3'));
$actualResult = $viewHelper->render();
$this->assertEquals('0,00', $actualResult);
* @test
*/
public function viewHelperRendersCommaValuesToValueBeforeComma() {
- $viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\CurrencyViewHelper', array('renderChildren'));
+ $viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\CurrencyViewHelper::class, array('renderChildren'));
$viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue('12,34.00'));
$actualResult = $viewHelper->render();
$this->assertEquals('12,00', $actualResult);
* @test
*/
public function viewHelperRendersValuesWithoutDecimals() {
- $viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\CurrencyViewHelper', array('renderChildren'));
+ $viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\CurrencyViewHelper::class, array('renderChildren'));
$viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue('54321'));
$actualResult = $viewHelper->render('', ',', '.', FALSE, TRUE, 0);
$this->assertEquals('54.321', $actualResult);
* @test
*/
public function viewHelperRendersThreeDecimals() {
- $viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\CurrencyViewHelper', array('renderChildren'));
+ $viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\CurrencyViewHelper::class, array('renderChildren'));
$viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue('54321'));
$actualResult = $viewHelper->render('', ',', '.', FALSE, TRUE, 3);
$this->assertEquals('54.321,000', $actualResult);
*/
public function viewHelperReturnsEmptyStringIfNULLIsGiven() {
/** @var DateViewHelper|\PHPUnit_Framework_MockObject_MockObject $viewHelper */
- $viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\DateViewHelper', array('renderChildren'));
+ $viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\DateViewHelper::class, array('renderChildren'));
$viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue(NULL));
$actualResult = $viewHelper->render();
$this->assertEquals('', $actualResult);
*/
public function viewHelperUsesChildNodesIfDateAttributeIsNotSpecified() {
/** @var DateViewHelper|\PHPUnit_Framework_MockObject_MockObject $viewHelper */
- $viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\DateViewHelper', array('renderChildren'));
+ $viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\DateViewHelper::class, array('renderChildren'));
$viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue(new \DateTime('1980-12-13')));
$actualResult = $viewHelper->render();
$this->assertEquals('1980-12-13', $actualResult);
*/
public function viewHelperUsesChildNodesWithTimestamp() {
/** @var DateViewHelper|\PHPUnit_Framework_MockObject_MockObject $viewHelper */
- $viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\DateViewHelper', array('renderChildren'));
+ $viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\DateViewHelper::class, array('renderChildren'));
$viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue('1359891658'));
$actualResult = $viewHelper->render();
$this->assertEquals('2013-02-03', $actualResult);
*/
public function dateArgumentHasPriorityOverChildNodes() {
/** @var DateViewHelper|\PHPUnit_Framework_MockObject_MockObject $viewHelper */
- $viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\DateViewHelper', array('renderChildren'));
+ $viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\DateViewHelper::class, array('renderChildren'));
$viewHelper->expects($this->never())->method('renderChildren');
$actualResult = $viewHelper->render('1980-12-12');
$this->assertEquals('1980-12-12', $actualResult);
*/
public function viewHelperRespectsDefaultTimezoneForIntegerTimestamp($timezone, $expected) {
/** @var DateViewHelper|\PHPUnit_Framework_MockObject_MockObject $viewHelper */
- $viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\DateViewHelper', array('renderChildren'));
+ $viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\DateViewHelper::class, array('renderChildren'));
$date = 1359891658; // 2013-02-03 11:40 UTC
$format = 'Y-m-d H:i';
*/
public function viewHelperRespectsDefaultTimezoneForStringTimestamp($timeZone, $date, $expected) {
/** @var DateViewHelper|\PHPUnit_Framework_MockObject_MockObject $viewHelper */
- $viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\DateViewHelper', array('renderChildren'));
+ $viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\DateViewHelper::class, array('renderChildren'));
$format = 'Y-m-d H:i';
date_default_timezone_set($timeZone);
*/
public function dateViewHelperFormatsDateLocalized($locale, $expected) {
/** @var DateViewHelper|\PHPUnit_Framework_MockObject_MockObject $viewHelper */
- $viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\DateViewHelper', array('renderChildren'));
+ $viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\DateViewHelper::class, array('renderChildren'));
$format = '%d. %B %Y';
// 2013-02-03 11:40 UTC
$timestamp = '@1359891658';
protected $viewHelper;
public function setUp() {
- $this->viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\HtmlentitiesDecodeViewHelper', array('renderChildren'));
+ $this->viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlentitiesDecodeViewHelper::class, array('renderChildren'));
}
/**
protected $viewHelper;
public function setUp() {
- $this->viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\HtmlentitiesViewHelper', array('renderChildren', 'resolveDefaultEncoding'));
+ $this->viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlentitiesViewHelper::class, array('renderChildren', 'resolveDefaultEncoding'));
$this->viewHelper->expects($this->any())->method('resolveDefaultEncoding')->will($this->returnValue('UTF-8'));
}
protected $viewHelper;
public function setUp() {
- $this->viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\HtmlspecialcharsViewHelper', array('renderChildren'));
+ $this->viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlspecialcharsViewHelper::class, array('renderChildren'));
}
/**
* @test
*/
public function viewHelperDoesNotModifyTextWithoutLineBreaks() {
- $viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\Nl2brViewHelper', array('renderChildren'));
+ $viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\Nl2brViewHelper::class, array('renderChildren'));
$viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue('<p class="bodytext">Some Text without line breaks</p>'));
$actualResult = $viewHelper->render();
$this->assertEquals('<p class="bodytext">Some Text without line breaks</p>', $actualResult);
* @test
*/
public function viewHelperConvertsLineBreaksToBRTags() {
- $viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\Nl2brViewHelper', array('renderChildren'));
+ $viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\Nl2brViewHelper::class, array('renderChildren'));
$viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue('Line 1' . chr(10) . 'Line 2'));
$actualResult = $viewHelper->render();
$this->assertEquals('Line 1<br />' . chr(10) . 'Line 2', $actualResult);
* @test
*/
public function viewHelperConvertsWindowsLineBreaksToBRTags() {
- $viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\Nl2brViewHelper', array('renderChildren'));
+ $viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\Nl2brViewHelper::class, array('renderChildren'));
$viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue('Line 1' . chr(13) . chr(10) . 'Line 2'));
$actualResult = $viewHelper->render();
$this->assertEquals('Line 1<br />' . chr(13) . chr(10) . 'Line 2', $actualResult);
* @test
*/
public function formatNumberDefaultsToEnglishNotationWithTwoDecimals() {
- $viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\NumberViewHelper', array('renderChildren'));
+ $viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\NumberViewHelper::class, array('renderChildren'));
$viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue(10000.0 / 3.0));
$actualResult = $viewHelper->render();
$this->assertEquals('3,333.33', $actualResult);
* @test
*/
public function formatNumberWithDecimalsDecimalPointAndSeparator() {
- $viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\NumberViewHelper', array('renderChildren'));
+ $viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\NumberViewHelper::class, array('renderChildren'));
$viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue(10000.0 / 3.0));
$actualResult = $viewHelper->render(3, ',', '.');
$this->assertEquals('3.333,333', $actualResult);
* @test
*/
public function stringsArePaddedWithBlanksByDefault() {
- $viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\PaddingViewHelper', array('renderChildren'));
+ $viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\PaddingViewHelper::class, array('renderChildren'));
$viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue('foo'));
$actualResult = $viewHelper->render(10);
$this->assertEquals('foo ', $actualResult);