[!!!][TASK] Remove deprecated property mapper of Extbase 15/28915/7
authorAlexander Schnitzler <typo3@alexanderschnitzler.de>
Thu, 27 Mar 2014 16:11:23 +0000 (17:11 +0100)
committerHelmut Hummel <helmut.hummel@typo3.org>
Sun, 14 Sep 2014 21:30:03 +0000 (23:30 +0200)
Extensions requiring rewrittenPropertyMapper = 0
may not work properly any more.

Releases: 6.3
Resolves: #57396
Change-Id: Id33a364194a9b6ff05301527df7a0af21b8d3807
Reviewed-on: http://review.typo3.org/28915
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
Tested-by: Helmut Hummel <helmut.hummel@typo3.org>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
63 files changed:
typo3/sysext/core/Documentation/Changelog/master/Breaking-57396-ExtbaseDeprecatedPropertyMapperRemoved.rst [new file with mode: 0644]
typo3/sysext/core/Migrations/Code/LegacyClassesForIde.php
typo3/sysext/extbase/Classes/Mvc/Controller/AbstractController.php
typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php
typo3/sysext/extbase/Classes/Mvc/Controller/Argument.php
typo3/sysext/extbase/Classes/Mvc/Controller/ArgumentError.php [deleted file]
typo3/sysext/extbase/Classes/Mvc/Controller/ArgumentsValidator.php [deleted file]
typo3/sysext/extbase/Classes/Mvc/Controller/ControllerContext.php
typo3/sysext/extbase/Classes/Mvc/Request.php
typo3/sysext/extbase/Classes/Mvc/Web/BackendRequestHandler.php
typo3/sysext/extbase/Classes/Mvc/Web/FrontendRequestHandler.php
typo3/sysext/extbase/Classes/Mvc/Web/Request.php
typo3/sysext/extbase/Classes/Property/Mapper.php [deleted file]
typo3/sysext/extbase/Classes/Property/MappingResults.php [deleted file]
typo3/sysext/extbase/Classes/Property/PropertyMapper.php
typo3/sysext/extbase/Classes/Property/PropertyMappingConfiguration.php
typo3/sysext/extbase/Classes/Security/Channel/RequestHashService.php [deleted file]
typo3/sysext/extbase/Classes/Validation/PropertyError.php [deleted file]
typo3/sysext/extbase/Classes/Validation/Validator/AbstractCompositeValidator.php
typo3/sysext/extbase/Classes/Validation/Validator/AbstractObjectValidator.php [deleted file]
typo3/sysext/extbase/Classes/Validation/Validator/AbstractValidator.php
typo3/sysext/extbase/Classes/Validation/Validator/BooleanValidator.php
typo3/sysext/extbase/Classes/Validation/Validator/CollectionValidator.php
typo3/sysext/extbase/Classes/Validation/Validator/ConjunctionValidator.php
typo3/sysext/extbase/Classes/Validation/Validator/DateTimeValidator.php
typo3/sysext/extbase/Classes/Validation/Validator/DisjunctionValidator.php
typo3/sysext/extbase/Classes/Validation/Validator/GenericObjectValidator.php
typo3/sysext/extbase/Classes/Validation/Validator/NumberRangeValidator.php
typo3/sysext/extbase/Classes/Validation/Validator/ObjectValidatorInterface.php
typo3/sysext/extbase/Classes/Validation/Validator/ValidatorInterface.php
typo3/sysext/extbase/Classes/Validation/ValidatorResolver.php
typo3/sysext/extbase/Migrations/Code/ClassAliasMap.php
typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ActionControllerTest.php
typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ArgumentBehaviorBeforeExtbase14Test.php [deleted file]
typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ArgumentTest.php
typo3/sysext/extbase/Tests/Unit/Property/MapperTest.php [deleted file]
typo3/sysext/extbase/Tests/Unit/Security/Channel/RequestHashServiceTest.php [deleted file]
typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/AlphanumericValidatorTest.php [deleted file]
typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/ConjunctionValidatorTest.php [deleted file]
typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/DateTimeValidatorTest.php [deleted file]
typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/EmailAddressValidatorTest.php [deleted file]
typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/FloatValidatorTest.php [deleted file]
typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/GenericObjectValidatorTest.php [deleted file]
typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/IntegerValidatorTest.php [deleted file]
typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/NotEmptyValidatorTest.php [deleted file]
typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/NumberRangeValidatorTest.php [deleted file]
typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/NumberValidatorTest.php [deleted file]
typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/RawValidatorTest.php [deleted file]
typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/RegularExpressionValidatorTest.php [deleted file]
typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/StringLengthValidatorTest.php [deleted file]
typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/TextValidatorTest.php [deleted file]
typo3/sysext/extbase/Tests/Unit/Validation/Validator/CollectionValidatorTest.php
typo3/sysext/extbase/Tests/Unit/Validation/Validator/ConjunctionValidatorTest.php
typo3/sysext/extbase/Tests/Unit/Validation/Validator/DisjunctionValidatorTest.php
typo3/sysext/extbase/Tests/Unit/Validation/Validator/Fixture/AbstractCompositeValidatorClass.php
typo3/sysext/extbase/Tests/Unit/Validation/Validator/GenericObjectValidatorTest.php
typo3/sysext/extbase/Tests/Unit/Validation/ValidatorResolverTest.php
typo3/sysext/extbase/ext_typoscript_setup.txt
typo3/sysext/fluid/Classes/ViewHelpers/Form/AbstractFormFieldViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Form/ErrorsViewHelper.php [deleted file]
typo3/sysext/fluid/Classes/ViewHelpers/FormViewHelper.php
typo3/sysext/fluid/Migrations/Code/ClassAliasMap.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/FormViewHelperTest.php

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-57396-ExtbaseDeprecatedPropertyMapperRemoved.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-57396-ExtbaseDeprecatedPropertyMapperRemoved.rst
new file mode 100644 (file)
index 0000000..51c5ca2
--- /dev/null
@@ -0,0 +1,32 @@
+=================================================================
+Breaking: #57396 - Deprecated Extbase Property Mapper was removed
+=================================================================
+
+Description
+===========
+
+A new Property Mapper that mapped request arguments to controller action arguments
+was introduced in Extbase 1.4 and the old one was deprecated at the same time.
+Along with the mapping, the validation API has also been changed.
+The rewritten property mapper is turned on by default since TYPO3 6.2
+
+Now the old mapping and validation API is completely removed.
+
+Impact
+======
+
+Extbase extensions that relied on the internal behaviour of the deprecated property mapper
+or make use of the old validation API will stop working or may not work as expected any more.
+
+Affected installations
+======================
+
+Extbase extensions that turned off the introduced feature switch with the TypoScript setting
+:ts:`features.rewrittenPropertyMapper = 0` because they relied on internal behavior of the old property mapper
+will stop working.
+
+Migration
+=========
+
+Manual migration of extension code might be required, especially when own validators using the old
+validation API were used.
index 70df36d..97955f2 100644 (file)
@@ -1729,21 +1729,11 @@ class Tx_Extbase_MVC_Controller_Argument extends \TYPO3\CMS\Extbase\Mvc\Controll
 /**
  * @deprecated since 6.0 will be removed in 7.0
  */
-class Tx_Extbase_MVC_Controller_ArgumentError extends \TYPO3\CMS\Extbase\Mvc\Controller\ArgumentError {}
-
-/**
- * @deprecated since 6.0 will be removed in 7.0
- */
 class Tx_Extbase_MVC_Controller_Arguments extends \TYPO3\CMS\Extbase\Mvc\Controller\Arguments {}
 
 /**
  * @deprecated since 6.0 will be removed in 7.0
  */
-class Tx_Extbase_MVC_Controller_ArgumentsValidator extends \TYPO3\CMS\Extbase\Mvc\Controller\ArgumentsValidator {}
-
-/**
- * @deprecated since 6.0 will be removed in 7.0
- */
 class Tx_Extbase_MVC_Controller_CommandController extends \TYPO3\CMS\Extbase\Mvc\Controller\CommandController {}
 
 /**
@@ -2589,16 +2579,6 @@ class Tx_Extbase_Property_Exception_TypeConverterException extends \TYPO3\CMS\Ex
 /**
  * @deprecated since 6.0 will be removed in 7.0
  */
-class Tx_Extbase_Property_Mapper extends \TYPO3\CMS\Extbase\Property\Mapper {}
-
-/**
- * @deprecated since 6.0 will be removed in 7.0
- */
-class Tx_Extbase_Property_MappingResults extends \TYPO3\CMS\Extbase\Property\MappingResults {}
-
-/**
- * @deprecated since 6.0 will be removed in 7.0
- */
 class Tx_Extbase_Property_PropertyMapper extends \TYPO3\CMS\Extbase\Property\PropertyMapper {}
 
 /**
@@ -2779,11 +2759,6 @@ class Tx_Extbase_Scheduler_TaskExecutor extends \TYPO3\CMS\Extbase\Scheduler\Tas
 /**
  * @deprecated since 6.0 will be removed in 7.0
  */
-class Tx_Extbase_Security_Channel_RequestHashService extends \TYPO3\CMS\Extbase\Security\Channel\RequestHashService {}
-
-/**
- * @deprecated since 6.0 will be removed in 7.0
- */
 class Tx_Extbase_Security_Cryptography_HashService extends \TYPO3\CMS\Extbase\Security\Cryptography\HashService {}
 
 /**
@@ -2919,21 +2894,11 @@ class Tx_Extbase_Validation_Exception_NoValidatorFound extends \TYPO3\CMS\Extbas
 /**
  * @deprecated since 6.0 will be removed in 7.0
  */
-class Tx_Extbase_Validation_PropertyError extends \TYPO3\CMS\Extbase\Validation\PropertyError {}
-
-/**
- * @deprecated since 6.0 will be removed in 7.0
- */
 abstract class Tx_Extbase_Validation_Validator_AbstractCompositeValidator extends \TYPO3\CMS\Extbase\Validation\Validator\AbstractCompositeValidator {}
 
 /**
  * @deprecated since 6.0 will be removed in 7.0
  */
-abstract class Tx_Extbase_Validation_Validator_AbstractObjectValidator extends \TYPO3\CMS\Extbase\Validation\Validator\AbstractObjectValidator {}
-
-/**
- * @deprecated since 6.0 will be removed in 7.0
- */
 abstract class Tx_Extbase_Validation_Validator_AbstractValidator extends \TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator {}
 
 /**
@@ -3494,11 +3459,6 @@ class Tx_Fluid_ViewHelpers_Form_CheckboxViewHelper extends \TYPO3\CMS\Fluid\View
 /**
  * @deprecated since 6.0 will be removed in 7.0
  */
-class Tx_Fluid_ViewHelpers_Form_ErrorsViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\ErrorsViewHelper {}
-
-/**
- * @deprecated since 6.0 will be removed in 7.0
- */
 class Tx_Fluid_ViewHelpers_Form_HiddenViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\HiddenViewHelper {}
 
 /**
index d69ef41..e303469 100644 (file)
@@ -71,13 +71,6 @@ abstract class AbstractController implements ControllerInterface {
        protected $response;
 
        /**
-        * @var \TYPO3\CMS\Extbase\Property\Mapper
-        * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
-        * @inject
-        */
-       protected $deprecatedPropertyMapper;
-
-       /**
         * @var \TYPO3\CMS\Extbase\Validation\ValidatorResolver
         * @inject
         */
@@ -89,16 +82,7 @@ abstract class AbstractController implements ControllerInterface {
        protected $arguments;
 
        /**
-        * The results of the mapping of request arguments to controller arguments
-        *
-        * @var \TYPO3\CMS\Extbase\Property\MappingResults
-        * @api
-        * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
-        */
-       protected $argumentsMappingResults;
-
-       /**
-        * An array of supported request types.
+        * An array of supported request types. By default only web requests are supported.
         * Modify or replace this array if your specific controller supports certain
         * (additional) request types.
         *
@@ -265,9 +249,6 @@ abstract class AbstractController implements ControllerInterface {
                if ($this->arguments !== NULL) {
                        $controllerContext->setArguments($this->arguments);
                }
-               if ($this->argumentsMappingResults !== NULL) {
-                       $controllerContext->setArgumentsMappingResults($this->argumentsMappingResults);
-               }
                $controllerContext->setUriBuilder($this->uriBuilder);
 
                $controllerContext->setFlashMessageContainer($this->flashMessageContainer);
@@ -430,31 +411,14 @@ abstract class AbstractController implements ControllerInterface {
         * @return void
         */
        protected function mapRequestArgumentsToControllerArguments() {
-               if ($this->configurationManager->isFeatureEnabled('rewrittenPropertyMapper')) {
-                       /** @var \TYPO3\CMS\Extbase\Mvc\Controller\Argument $argument */
-                       foreach ($this->arguments as $argument) {
-                               $argumentName = $argument->getName();
-                               if ($this->request->hasArgument($argumentName)) {
-                                       $argument->setValue($this->request->getArgument($argumentName));
-                               } elseif ($argument->isRequired()) {
-                                       throw new \TYPO3\CMS\Extbase\Mvc\Controller\Exception\RequiredArgumentMissingException('Required argument "' . $argumentName . '" is not set.', 1298012500);
-                               }
-                       }
-               } else {
-                       // @deprecated since Extbase 1.4, will be removed two versions after Extbase 6.1
-                       $optionalPropertyNames = array();
-                       $allPropertyNames = $this->arguments->getArgumentNames();
-                       foreach ($allPropertyNames as $propertyName) {
-                               /** @var \TYPO3\CMS\Extbase\Mvc\Controller\Argument $argument */
-                               $argument = $this->arguments[$propertyName];
-                               if (!$argument->isRequired()) {
-                                       $optionalPropertyNames[] = $propertyName;
-                               }
+               /** @var \TYPO3\CMS\Extbase\Mvc\Controller\Argument $argument */
+               foreach ($this->arguments as $argument) {
+                       $argumentName = $argument->getName();
+                       if ($this->request->hasArgument($argumentName)) {
+                               $argument->setValue($this->request->getArgument($argumentName));
+                       } elseif ($argument->isRequired()) {
+                               throw new \TYPO3\CMS\Extbase\Mvc\Controller\Exception\RequiredArgumentMissingException('Required argument "' . $argumentName . '" is not set.', 1298012500);
                        }
-                       /** @var $validator ArgumentsValidator */
-                       $validator = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ArgumentsValidator');
-                       $this->deprecatedPropertyMapper->mapAndValidate($allPropertyNames, $this->request->getArguments(), $this->arguments, $optionalPropertyNames, $validator);
-                       $this->argumentsMappingResults = $this->deprecatedPropertyMapper->getMappingResults();
                }
        }
-}
\ No newline at end of file
+}
index 2180b0b..15259ed 100644 (file)
@@ -152,7 +152,6 @@ class ActionController extends AbstractController {
                        call_user_func(array($this, $actionInitializationMethodName));
                }
                $this->mapRequestArgumentsToControllerArguments();
-               $this->checkRequestHash();
                $this->controllerContext = $this->buildControllerContext();
                $this->view = $this->resolveView();
                if ($this->view !== NULL) {
@@ -200,57 +199,33 @@ class ActionController extends AbstractController {
         */
        protected function initializeActionMethodValidators() {
 
-               if (!$this->configurationManager->isFeatureEnabled('rewrittenPropertyMapper')) {
-                       // @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
+               /**
+                * @todo: add validation group support
+                * (https://review.typo3.org/#/c/13556/4)
+                */
 
-                       $parameterValidators = $this->validatorResolver->buildMethodArgumentsValidatorConjunctions(get_class($this), $this->actionMethodName);
-                       $dontValidateAnnotations = array();
-
-                       $methodTagsValues = $this->reflectionService->getMethodTagsValues(get_class($this), $this->actionMethodName);
-                       if (isset($methodTagsValues['dontvalidate'])) {
-                               $dontValidateAnnotations = $methodTagsValues['dontvalidate'];
-                       }
-
-                       /** @var \TYPO3\CMS\Extbase\Mvc\Controller\Argument $argument */
-                       foreach ($this->arguments as $argument) {
-                               $validator = $parameterValidators[$argument->getName()];
-                               if (array_search('$' . $argument->getName(), $dontValidateAnnotations) === FALSE) {
-                                       $baseValidatorConjunction = $this->validatorResolver->getBaseValidatorConjunction($argument->getDataType());
-                                       if ($baseValidatorConjunction !== NULL && $validator instanceof AbstractCompositeValidator) {
-                                               $validator->addValidator($baseValidatorConjunction);
-                                       }
-                               }
-                               $argument->setValidator($validator);
-                       }
+               $actionMethodParameters = static::getActionMethodParameters($this->objectManager);
+               if (isset($actionMethodParameters[$this->actionMethodName])) {
+                       $methodParameters = $actionMethodParameters[$this->actionMethodName];
                } else {
-                       /**
-                        * @todo: add validation group support
-                        * (https://review.typo3.org/#/c/13556/4)
-                        */
-
-                       $actionMethodParameters = static::getActionMethodParameters($this->objectManager);
-                       if (isset($actionMethodParameters[$this->actionMethodName])) {
-                               $methodParameters = $actionMethodParameters[$this->actionMethodName];
-                       } else {
-                               $methodParameters = array();
-                       }
+                       $methodParameters = array();
+               }
 
-                       /**
-                        * @todo: add resolving of $actionValidateAnnotations and pass them to
-                        * buildMethodArgumentsValidatorConjunctions as in TYPO3.Flow
-                        */
+               /**
+                * @todo: add resolving of $actionValidateAnnotations and pass them to
+                * buildMethodArgumentsValidatorConjunctions as in TYPO3.Flow
+                */
 
-                       $parameterValidators = $this->validatorResolver->buildMethodArgumentsValidatorConjunctions(get_class($this), $this->actionMethodName, $methodParameters);
-                       /** @var \TYPO3\CMS\Extbase\Mvc\Controller\Argument $argument */
-                       foreach ($this->arguments as $argument) {
-                               $validator = $parameterValidators[$argument->getName()];
+               $parameterValidators = $this->validatorResolver->buildMethodArgumentsValidatorConjunctions(get_class($this), $this->actionMethodName, $methodParameters);
+               /** @var \TYPO3\CMS\Extbase\Mvc\Controller\Argument $argument */
+               foreach ($this->arguments as $argument) {
+                       $validator = $parameterValidators[$argument->getName()];
 
-                               $baseValidatorConjunction = $this->validatorResolver->getBaseValidatorConjunction($argument->getDataType());
-                               if (count($baseValidatorConjunction) > 0  && $validator instanceof AbstractCompositeValidator) {
-                                       $validator->addValidator($baseValidatorConjunction);
-                               }
-                               $argument->setValidator($validator);
+                       $baseValidatorConjunction = $this->validatorResolver->getBaseValidatorConjunction($argument->getDataType());
+                       if (count($baseValidatorConjunction) > 0 && $validator instanceof AbstractCompositeValidator) {
+                               $validator->addValidator($baseValidatorConjunction);
                        }
+                       $argument->setValidator($validator);
                }
        }
 
@@ -279,56 +254,41 @@ class ActionController extends AbstractController {
         * @api
         */
        protected function callActionMethod() {
-               if ($this->configurationManager->isFeatureEnabled('rewrittenPropertyMapper')) {
-                       // enabled since Extbase 1.4.0.
-                       $preparedArguments = array();
-                       /** @var \TYPO3\CMS\Extbase\Mvc\Controller\Argument $argument */
-                       foreach ($this->arguments as $argument) {
-                               $preparedArguments[] = $argument->getValue();
+               $preparedArguments = array();
+               /** @var \TYPO3\CMS\Extbase\Mvc\Controller\Argument $argument */
+               foreach ($this->arguments as $argument) {
+                       $preparedArguments[] = $argument->getValue();
+               }
+               $validationResult = $this->arguments->getValidationResults();
+               if (!$validationResult->hasErrors()) {
+                       $this->emitBeforeCallActionMethodSignal($preparedArguments);
+                       $actionResult = call_user_func_array(array($this, $this->actionMethodName), $preparedArguments);
+               } else {
+                       $methodTagsValues = $this->reflectionService->getMethodTagsValues(get_class($this), $this->actionMethodName);
+                       $ignoreValidationAnnotations = array();
+                       if (isset($methodTagsValues['ignorevalidation'])) {
+                               $ignoreValidationAnnotations = $methodTagsValues['ignorevalidation'];
                        }
-                       $validationResult = $this->arguments->getValidationResults();
-                       if (!$validationResult->hasErrors()) {
-                               $this->emitBeforeCallActionMethodSignal($preparedArguments);
-                               $actionResult = call_user_func_array(array($this, $this->actionMethodName), $preparedArguments);
-                       } else {
-                               $methodTagsValues = $this->reflectionService->getMethodTagsValues(get_class($this), $this->actionMethodName);
-                               $ignoreValidationAnnotations = array();
-                               if (isset($methodTagsValues['ignorevalidation'])) {
-                                       $ignoreValidationAnnotations = $methodTagsValues['ignorevalidation'];
+                       // if there exists more errors than in ignoreValidationAnnotations_=> call error method
+                       // else => call action method
+                       $shouldCallActionMethod = TRUE;
+                       foreach ($validationResult->getSubResults() as $argumentName => $subValidationResult) {
+                               if (!$subValidationResult->hasErrors()) {
+                                       continue;
                                }
-                               // if there exists more errors than in ignoreValidationAnnotations_=> call error method
-                               // else => call action method
-                               $shouldCallActionMethod = TRUE;
-                               foreach ($validationResult->getSubResults() as $argumentName => $subValidationResult) {
-                                       if (!$subValidationResult->hasErrors()) {
-                                               continue;
-                                       }
-                                       if (array_search('$' . $argumentName, $ignoreValidationAnnotations) !== FALSE) {
-                                               continue;
-                                       }
-                                       $shouldCallActionMethod = FALSE;
+                               if (array_search('$' . $argumentName, $ignoreValidationAnnotations) !== FALSE) {
+                                       continue;
                                }
-                               if ($shouldCallActionMethod) {
-                                       $this->emitBeforeCallActionMethodSignal($preparedArguments);
-                                       $actionResult = call_user_func_array(array($this, $this->actionMethodName), $preparedArguments);
-                               } else {
-                                       $actionResult = call_user_func(array($this, $this->errorMethodName));
-                               }
-                       }
-               } else {
-                       // @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
-                       $preparedArguments = array();
-                       /** @var \TYPO3\CMS\Extbase\Mvc\Controller\Argument $argument */
-                       foreach ($this->arguments as $argument) {
-                               $preparedArguments[] = $argument->getValue();
+                               $shouldCallActionMethod = FALSE;
                        }
-                       if ($this->argumentsMappingResults->hasErrors()) {
-                               $actionResult = call_user_func(array($this, $this->errorMethodName));
-                       } else {
+                       if ($shouldCallActionMethod) {
                                $this->emitBeforeCallActionMethodSignal($preparedArguments);
                                $actionResult = call_user_func_array(array($this, $this->actionMethodName), $preparedArguments);
+                       } else {
+                               $actionResult = call_user_func(array($this, $this->errorMethodName));
                        }
                }
+
                if ($actionResult === NULL && $this->view instanceof ViewInterface) {
                        $this->response->appendContent($this->view->render());
                } elseif (is_string($actionResult) && strlen($actionResult) > 0) {
@@ -552,51 +512,24 @@ class ActionController extends AbstractController {
         */
        protected function errorAction() {
                $this->clearCacheOnError();
-               if ($this->configurationManager->isFeatureEnabled('rewrittenPropertyMapper')) {
-                       $errorFlashMessage = $this->getErrorFlashMessage();
-                       if ($errorFlashMessage !== FALSE) {
-                               $errorFlashMessageObject = new \TYPO3\CMS\Core\Messaging\FlashMessage(
-                                       $errorFlashMessage,
-                                       '',
-                                       \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR
-                               );
-                               $this->controllerContext->getFlashMessageQueue()->enqueue($errorFlashMessageObject);
-                       }
-                       if ($this->request instanceof WebRequest) {
-                               $referringRequest = $this->request->getReferringRequest();
-                               if ($referringRequest !== NULL) {
-                                       $originalRequest = clone $this->request;
-                                       $this->request->setOriginalRequest($originalRequest);
-                                       $this->request->setOriginalRequestMappingResults($this->arguments->getValidationResults());
-                                       $this->forward(
-                                               $referringRequest->getControllerActionName(),
-                                               $referringRequest->getControllerName(),
-                                               $referringRequest->getControllerExtensionName(),
-                                               $referringRequest->getArguments()
-                                       );
-                               }
-                       }
-                       $message = 'An error occurred while trying to call ' . get_class($this) . '->' . $this->actionMethodName . '().' . PHP_EOL;
-                       return $message;
-               } else {
-                       // @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
-                       $this->request->setErrors($this->argumentsMappingResults->getErrors());
-                       $errorFlashMessage = $this->getErrorFlashMessage();
-                       if ($errorFlashMessage !== FALSE) {
-                               $errorFlashMessageObject = new \TYPO3\CMS\Core\Messaging\FlashMessage(
-                                       $errorFlashMessage,
-                                       '',
-                                       \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR
-                               );
-                               $this->controllerContext->getFlashMessageQueue()->enqueue($errorFlashMessageObject);
-                       }
-                       $referrer = $this->request->getInternalArgument('__referrer');
-                       if ($referrer !== NULL) {
-                               $this->forward($referrer['actionName'], $referrer['controllerName'], $referrer['extensionName'], $this->request->getArguments());
-                       }
-                       $message = 'An error occurred while trying to call ' . get_class($this) . '->' . $this->actionMethodName . '().' . PHP_EOL;
-                       return $message;
+               $errorFlashMessage = $this->getErrorFlashMessage();
+               if ($errorFlashMessage !== FALSE) {
+                       $errorFlashMessageObject = new \TYPO3\CMS\Core\Messaging\FlashMessage(
+                               $errorFlashMessage,
+                               '',
+                               \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR
+                       );
+                       $this->controllerContext->getFlashMessageQueue()->enqueue($errorFlashMessageObject);
+               }
+               $referringRequest = $this->request->getReferringRequest();
+               if ($referringRequest !== NULL) {
+                       $originalRequest = clone $this->request;
+                       $this->request->setOriginalRequest($originalRequest);
+                       $this->request->setOriginalRequestMappingResults($this->arguments->getValidationResults());
+                       $this->forward($referringRequest->getControllerActionName(), $referringRequest->getControllerName(), $referringRequest->getControllerExtensionName(), $referringRequest->getArguments());
                }
+               $message = 'An error occurred while trying to call ' . get_class($this) . '->' . $this->actionMethodName . '().' . PHP_EOL;
+               return $message;
        }
 
        /**
@@ -612,46 +545,6 @@ class ActionController extends AbstractController {
        }
 
        /**
-        * Checks the request hash (HMAC), if arguments have been touched by the property mapper.
-        *
-        * In case the @dontverifyrequesthash-Annotation has been set, this suppresses the exception.
-        *
-        * @return void
-        * @throws \TYPO3\CMS\Extbase\Mvc\Exception\InvalidOrNoRequestHashException In case request hash checking failed
-        * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
-        */
-       protected function checkRequestHash() {
-               if ($this->configurationManager->isFeatureEnabled('rewrittenPropertyMapper')) {
-                       // If the new property mapper is enabled, the request hash is not needed anymore.
-                       return;
-               }
-               if (!$this->request instanceof WebRequest) {
-                       return;
-               }
-               // We only want to check it for now for web requests.
-               if ($this->request->isHmacVerified()) {
-                       return;
-               }
-               // all good
-               $verificationNeeded = FALSE;
-               /** @var \TYPO3\CMS\Extbase\Mvc\Controller\Argument $argument */
-               foreach ($this->arguments as $argument) {
-                       if (
-                               $argument->getOrigin() == \TYPO3\CMS\Extbase\Mvc\Controller\Argument::ORIGIN_NEWLY_CREATED
-                               || $argument->getOrigin() == \TYPO3\CMS\Extbase\Mvc\Controller\Argument::ORIGIN_PERSISTENCE_AND_MODIFIED
-                       ) {
-                               $verificationNeeded = TRUE;
-                       }
-               }
-               if ($verificationNeeded) {
-                       $methodTagsValues = $this->reflectionService->getMethodTagsValues(get_class($this), $this->actionMethodName);
-                       if (!isset($methodTagsValues['dontverifyrequesthash'])) {
-                               throw new \TYPO3\CMS\Extbase\Mvc\Exception\InvalidOrNoRequestHashException('Request hash (HMAC) checking failed. The parameter __hmac was invalid or not set, and objects were modified.', 1255082824);
-                       }
-               }
-       }
-
-       /**
         * Clear cache of current page on error. Needed because we want a re-evaluation of the data.
         * Better would be just do delete the cache for the error action, but that is not possible right now.
         *
@@ -689,4 +582,4 @@ class ActionController extends AbstractController {
 
                return $result;
        }
-}
\ No newline at end of file
+}
index a85b3dd..29b5280 100644 (file)
@@ -13,6 +13,8 @@ namespace TYPO3\CMS\Extbase\Mvc\Controller;
  *
  * The TYPO3 project - inspiring people to share!
  */
+use TYPO3\CMS\Extbase\Utility\TypeHandlingUtility;
+
 /**
  * A controller argument
  *
@@ -21,34 +23,6 @@ namespace TYPO3\CMS\Extbase\Mvc\Controller;
 class Argument {
 
        /**
-        * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-        * @inject
-        */
-       protected $objectManager;
-
-       /**
-        * @var \TYPO3\CMS\Extbase\Persistence\Generic\QueryFactory
-        * @inject
-        */
-       protected $queryFactory;
-
-       /**
-        * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
-        * @inject
-        */
-       protected $configurationManager;
-
-       /**
-        * This is the old property mapper, which has been completely rewritten for 1.4.
-        * @inject
-        *
-        * @var \TYPO3\CMS\Extbase\Property\Mapper
-        */
-       protected $deprecatedPropertyMapper;
-
-       /**
-        * The new, completely rewritten property mapper since Extbase 1.4.
-        *
         * @var \TYPO3\CMS\Extbase\Property\PropertyMapper
         * @inject
         */
@@ -61,16 +35,6 @@ class Argument {
        protected $propertyMappingConfiguration;
 
        /**
-        * @var \TYPO3\CMS\Extbase\Reflection\ReflectionService
-        */
-       protected $reflectionService;
-
-       /**
-        * @var \TYPO3\CMS\Extbase\Service\TypeHandlingService
-        */
-       protected $typeHandlingService;
-
-       /**
         * Name of this argument
         *
         * @var string
@@ -92,13 +56,6 @@ class Argument {
        protected $dataType = NULL;
 
        /**
-        * If the data type is an object, the class schema of the data type class is resolved
-        *
-        * @var \TYPO3\CMS\Extbase\Reflection\ClassSchema
-        */
-       protected $dataTypeClassSchema;
-
-       /**
         * TRUE if this argument is required
         *
         * @var boolean
@@ -134,33 +91,6 @@ class Argument {
        protected $validationResults = NULL;
 
        /**
-        * Uid for the argument, if it has one
-        *
-        * @var string
-        */
-       protected $uid = NULL;
-
-       const ORIGIN_CLIENT = 0;
-       const ORIGIN_PERSISTENCE = 1;
-       const ORIGIN_PERSISTENCE_AND_MODIFIED = 2;
-       const ORIGIN_NEWLY_CREATED = 3;
-
-       /**
-        * The origin of the argument value. This is only meaningful after argument mapping.
-        *
-        * One of the ORIGIN_* constants above
-        *
-        * @var integer
-        */
-       protected $origin = 0;
-
-       /**
-        * @var \TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface
-        * @inject
-        */
-       protected $persistenceManager;
-
-       /**
         * Constructs this controller argument
         *
         * @param string $name Name of this argument
@@ -176,26 +106,7 @@ class Argument {
                        throw new \InvalidArgumentException('$name must be a non-empty string, ' . strlen($name) . ' characters given.', 1232551853);
                }
                $this->name = $name;
-               $this->dataType = $dataType;
-       }
-
-       /**
-        * @param \TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService
-        * @return void
-        */
-       public function injectReflectionService(\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService) {
-               $this->reflectionService = $reflectionService;
-               // Check for classnames (which have at least one underscore or backslash)
-               $this->dataTypeClassSchema = strpbrk($this->dataType, '_\\') !== FALSE ? $this->reflectionService->getClassSchema($this->dataType) : NULL;
-       }
-
-       /**
-        * @param \TYPO3\CMS\Extbase\Service\TypeHandlingService $typeHandlingService
-        * @return void
-        */
-       public function injectTypeHandlingService(\TYPO3\CMS\Extbase\Service\TypeHandlingService $typeHandlingService) {
-               $this->typeHandlingService = $typeHandlingService;
-               $this->dataType = $this->typeHandlingService->normalizeType($this->dataType);
+               $this->dataType = TypeHandlingUtility::normalizeType($dataType);
        }
 
        /**
@@ -235,19 +146,6 @@ class Argument {
        }
 
        /**
-        * Sets the data type of this argument's value
-        *
-        * @param string $dataType The data type. Can be either a built-in type such as "Text" or "Integer" or a fully qualified object name
-        * @return \TYPO3\CMS\Extbase\Mvc\Controller\Argument $this
-        * @api
-        */
-       public function setDataType($dataType) {
-               $this->dataType = $dataType;
-               $this->dataTypeClassSchema = $this->reflectionService->getClassSchema($dataType);
-               return $this;
-       }
-
-       /**
         * Returns the data type of this argument's value
         *
         * @return string The data type
@@ -314,27 +212,6 @@ class Argument {
        }
 
        /**
-        * Create and set a validator chain
-        *
-        * @param array $objectNames Object names of the validators
-        * @return \TYPO3\CMS\Extbase\Mvc\Controller\Argument Returns $this (used for fluent interface)
-        * @api
-        * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
-        */
-       public function setNewValidatorConjunction(array $objectNames) {
-               if ($this->validator === NULL) {
-                       $this->validator = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ConjunctionValidator');
-               }
-               foreach ($objectNames as $objectName) {
-                       if (!class_exists($objectName)) {
-                               $objectName = 'Tx_Extbase_Validation_Validator_' . $objectName;
-                       }
-                       $this->validator->addValidator($this->objectManager->get($objectName));
-               }
-               return $this;
-       }
-
-       /**
         * Returns the set validator
         *
         * @return \TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface The set validator, NULL if none was set
@@ -345,16 +222,6 @@ class Argument {
        }
 
        /**
-        * Get the origin of the argument value. This is only meaningful after argument mapping.
-        *
-        * @return integer one of the ORIGIN_* constants
-        * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
-        */
-       public function getOrigin() {
-               return $this->origin;
-       }
-
-       /**
         * Sets the value of this argument.
         *
         * @param mixed $rawValue The value of this argument
@@ -362,83 +229,22 @@ class Argument {
         * @throws \TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentValueException if the argument is not a valid object of type $dataType
         */
        public function setValue($rawValue) {
-               if ($this->configurationManager->isFeatureEnabled('rewrittenPropertyMapper')) {
-                       if ($rawValue === NULL) {
-                               $this->value = NULL;
-                               return $this;
-                       }
-                       if (is_object($rawValue) && $rawValue instanceof $this->dataType) {
-                               $this->value = $rawValue;
-                               return $this;
-                       }
-                       $this->value = $this->propertyMapper->convert($rawValue, $this->dataType, $this->propertyMappingConfiguration);
-                       $this->validationResults = $this->propertyMapper->getMessages();
-                       if ($this->validator !== NULL) {
-                               // TODO: Validation API has also changed!!!
-                               $validationMessages = $this->validator->validate($this->value);
-                               $this->validationResults->merge($validationMessages);
-                       }
-                       return $this;
-               } else {
-                       if ($rawValue === NULL || is_object($rawValue) && $rawValue instanceof $this->dataType) {
-                               $this->value = $rawValue;
-                       } else {
-                               $this->value = $this->transformValue($rawValue);
-                       }
+               if ($rawValue === NULL) {
+                       $this->value = NULL;
                        return $this;
                }
-       }
-
-       /**
-        * Checks if the value is a UUID or an array but should be an object, i.e.
-        * the argument's data type class schema is set. If that is the case, this
-        * method tries to look up the corresponding object instead.
-        *
-        * Additionally, it maps arrays to objects in case it is a normal object.
-        *
-        * @param mixed $value The value of an argument
-        * @throws \TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentValueException
-        * @return mixed
-        * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
-        */
-       protected function transformValue($value) {
-               if (!class_exists($this->dataType)) {
-                       return $value;
-               }
-               $transformedValue = NULL;
-               if ($this->dataTypeClassSchema !== NULL) {
-                       // The target object is an Entity or ValueObject.
-                       if (is_numeric($value)) {
-                               $this->origin = self::ORIGIN_PERSISTENCE;
-                               $transformedValue = $this->findObjectByUid($value);
-                       } elseif (is_array($value)) {
-                               $this->origin = self::ORIGIN_PERSISTENCE_AND_MODIFIED;
-                               $transformedValue = $this->deprecatedPropertyMapper->map(array_keys($value), $value, $this->dataType);
-                       }
-               } else {
-                       if (!is_array($value)) {
-                               throw new \TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentValueException('The value was a simple type, so we could not map it to an object. Maybe the @entity or @valueobject annotations are missing?', 1251730701);
-                       }
-                       $this->origin = self::ORIGIN_NEWLY_CREATED;
-                       $transformedValue = $this->deprecatedPropertyMapper->map(array_keys($value), $value, $this->dataType);
+               if (is_object($rawValue) && $rawValue instanceof $this->dataType) {
+                       $this->value = $rawValue;
+                       return $this;
                }
-               if (!$transformedValue instanceof $this->dataType && ($transformedValue !== NULL || $this->isRequired())) {
-                       throw new \TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentValueException('The value must be of type "' . $this->dataType . '", but was of type "' . (is_object($transformedValue) ? get_class($transformedValue) : gettype($transformedValue)) . '".' . ($this->deprecatedPropertyMapper->getMappingResults()->hasErrors() ? '<p>' . implode('<br />', $this->deprecatedPropertyMapper->getMappingResults()->getErrors()) . '</p>' : ''), 1251730702);
+               $this->value = $this->propertyMapper->convert($rawValue, $this->dataType, $this->propertyMappingConfiguration);
+               $this->validationResults = $this->propertyMapper->getMessages();
+               if ($this->validator !== NULL) {
+                       // TODO: Validation API has also changed!!!
+                       $validationMessages = $this->validator->validate($this->value);
+                       $this->validationResults->merge($validationMessages);
                }
-               return $transformedValue;
-       }
-
-       /**
-        * Finds an object from the repository by searching for its technical UID.
-        *
-        * @param integer $uid The object's uid
-        * @return object Either the object matching the uid or, if none or more than one object was found, NULL
-        */
-       protected function findObjectByUid($uid) {
-               $query = $this->queryFactory->create($this->dataType);
-               $query->getQuerySettings()->setRespectSysLanguage(FALSE);
-               $query->getQuerySettings()->setRespectStoragePage(FALSE);
-               return $query->matching($query->equals('uid', $uid))->execute()->getFirst();
+               return $this;
        }
 
        /**
@@ -456,16 +262,6 @@ class Argument {
        }
 
        /**
-        * Checks if this argument has a value set.
-        *
-        * @return boolean TRUE if a value was set, otherwise FALSE
-        * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
-        */
-       public function isValue() {
-               return $this->value !== NULL;
-       }
-
-       /**
         * Return the Property Mapping Configuration used for this argument; can be used by the initialize*action to modify the Property Mapping.
         *
         * @return \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfiguration
diff --git a/typo3/sysext/extbase/Classes/Mvc/Controller/ArgumentError.php b/typo3/sysext/extbase/Classes/Mvc/Controller/ArgumentError.php
deleted file mode 100644 (file)
index 5499129..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extbase\Mvc\Controller;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-/**
- * This object holds validation errors for one argument.
- *
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
- * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
- */
-class ArgumentError extends \TYPO3\CMS\Extbase\Validation\PropertyError {
-
-       /**
-        * @var string The default (english) error message.
-        */
-       protected $message = 'Validation errors for argument "%s"';
-
-       /**
-        * @var string The error code
-        */
-       protected $code = 1245107351;
-}
diff --git a/typo3/sysext/extbase/Classes/Mvc/Controller/ArgumentsValidator.php b/typo3/sysext/extbase/Classes/Mvc/Controller/ArgumentsValidator.php
deleted file mode 100644 (file)
index 39e6df5..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extbase\Mvc\Controller;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-/**
- * A validator for controller arguments
- *
- * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1 Is only needed for old property mapper.
- */
-class ArgumentsValidator extends \TYPO3\CMS\Extbase\Validation\Validator\AbstractObjectValidator {
-
-       /**
-        * Checks if the given value (ie. an Arguments object) is valid.
-        *
-        * If at least one error occurred, the result is FALSE and any errors can
-        * be retrieved through the getErrors() method.
-        *
-        * @param object $arguments The arguments object that should be validated
-        * @throws \InvalidArgumentException
-        * @return boolean TRUE if all arguments are valid, FALSE if an error occurred
-        */
-       public function isValid($arguments) {
-               if (!$arguments instanceof \TYPO3\CMS\Extbase\Mvc\Controller\Arguments) {
-                       throw new \InvalidArgumentException('Expected TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Arguments, ' . gettype($arguments) . ' given.', 1241079561);
-               }
-               $this->errors = array();
-               $result = TRUE;
-               foreach ($arguments->getArgumentNames() as $argumentName) {
-                       if ($this->isPropertyValid($arguments, $argumentName) === FALSE) {
-                               $result = FALSE;
-                       }
-               }
-               return $result;
-       }
-
-       /**
-        * Checks the given object can be validated by the validator implementation
-        *
-        * @param object $object The object to be checked
-        * @return boolean TRUE if this validator can validate instances of the given object or FALSE if it can't
-        */
-       public function canValidate($object) {
-               return $object instanceof \TYPO3\CMS\Extbase\Mvc\Controller\Arguments;
-       }
-
-       /**
-        * Checks if the specified property (ie. the argument) of the given arguments
-        * object is valid. Validity is checked by first invoking the validation chain
-        * defined in the argument object.
-        *
-        * If at least one error occurred, the result is FALSE.
-        *
-        * @param object $arguments The arguments object containing the property (argument) to validate
-        * @param string $argumentName Name of the property (ie. name of the argument) to validate
-        * @throws \InvalidArgumentException
-        * @return boolean TRUE if the argument is valid, FALSE if an error occurred
-        */
-       public function isPropertyValid($arguments, $argumentName) {
-               if (!$arguments instanceof \TYPO3\CMS\Extbase\Mvc\Controller\Arguments) {
-                       throw new \InvalidArgumentException('Expected TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Arguments, ' . gettype($arguments) . ' given.', 1241079562);
-               }
-               /** @var Argument $argument */
-               $argument = $arguments[$argumentName];
-               $validatorConjunction = $argument->getValidator();
-               if ($validatorConjunction === NULL) {
-                       return TRUE;
-               }
-               $argumentValue = $argument->getValue();
-               if ($argumentValue === $argument->getDefaultValue() && $argument->isRequired() === FALSE) {
-                       return TRUE;
-               }
-               if ($validatorConjunction->isValid($argumentValue) === FALSE) {
-                       $this->addErrorsForArgument($validatorConjunction->getErrors(), $argumentName);
-                       return FALSE;
-               }
-               return TRUE;
-       }
-
-       /**
-        * Adds the given errors to $this->errors and creates an ArgumentError
-        * instance if needed.
-        *
-        * @param array $errors Array of \TYPO3\CMS\Extbase\Validation\Error
-        * @param string $argumentName Name of the argument to add errors for
-        * @return void
-        */
-       protected function addErrorsForArgument(array $errors, $argumentName) {
-               if (!isset($this->errors[$argumentName])) {
-                       $this->errors[$argumentName] = new \TYPO3\CMS\Extbase\Mvc\Controller\ArgumentError($argumentName);
-               }
-               $this->errors[$argumentName]->addErrors($errors);
-       }
-}
index 8544a0b..10fbb35 100644 (file)
@@ -37,12 +37,6 @@ class ControllerContext {
        protected $arguments;
 
        /**
-        * @var \TYPO3\CMS\Extbase\Property\MappingResults
-        * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
-        */
-       protected $argumentsMappingResults;
-
-       /**
         * @var \TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder
         */
        protected $uriBuilder;
@@ -136,28 +130,6 @@ class ControllerContext {
        }
 
        /**
-        * Set the arguments mapping results of the controller
-        *
-        * @param \TYPO3\CMS\Extbase\Property\MappingResults $argumentsMappingResults
-        * @return void
-        * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
-        */
-       public function setArgumentsMappingResults(\TYPO3\CMS\Extbase\Property\MappingResults $argumentsMappingResults) {
-               $this->argumentsMappingResults = $argumentsMappingResults;
-       }
-
-       /**
-        * Get the arguments mapping results of the controller
-        *
-        * @return \TYPO3\CMS\Extbase\Property\MappingResults
-        * @api
-        * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
-        */
-       public function getArgumentsMappingResults() {
-               return $this->argumentsMappingResults;
-       }
-
-       /**
         * @param \TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder $uriBuilder
         * @return void
         */
index 7739e1f..9afc660 100644 (file)
@@ -111,12 +111,6 @@ class Request implements RequestInterface {
        protected $originalRequestMappingResults = NULL;
 
        /**
-        * @var array Errors that occurred during this request
-        * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
-        */
-       protected $errors = array();
-
-       /**
         * Sets the dispatched flag
         *
         * @param boolean $flag If this request has been dispatched
@@ -500,28 +494,6 @@ class Request implements RequestInterface {
        }
 
        /**
-        * Set errors that occurred during the request (e.g. argument mapping errors)
-        *
-        * @param array $errors An array of \TYPO3\CMS\Extbase\Error\Error objects
-        *
-        * @return void
-        * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
-        */
-       public function setErrors(array $errors) {
-               $this->errors = $errors;
-       }
-
-       /**
-        * Get errors that occurred during the request (e.g. argument mapping errors)
-        *
-        * @return array The errors that occurred during the request
-        * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
-        */
-       public function getErrors() {
-               return $this->errors;
-       }
-
-       /**
         * Returns the original request. Filled only if a property mapping error occurred.
         *
         * @return \TYPO3\CMS\Extbase\Mvc\Request the original request.
index cba5d53..e70d6ee 100644 (file)
@@ -25,9 +25,6 @@ class BackendRequestHandler extends AbstractRequestHandler {
         */
        public function handleRequest() {
                $request = $this->requestBuilder->build();
-               /** @var $requestHashService \TYPO3\CMS\Extbase\Security\Channel\RequestHashService */
-               $requestHashService = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Security\\Channel\\RequestHashService');
-               $requestHashService->verifyRequest($request);
                /** @var $response \TYPO3\CMS\Extbase\Mvc\ResponseInterface */
                $response = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Response');
                $this->dispatcher->dispatch($request, $response);
index 00b8e40..86a0352 100644 (file)
@@ -37,9 +37,6 @@ class FrontendRequestHandler extends AbstractRequestHandler {
         */
        public function handleRequest() {
                $request = $this->requestBuilder->build();
-               /** @var $requestHashService \TYPO3\CMS\Extbase\Security\Channel\RequestHashService */
-               $requestHashService = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Security\\Channel\\RequestHashService');
-               $requestHashService->verifyRequest($request);
                if ($this->extensionService->isActionCacheable(NULL, NULL, $request->getControllerName(), $request->getControllerActionName())) {
                        $request->setIsCached(TRUE);
                } else {
index 9ec883c..9f2a80e 100644 (file)
@@ -47,12 +47,6 @@ class Request extends \TYPO3\CMS\Extbase\Mvc\Request {
        protected $baseUri;
 
        /**
-        * @var boolean TRUE if the HMAC of this request could be verified, FALSE otherwise
-        * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
-        */
-       protected $hmacVerified = FALSE;
-
-       /**
         * @var boolean TRUE if the current request is cached, false otherwise.
         */
        protected $isCached = FALSE;
@@ -138,27 +132,6 @@ class Request extends \TYPO3\CMS\Extbase\Mvc\Request {
        }
 
        /**
-        * Could the request be verified via a HMAC?
-        *
-        * @param boolean $hmacVerified TRUE if request could be verified, FALSE otherwise
-        * @return void
-        * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
-        */
-       public function setHmacVerified($hmacVerified) {
-               $this->hmacVerified = (boolean) $hmacVerified;
-       }
-
-       /**
-        * Could the request be verified via a HMAC?
-        *
-        * @return boolean TRUE if request could be verified, FALSE otherwise
-        * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
-        */
-       public function isHmacVerified() {
-               return $this->hmacVerified;
-       }
-
-       /**
         * Set if the current request is cached.
         *
         * @param boolean $isCached
diff --git a/typo3/sysext/extbase/Classes/Property/Mapper.php b/typo3/sysext/extbase/Classes/Property/Mapper.php
deleted file mode 100644 (file)
index ad96d3e..0000000
+++ /dev/null
@@ -1,306 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extbase\Property;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-/**
- * The Property Mapper maps properties from a source onto a given target object, often a
- * (domain-) model. Which properties are required and how they should be filtered can
- * be customized.
- *
- * During the mapping process, the property values are validated and the result of this
- * validation can be queried.
- *
- * The following code would map the property of the source array to the target:
- *
- * $target = new ArrayObject();
- * $source = new ArrayObject(
- * array(
- * 'someProperty' => 'SomeValue'
- * )
- * );
- * $mapper->mapAndValidate(array('someProperty'), $source, $target);
- *
- * Now the target object equals the source object.
- *
- * @api
- * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
- */
-class Mapper implements \TYPO3\CMS\Core\SingletonInterface {
-
-       /**
-        * Results of the last mapping operation
-        *
-        * @var \TYPO3\CMS\Extbase\Property\MappingResults
-        */
-       protected $mappingResults;
-
-       /**
-        * @var \TYPO3\CMS\Extbase\Validation\ValidatorResolver
-        * @inject
-        */
-       protected $validatorResolver;
-
-       /**
-        * @var \TYPO3\CMS\Extbase\Reflection\ReflectionService
-        * @inject
-        */
-       protected $reflectionService;
-
-       /**
-        * @var \TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface
-        * @inject
-        */
-       protected $persistenceManager;
-
-       /**
-        * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-        * @inject
-        */
-       protected $objectManager;
-
-       /**
-        * @var \TYPO3\CMS\Extbase\Persistence\Generic\QueryFactoryInterface
-        * @inject
-        */
-       protected $queryFactory;
-
-       /**
-        * Maps the given properties to the target object and validates the properties according to the defined
-        * validators. If the result object is not valid, the operation will be undone (the target object remains
-        * unchanged) and this method returns FALSE.
-        *
-        * If in doubt, always prefer this method over the map() method because skipping validation can easily become
-        * a security issue.
-        *
-        * @param array $propertyNames Names of the properties to map.
-        * @param mixed $source Source containing the properties to map to the target object. Must either be an array, ArrayObject or any other object.
-        * @param object $target The target object
-        * @param array $optionalPropertyNames Names of optional properties. If a property is specified here and it doesn't exist in the source, no error is issued.
-        * @param \TYPO3\CMS\Extbase\Validation\Validator\ObjectValidatorInterface $targetObjectValidator A validator used for validating the target object
-        *
-        * @return boolean TRUE if the mapped properties are valid, otherwise FALSE
-        * @see getMappingResults()
-        * @see map()
-        * @api
-        */
-       public function mapAndValidate(array $propertyNames, $source, $target, $optionalPropertyNames = array(), \TYPO3\CMS\Extbase\Validation\Validator\ObjectValidatorInterface $targetObjectValidator) {
-               $backupProperties = array();
-               $this->map($propertyNames, $source, $backupProperties, $optionalPropertyNames);
-               if ($this->mappingResults->hasErrors()) {
-                       return FALSE;
-               }
-               $this->map($propertyNames, $source, $target, $optionalPropertyNames);
-               if ($this->mappingResults->hasErrors()) {
-                       return FALSE;
-               }
-               if ($targetObjectValidator->isValid($target) !== TRUE) {
-                       $this->addErrorsFromObjectValidator($targetObjectValidator->getErrors());
-                       $backupMappingResult = $this->mappingResults;
-                       $this->map($propertyNames, $backupProperties, $source, $optionalPropertyNames);
-                       $this->mappingResults = $backupMappingResult;
-               }
-               return !$this->mappingResults->hasErrors();
-       }
-
-       /**
-        * Add errors to the mapping result from an object validator (property errors).
-        *
-        * @param array $errors Array of \TYPO3\CMS\Extbase\Validation\PropertyError
-        * @return void
-        */
-       protected function addErrorsFromObjectValidator($errors) {
-               foreach ($errors as $error) {
-                       if ($error instanceof \TYPO3\CMS\Extbase\Validation\PropertyError) {
-                               $propertyName = $error->getPropertyName();
-                               $this->mappingResults->addError($error, $propertyName);
-                       }
-               }
-       }
-
-       /**
-        * Maps the given properties to the target object WITHOUT VALIDATING THE RESULT.
-        * If the properties could be set, this method returns TRUE, otherwise FALSE.
-        * Returning TRUE does not mean that the target object is valid and secure!
-        *
-        * Only use this method if you're sure that you don't need validation!
-        *
-        * @param array $propertyNames Names of the properties to map.
-        * @param mixed $source Source containing the properties to map to the target object. Must either be an array, ArrayObject or any other object.
-        * @param object|array|string $target The target object
-        * @param array $optionalPropertyNames Names of optional properties. If a property is specified here and it doesn't exist in the source, no error is issued.
-        * @throws Exception\InvalidSourceException
-        * @throws Exception\InvalidTargetException
-        * @return boolean TRUE if the properties could be mapped, otherwise FALSE, or the object in case it could be resolved
-        * @see mapAndValidate()
-        * @api
-        */
-       public function map(array $propertyNames, $source, $target, $optionalPropertyNames = array()) {
-               if (!is_object($source) && !is_array($source)) {
-                       throw new \TYPO3\CMS\Extbase\Property\Exception\InvalidSourceException('The source object must be a valid object or array, ' . gettype($target) . ' given.', 1187807099);
-               }
-               if (is_string($target) && strpbrk($target, '_\\') !== FALSE) {
-                       return $this->transformToObject($source, $target, '--none--');
-               }
-               if (!is_object($target) && !is_array($target)) {
-                       throw new \TYPO3\CMS\Extbase\Property\Exception\InvalidTargetException('The target object must be a valid object or array, ' . gettype($target) . ' given.', 1187807100);
-               }
-               $this->mappingResults = new \TYPO3\CMS\Extbase\Property\MappingResults();
-               if (is_object($target)) {
-                       $targetClassSchema = $this->reflectionService->getClassSchema(get_class($target));
-               } else {
-                       $targetClassSchema = NULL;
-               }
-               foreach ($propertyNames as $propertyName) {
-                       $propertyValue = NULL;
-                       if (is_array($source) || $source instanceof \ArrayAccess) {
-                               if (isset($source[$propertyName])) {
-                                       $propertyValue = $source[$propertyName];
-                               }
-                       } else {
-                               $propertyValue = \TYPO3\CMS\Extbase\Reflection\ObjectAccess::getProperty($source, $propertyName);
-                       }
-                       if ($propertyValue === NULL && !in_array($propertyName, $optionalPropertyNames)) {
-                               $this->mappingResults->addError(new \TYPO3\CMS\Extbase\Error\Error("Required property '{$propertyName}' does not exist.", 1236785359), $propertyName);
-                       } else {
-                               if ($targetClassSchema !== NULL && $targetClassSchema->hasProperty($propertyName)) {
-                                       $propertyMetaData = $targetClassSchema->getProperty($propertyName);
-                                       if (in_array($propertyMetaData['type'], array('array', 'ArrayObject', 'TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage', 'Tx_Extbase_Persistence_ObjectStorage'), TRUE) && (strpbrk($propertyMetaData['elementType'], '_\\') !== FALSE || $propertyValue === '')) {
-                                               $objects = array();
-                                               if (is_array($propertyValue)) {
-                                                       foreach ($propertyValue as $value) {
-                                                               $transformedObject = $this->transformToObject($value, $propertyMetaData['elementType'], $propertyName);
-                                                               if ($transformedObject !== NULL) {
-                                                                       $objects[] = $transformedObject;
-                                                               }
-                                                       }
-                                               }
-                                               // make sure we hand out what is expected
-                                               if ($propertyMetaData['type'] === 'ArrayObject') {
-                                                       $propertyValue = new \ArrayObject($objects);
-                                               } elseif (in_array($propertyMetaData['type'], array('TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage', 'Tx_Extbase_Persistence_ObjectStorage'), TRUE)) {
-                                                       $propertyValue = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
-                                                       foreach ($objects as $object) {
-                                                               $propertyValue->attach($object);
-                                                       }
-                                               } else {
-                                                       $propertyValue = $objects;
-                                               }
-                                       } elseif ($propertyMetaData['type'] === 'DateTime' || strpbrk($propertyMetaData['type'], '_\\') !== FALSE) {
-                                               $propertyValue = $this->transformToObject($propertyValue, $propertyMetaData['type'], $propertyName);
-                                               if ($propertyValue === NULL) {
-                                                       continue;
-                                               }
-                                       }
-                               } elseif (
-                                       $targetClassSchema !== NULL
-                                       && is_subclass_of($target, 'TYPO3\\CMS\\Extbase\\DomainObject\\AbstractEntity')
-                                       && is_subclass_of($target, 'TYPO3\\CMS\\Extbase\\DomainObject\\AbstractValueObject')
-                               ) {
-                                       $this->mappingResults->addError(new \TYPO3\CMS\Extbase\Error\Error("Property '{$propertyName}' does not exist in target class schema.", 1251813614), $propertyName);
-                               }
-                               if (is_array($target)) {
-                                       $target[$propertyName] = $propertyValue;
-                               } elseif (\TYPO3\CMS\Extbase\Reflection\ObjectAccess::setProperty($target, $propertyName, $propertyValue) === FALSE) {
-                                       $this->mappingResults->addError(new \TYPO3\CMS\Extbase\Error\Error("Property '{$propertyName}' could not be set.", 1236783102), $propertyName);
-                               }
-                       }
-               }
-               return !$this->mappingResults->hasErrors();
-       }
-
-       /**
-        * Transforms strings with UUIDs or arrays with UUIDs/identity properties
-        * into the requested type, if possible.
-        *
-        * @param mixed $propertyValue The value to transform, string or array
-        * @param string $targetType The type to transform to
-        * @param string $propertyName In case of an error we add this to the error message
-        * @throws Exception\InvalidTargetException
-        * @throws \InvalidArgumentException
-        * @return object The object, when no transformation was possible this may return NULL as well
-        */
-       protected function transformToObject($propertyValue, $targetType, $propertyName) {
-               if ($targetType === 'DateTime' || is_subclass_of($targetType, 'DateTime')) {
-                       if ($propertyValue === '') {
-                               $propertyValue = NULL;
-                       } else {
-                               try {
-                                       $propertyValue = $this->objectManager->get($targetType, $propertyValue);
-                               } catch (\Exception $e) {
-                                       $propertyValue = NULL;
-                               }
-                       }
-               } else {
-                       if (ctype_digit((string)$propertyValue)) {
-                               $propertyValue = $this->findObjectByUid($targetType, $propertyValue);
-                               if ($propertyValue === FALSE) {
-                                       $this->mappingResults->addError(new \TYPO3\CMS\Extbase\Error\Error('Querying the repository for the specified object with UUID ' . $propertyValue . ' was not successful.', 1249379517), $propertyName);
-                               }
-                       } elseif (is_array($propertyValue)) {
-                               if (isset($propertyValue['__identity'])) {
-                                       $existingObject = $this->findObjectByUid($targetType, $propertyValue['__identity']);
-                                       if ($existingObject === FALSE) {
-                                               throw new \TYPO3\CMS\Extbase\Property\Exception\InvalidTargetException('Querying the repository for the specified object was not successful.', 1237305720);
-                                       }
-                                       unset($propertyValue['__identity']);
-                                       if (count($propertyValue) === 0) {
-                                               $propertyValue = $existingObject;
-                                       } elseif ($existingObject !== NULL) {
-                                               $newObject = clone $existingObject;
-                                               if ($this->map(array_keys($propertyValue), $propertyValue, $newObject)) {
-                                                       $propertyValue = $newObject;
-                                               } else {
-                                                       $propertyValue = NULL;
-                                               }
-                                       }
-                               } else {
-                                       $newObject = $this->objectManager->get($targetType);
-                                       if ($this->map(array_keys($propertyValue), $propertyValue, $newObject)) {
-                                               $propertyValue = $newObject;
-                                       } else {
-                                               $propertyValue = NULL;
-                                       }
-                               }
-                       } else {
-                               throw new \InvalidArgumentException('transformToObject() accepts only numeric values and arrays.', 1251814355);
-                       }
-               }
-               return $propertyValue;
-       }
-
-       /**
-        * Returns the results of the last mapping operation.
-        *
-        * @return \TYPO3\CMS\Extbase\Property\MappingResults The mapping results (or NULL if no mapping has been carried out yet)
-        * @api
-        */
-       public function getMappingResults() {
-               return $this->mappingResults;
-       }
-
-       /**
-        * Finds an object from the repository by searching for its technical UID.
-        * TODO This is duplicated code; see Argument class
-        *
-        * @param string $dataType the data type to fetch
-        * @param integer $uid The object's uid
-        * @return object Either the object matching the uid or, if none or more than one object was found, NULL
-        */
-       protected function findObjectByUid($dataType, $uid) {
-               $query = $this->queryFactory->create($dataType);
-               $query->getQuerySettings()->setRespectSysLanguage(FALSE);
-               $query->getQuerySettings()->setRespectStoragePage(FALSE);
-               return $query->matching($query->equals('uid', (int)$uid))->execute()->getFirst();
-       }
-}
diff --git a/typo3/sysext/extbase/Classes/Property/MappingResults.php b/typo3/sysext/extbase/Classes/Property/MappingResults.php
deleted file mode 100644 (file)
index 53d2352..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extbase\Property;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-/**
- * The Mapping Results
- *
- * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
- */
-class MappingResults {
-
-       /**
-        * @var array An array of the occurred errors
-        */
-       protected $errors = array();
-
-       /**
-        * @var array An array of the occurred warnings
-        */
-       protected $warnings = array();
-
-       /**
-        * Adds an error to the mapping results. This might be for example a
-        * validation or mapping error
-        *
-        * @param \TYPO3\CMS\Extbase\Error\Error $error The occurred error
-        * @param string $propertyName The name of the property which caused the error
-        */
-       public function addError(\TYPO3\CMS\Extbase\Error\Error $error, $propertyName) {
-               $this->errors[$propertyName] = $error;
-       }
-
-       /**
-        * Returns all errors that occurred so far
-        *
-        * @return array Array of \TYPO3\CMS\Extbase\Error\Error
-        */
-       public function getErrors() {
-               return $this->errors;
-       }
-
-       /**
-        * Returns true if any error was recognized
-        *
-        * @return boolean True if an error occurred
-        */
-       public function hasErrors() {
-               return count($this->errors) > 0;
-       }
-
-       /**
-        * Adds a warning to the mapping results. This might be for example a
-        * property that could not be mapped but wasn't marked as required.
-        *
-        * @param string $warning The occurred warning
-        * @param string $propertyName The name of the property which caused the error
-        */
-       public function addWarning($warning, $propertyName) {
-               $this->warnings[$propertyName] = $warning;
-       }
-
-       /**
-        * Returns all warnings that occurred so far
-        *
-        * @return array Array of warnings
-        */
-       public function getWarnings() {
-               return $this->warnings;
-       }
-
-       /**
-        * Returns TRUE if any warning was recognized
-        *
-        * @return boolean TRUE if a warning occurred
-        */
-       public function hasWarnings() {
-               return count($this->warnings) > 0;
-       }
-}
index 735f4ad..5adb82f 100644 (file)
@@ -20,6 +20,8 @@ namespace TYPO3\CMS\Extbase\Property;
  *                                                                        *
  * The TYPO3 project - inspiring people to share!                         *
  *                                                                        */
+use TYPO3\CMS\Extbase\Property\TypeConverter\AbstractTypeConverter;
+
 /**
  * The Property Mapper transforms simple types (arrays, strings, integers, floats, booleans) to objects or other simple types.
  * It is used most prominently to map incoming HTTP arguments to objects.
@@ -72,7 +74,7 @@ class PropertyMapper implements \TYPO3\CMS\Core\SingletonInterface {
                        $typeConverter = $this->objectManager->get($typeConverterClassName);
                        foreach ($typeConverter->getSupportedSourceTypes() as $supportedSourceType) {
                                if (isset($this->typeConverters[$supportedSourceType][$typeConverter->getSupportedTargetType()][$typeConverter->getPriority()])) {
-                                       throw new \TYPO3\CMS\Extbase\Property\Exception\DuplicateTypeConverterException('There exist at least two converters which handle the conversion from "' . $supportedSourceType . '" to "' . $typeConverter->getSupportedTargetType() . '" with priority "' . $typeConverter->getPriority() . '": ' . get_class($this->typeConverters[$supportedSourceType][$typeConverter->getSupportedTargetType()][$typeConverter->getPriority()]) . ' and ' . get_class($typeConverter), 1297951378);
+                                       throw new Exception\DuplicateTypeConverterException('There exist at least two converters which handle the conversion from "' . $supportedSourceType . '" to "' . $typeConverter->getSupportedTargetType() . '" with priority "' . $typeConverter->getPriority() . '": ' . get_class($this->typeConverters[$supportedSourceType][$typeConverter->getSupportedTargetType()][$typeConverter->getPriority()]) . ' and ' . get_class($typeConverter), 1297951378);
                                }
                                $this->typeConverters[$supportedSourceType][$typeConverter->getSupportedTargetType()][$typeConverter->getPriority()] = $typeConverter;
                        }
@@ -84,12 +86,12 @@ class PropertyMapper implements \TYPO3\CMS\Core\SingletonInterface {
         *
         * @param mixed $source the source data to map. MUST be a simple type, NO object allowed!
         * @param string $targetType The type of the target; can be either a class name or a simple type.
-        * @param \TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationInterface $configuration Configuration for the property mapping. If NULL, the PropertyMappingConfigurationBuilder will create a default configuration.
+        * @param PropertyMappingConfigurationInterface $configuration Configuration for the property mapping. If NULL, the PropertyMappingConfigurationBuilder will create a default configuration.
         * @throws Exception
         * @return mixed an instance of $targetType
         * @api
         */
-       public function convert($source, $targetType, \TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationInterface $configuration = NULL) {
+       public function convert($source, $targetType, PropertyMappingConfigurationInterface $configuration = NULL) {
                if ($configuration === NULL) {
                        $configuration = $this->configurationBuilder->build();
                }
@@ -103,7 +105,7 @@ class PropertyMapper implements \TYPO3\CMS\Core\SingletonInterface {
 
                        return $result;
                } catch (\Exception $e) {
-                       throw new \TYPO3\CMS\Extbase\Property\Exception('Exception while property mapping at property path "' . implode('.', $currentPropertyPath) . '":' . $e->getMessage(), 1297759968, $e);
+                       throw new Exception('Exception while property mapping at property path "' . implode('.', $currentPropertyPath) . '":' . $e->getMessage(), 1297759968, $e);
                }
        }
 
@@ -122,12 +124,13 @@ class PropertyMapper implements \TYPO3\CMS\Core\SingletonInterface {
         *
         * @param mixed $source the source data to map. MUST be a simple type, NO object allowed!
         * @param string $targetType The type of the target; can be either a class name or a simple type.
-        * @param \TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationInterface $configuration Configuration for the property mapping.
+        * @param PropertyMappingConfigurationInterface $configuration Configuration for the property mapping.
         * @param array &$currentPropertyPath The property path currently being mapped; used for knowing the context in case an exception is thrown.
         * @throws Exception\TypeConverterException
+        * @throws Exception\InvalidPropertyMappingConfigurationException
         * @return mixed an instance of $targetType
         */
-       protected function doMapping($source, $targetType, \TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationInterface $configuration, &$currentPropertyPath) {
+       protected function doMapping($source, $targetType, PropertyMappingConfigurationInterface $configuration, &$currentPropertyPath) {
                if (is_object($source)) {
                        $targetType = $this->parseCompositeType($targetType);
                        if ($source instanceof $targetType) {
@@ -143,7 +146,7 @@ class PropertyMapper implements \TYPO3\CMS\Core\SingletonInterface {
                $targetType = $typeConverter->getTargetTypeForSource($source, $targetType, $configuration);
 
                if (!is_object($typeConverter) || !$typeConverter instanceof \TYPO3\CMS\Extbase\Property\TypeConverterInterface) {
-                       throw new \TYPO3\CMS\Extbase\Property\Exception\TypeConverterException('Type converter for "' . $source . '" -> "' . $targetType . '" not found.');
+                       throw new Exception\TypeConverterException('Type converter for "' . $source . '" -> "' . $targetType . '" not found.');
                }
 
                $convertedChildProperties = array();
@@ -157,7 +160,7 @@ class PropertyMapper implements \TYPO3\CMS\Core\SingletonInterface {
                                if ($configuration->shouldSkipUnknownProperties()) {
                                        continue;
                                }
-                               throw new \TYPO3\CMS\Extbase\Property\Exception\InvalidPropertyMappingConfigurationException('It is not allowed to map property "' . $targetPropertyName . '". You need to use $propertyMappingConfiguration->allowProperties(\'' . $targetPropertyName . '\') to enable mapping of this property.', 1355155913);
+                               throw new Exception\InvalidPropertyMappingConfigurationException('It is not allowed to map property "' . $targetPropertyName . '". You need to use $propertyMappingConfiguration->allowProperties(\'' . $targetPropertyName . '\') to enable mapping of this property.', 1355155913);
                        }
 
                        $targetPropertyType = $typeConverter->getTypeOfChildProperty($targetType, $targetPropertyName, $configuration);
@@ -185,12 +188,12 @@ class PropertyMapper implements \TYPO3\CMS\Core\SingletonInterface {
         *
         * @param mixed $source
         * @param string $targetType
-        * @param \TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationInterface $configuration
+        * @param PropertyMappingConfigurationInterface $configuration
         * @throws Exception\TypeConverterException
         * @throws Exception\InvalidTargetException
         * @return \TYPO3\CMS\Extbase\Property\TypeConverterInterface Type Converter which should be used to convert between $source and $targetType.
         */
-       protected function findTypeConverter($source, $targetType, \TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationInterface $configuration) {
+       protected function findTypeConverter($source, $targetType, PropertyMappingConfigurationInterface $configuration) {
                if ($configuration->getTypeConverter() !== NULL) {
                        return $configuration->getTypeConverter();
                }
@@ -198,7 +201,7 @@ class PropertyMapper implements \TYPO3\CMS\Core\SingletonInterface {
                $sourceType = $this->determineSourceType($source);
 
                if (!is_string($targetType)) {
-                       throw new \TYPO3\CMS\Extbase\Property\Exception\InvalidTargetException('The target type was no string, but of type "' . gettype($targetType) . '"', 1297941727);
+                       throw new Exception\InvalidTargetException('The target type was no string, but of type "' . gettype($targetType) . '"', 1297941727);
                }
 
                $targetType = $this->parseCompositeType($targetType);
@@ -217,7 +220,7 @@ class PropertyMapper implements \TYPO3\CMS\Core\SingletonInterface {
                }
 
                if ($converter === NULL) {
-                       throw new \TYPO3\CMS\Extbase\Property\Exception\TypeConverterException('No converter found which can be used to convert from "' . $sourceType . '" to "' . $targetType . '".');
+                       throw new Exception\TypeConverterException('No converter found which can be used to convert from "' . $sourceType . '" to "' . $targetType . '".');
                }
 
                return $converter;
@@ -234,7 +237,7 @@ class PropertyMapper implements \TYPO3\CMS\Core\SingletonInterface {
         */
        protected function findFirstEligibleTypeConverterInObjectHierarchy($source, $sourceType, $targetClass) {
                if (!class_exists($targetClass) && !interface_exists($targetClass)) {
-                       throw new \TYPO3\CMS\Extbase\Property\Exception\InvalidTargetException('Could not find a suitable type converter for "' . $targetClass . '" because no such class or interface exists.', 1297948764);
+                       throw new Exception\InvalidTargetException('Could not find a suitable type converter for "' . $targetClass . '" because no such class or interface exists.', 1297948764);
                }
 
                if (!isset($this->typeConverters[$sourceType])) {
@@ -285,6 +288,7 @@ class PropertyMapper implements \TYPO3\CMS\Core\SingletonInterface {
                }
                krsort($converters);
                reset($converters);
+               /** @var AbstractTypeConverter $converter */
                foreach ($converters as $converter) {
                        if ($converter->canConvertFrom($source, $targetType)) {
                                return $converter;
@@ -305,7 +309,7 @@ class PropertyMapper implements \TYPO3\CMS\Core\SingletonInterface {
                        if (isset($convertersForSource[$implementedInterface])) {
                                foreach ($convertersForSource[$implementedInterface] as $priority => $converter) {
                                        if (isset($convertersForInterface[$priority])) {
-                                               throw new \TYPO3\CMS\Extbase\Property\Exception\DuplicateTypeConverterException('There exist at least two converters which handle the conversion to an interface with priority "' . $priority . '". ' . get_class($convertersForInterface[$priority]) . ' and ' . get_class($converter), 1297951338);
+                                               throw new Exception\DuplicateTypeConverterException('There exist at least two converters which handle the conversion to an interface with priority "' . $priority . '". ' . get_class($convertersForInterface[$priority]) . ' and ' . get_class($converter), 1297951338);
                                        }
                                        $convertersForInterface[$priority] = $converter;
                                }
@@ -333,7 +337,7 @@ class PropertyMapper implements \TYPO3\CMS\Core\SingletonInterface {
                } elseif (is_bool($source)) {
                        return 'boolean';
                } else {
-                       throw new \TYPO3\CMS\Extbase\Property\Exception\InvalidSourceException('The source is not of type string, array, float, integer or boolean, but of type "' . gettype($source) . '"', 1297773150);
+                       throw new Exception\InvalidSourceException('The source is not of type string, array, float, integer or boolean, but of type "' . gettype($source) . '"', 1297773150);
                }
        }
 
index 932074c..ae69ba4 100644 (file)
@@ -28,7 +28,7 @@ use TYPO3\CMS\Core\Core\ClassLoader;
  *
  * @api
  */
-class PropertyMappingConfiguration implements \TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationInterface {
+class PropertyMappingConfiguration implements PropertyMappingConfigurationInterface {
 
        /**
         * Placeholder in property paths for multi-valued types
@@ -48,7 +48,7 @@ class PropertyMappingConfiguration implements \TYPO3\CMS\Extbase\Property\Proper
        /**
         * Stores the configuration for specific child properties.
         *
-        * @var array<\TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationInterface>
+        * @var \TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationInterface[]
         */
        protected $subConfigurationForProperty = array();
 
diff --git a/typo3/sysext/extbase/Classes/Security/Channel/RequestHashService.php b/typo3/sysext/extbase/Classes/Security/Channel/RequestHashService.php
deleted file mode 100644 (file)
index 301423c..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extbase\Security\Channel;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-/**
- * This is a Service which can generate a request hash and check whether the currently given arguments
- * fit to the request hash.
- *
- * It is used when forms are generated and submitted:
- * After a form has been generated, the method "generateRequestHash" is called with the names of all form fields.
- * It cleans up the array of form fields and creates another representation of it, which is then serialized and hashed.
- *
- * Both serialized form field list and the added hash form the request hash, which will be sent over the wire (as an argument __hmac).
- *
- * On the validation side, the validation happens in two steps:
- * 1) Check if the request hash is consistent (the hash value fits to the serialized string)
- * 2) Check that _all_ GET/POST parameters submitted occur inside the form field list of the request hash.
- *
- * Note: It is crucially important that a private key is computed into the hash value! This is done inside the HashService.
- *
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
- */
-class RequestHashService implements \TYPO3\CMS\Core\SingletonInterface {
-
-       /**
-        * @var \TYPO3\CMS\Extbase\Security\Cryptography\HashService
-        * @inject
-        */
-       protected $hashService;
-
-       /**
-        * Generate a request hash for a list of form fields
-        *
-        * @param array $formFieldNames Array of form fields
-        * @param string $fieldNamePrefix
-        * @throws \TYPO3\CMS\Extbase\Security\Exception\InvalidArgumentForRequestHashGenerationException
-        * @return string request hash
-        * @todo might need to become public API lateron, as we need to call it from Fluid
-        */
-       public function generateRequestHash($formFieldNames, $fieldNamePrefix = '') {
-               $formFieldArray = array();
-               foreach ($formFieldNames as $formField) {
-                       $formFieldParts = explode('[', $formField);
-                       $currentPosition = &$formFieldArray;
-                       for ($i = 0; $i < count($formFieldParts); $i++) {
-                               $formFieldPart = $formFieldParts[$i];
-                               if (substr($formFieldPart, -1) == ']') {
-                                       $formFieldPart = substr($formFieldPart, 0, -1);
-                               }
-                               // Strip off closing ] if needed
-                               if (!is_array($currentPosition)) {
-                                       throw new \TYPO3\CMS\Extbase\Security\Exception\InvalidArgumentForRequestHashGenerationException('The form field name "' . $formField . '" collides with a previous form field name which declared the field as string. (String overridden by Array)', 1255072197);
-                               }
-                               if ($i == count($formFieldParts) - 1) {
-                                       if (isset($currentPosition[$formFieldPart]) && is_array($currentPosition[$formFieldPart])) {
-                                               throw new \TYPO3\CMS\Extbase\Security\Exception\InvalidArgumentForRequestHashGenerationException('The form field name "' . $formField . '" collides with a previous form field name which declared the field as array. (Array overridden by String)', 1255072588);
-                                       }
-                                       // Last iteration - add a string
-                                       if ($formFieldPart === '') {
-                                               $currentPosition[] = 1;
-                                       } else {
-                                               $currentPosition[$formFieldPart] = 1;
-                                       }
-                               } else {
-                                       if ($formFieldPart === '') {
-                                               throw new \TYPO3\CMS\Extbase\Security\Exception\InvalidArgumentForRequestHashGenerationException('The form field name "' . $formField . '" is invalid. Reason: "[]" used not as last argument.', 1255072833);
-                                       }
-                                       if (!isset($currentPosition[$formFieldPart])) {
-                                               $currentPosition[$formFieldPart] = array();
-                                       }
-                                       $currentPosition = &$currentPosition[$formFieldPart];
-                               }
-                       }
-               }
-               if ($fieldNamePrefix !== '') {
-                       $formFieldArray = isset($formFieldArray[$fieldNamePrefix]) ? $formFieldArray[$fieldNamePrefix] : array();
-               }
-               return $this->serializeAndHashFormFieldArray($formFieldArray);
-       }
-
-       /**
-        * Serialize and hash the form field array
-        *
-        * @param array $formFieldArray form field array to be serialized and hashed
-        * @return string Hash
-        */
-       protected function serializeAndHashFormFieldArray($formFieldArray) {
-               $serializedFormFieldArray = serialize($formFieldArray);
-               return $serializedFormFieldArray . $this->hashService->generateHmac($serializedFormFieldArray);
-       }
-
-       /**
-        * Verify the request. Checks if there is an __hmac argument, and if yes, tries to validate and verify it.
-        *
-        * In the end, $request->setHmacVerified is set depending on the value.
-        *
-        * @param \TYPO3\CMS\Extbase\Mvc\Web\Request $request The request to verify
-        * @throws \TYPO3\CMS\Extbase\Security\Exception\SyntacticallyWrongRequestHashException
-        * @return void
-        */
-       public function verifyRequest(\TYPO3\CMS\Extbase\Mvc\Web\Request $request) {
-               if (!$request->getInternalArgument('__hmac')) {
-                       $request->setHmacVerified(FALSE);
-                       return;
-               }
-               $hmac = $request->getInternalArgument('__hmac');
-               if (strlen($hmac) < 40) {
-                       throw new \TYPO3\CMS\Extbase\Security\Exception\SyntacticallyWrongRequestHashException('Request hash too short. This is a probably manipulation attempt!', 1255089361);
-               }
-               $serializedFieldNames = substr($hmac, 0, -40);
-               // TODO: Constant for hash length needs to be introduced
-               $hash = substr($hmac, -40);
-               if ($this->hashService->validateHmac($serializedFieldNames, $hash)) {
-                       $requestArguments = $request->getArguments();
-                       // Unset framework arguments
-                       unset($requestArguments['__referrer']);
-                       unset($requestArguments['__hmac']);
-                       if ($this->checkFieldNameInclusion($requestArguments, unserialize($serializedFieldNames))) {
-                               $request->setHmacVerified(TRUE);
-                       } else {
-                               $request->setHmacVerified(FALSE);
-                       }
-               } else {
-                       $request->setHmacVerified(FALSE);
-               }
-       }
-
-       /**
-        * Check if every element in $requestArguments is in $allowedFields as well.
-        *
-        * @param array $requestArguments
-        * @param array $allowedFields
-        * @return boolean TRUE if ALL fields inside requestArguments are in $allowedFields, FALSE otherwise.
-        */
-       protected function checkFieldNameInclusion(array $requestArguments, array $allowedFields) {
-               foreach ($requestArguments as $argumentName => $argumentValue) {
-                       if (!isset($allowedFields[$argumentName])) {
-                               return FALSE;
-                       }
-                       if (is_array($requestArguments[$argumentName]) && is_array($allowedFields[$argumentName])) {
-                               if (!$this->checkFieldNameInclusion($requestArguments[$argumentName], $allowedFields[$argumentName])) {
-                                       return FALSE;
-                               }
-                       } elseif (!is_array($requestArguments[$argumentName]) && !is_array($allowedFields[$argumentName])) {
-                       } elseif (!is_array($requestArguments[$argumentName]) && $requestArguments[$argumentName] === '' && is_array($allowedFields[$argumentName])) {
-                       } else {
-                               // different types - error
-                               return FALSE;
-                       }
-               }
-               return TRUE;
-       }
-}
diff --git a/typo3/sysext/extbase/Classes/Validation/PropertyError.php b/typo3/sysext/extbase/Classes/Validation/PropertyError.php
deleted file mode 100644 (file)
index 8ffedad..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extbase\Validation;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-/**
- * This object holds validation errors for one property.
- *
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
- * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
- */
-class PropertyError extends \TYPO3\CMS\Extbase\Validation\Error {
-
-       /**
-        * @var string The default (english) error message.
-        */
-       protected $message = 'Validation errors for property "%s"';
-
-       /**
-        * @var string The error code
-        */
-       protected $code = 1242859509;
-
-       /**
-        * @var string The property name
-        */
-       protected $propertyName;
-
-       /**
-        * @var array An array of \TYPO3\CMS\Extbase\Validation\Error for the property
-        */
-       protected $errors = array();
-
-       /**
-        * Create a new property error with the given property name
-        *
-        * @param string $propertyName The property name
-        */
-       public function __construct($propertyName) {
-               $this->propertyName = $propertyName;
-               $this->message = sprintf($this->message, $propertyName);
-       }
-
-       /**
-        * Add errors
-        *
-        * @param array $errors Array of \TYPO3\CMS\Extbase\Validation\Error for the property
-        * @return void
-        */
-       public function addErrors($errors) {
-               $this->errors = array_merge($this->errors, $errors);
-       }
-
-       /**
-        * Get all errors for the property
-        *
-        * @return array An array of \TYPO3\CMS\Extbase\Validation\Error objects or an empty array if no errors occurred for the property
-        */
-       public function getErrors() {
-               return $this->errors;
-       }
-
-       /**
-        * Get the property name
-        *
-        * @return string The property name for this error
-        */
-       public function getPropertyName() {
-               return $this->propertyName;
-       }
-}
index 3d7b73a..4145413 100644 (file)
@@ -44,14 +44,10 @@ abstract class AbstractCompositeValidator implements ObjectValidatorInterface, \
        protected $validatedInstancesContainer;
 
        /**
-        * @var array
-        */
-       protected $errors = array();
-
-       /**
         * Constructs the composite validator and sets validation options
         *
         * @param array $options Options for the validator
+        * @throws \TYPO3\CMS\Extbase\Validation\Exception\InvalidValidationOptionsException
         * @api
         */
        public function __construct(array $options = array()) {
@@ -85,26 +81,6 @@ abstract class AbstractCompositeValidator implements ObjectValidatorInterface, \
        }
 
        /**
-        * Does nothing.
-        *
-        * @param array $options Not used
-        * @return void
-        * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
-        */
-       public function setOptions(array $options) {
-       }
-
-       /**
-        * Returns an array of errors which occurred during the last isValid() call.
-        *
-        * @return array An array of \TYPO3\CMS\Extbase\Validation\Error objects or an empty array if no errors occurred.
-        * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
-        */
-       public function getErrors() {
-               return $this->errors;
-       }
-
-       /**
         * Adds a new validator to the conjunction.
         *
         * @param \TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface $validator The validator that should be added
@@ -171,31 +147,4 @@ abstract class AbstractCompositeValidator implements ObjectValidatorInterface, \
        public function setValidatedInstancesContainer(\SplObjectStorage $validatedInstancesContainer) {
                $this->validatedInstancesContainer = $validatedInstancesContainer;
        }
-
-       /**
-        * Checks the given object can be validated by the validator implementation
-        *
-        * @param object $object The object to be checked
-        * @return boolean TRUE if this validator can validate instances of the given object or FALSE if it can't
-        *
-        * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
-        */
-       public function canValidate($object) {
-               // deliberately empty
-       }
-
-       /**
-        * Checks if the specified property of the given object is valid.
-        *
-        * If at least one error occurred, the result is FALSE.
-        *
-        * @param object $object The object containing the property to validate
-        * @param string $propertyName Name of the property to validate
-        * @return boolean TRUE if the property value is valid, FALSE if an error occurred
-        *
-        * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
-        */
-       public function isPropertyValid($object, $propertyName) {
-               // deliberately empty
-       }
 }
diff --git a/typo3/sysext/extbase/Classes/Validation/Validator/AbstractObjectValidator.php b/typo3/sysext/extbase/Classes/Validation/Validator/AbstractObjectValidator.php
deleted file mode 100644 (file)
index f59eb75..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extbase\Validation\Validator;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-/**
- * An abstract Object Validator
- *
- * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
- */
-abstract class AbstractObjectValidator extends \TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator implements \TYPO3\CMS\Extbase\Validation\Validator\ObjectValidatorInterface {
-
-       /**
-        * Allows to set a container to keep track of validated instances.
-        *
-        * @param \SplObjectStorage $validatedInstancesContainer A container to keep track of validated instances
-        * @return void
-        * @api
-        */
-       public function setValidatedInstancesContainer(\SplObjectStorage $validatedInstancesContainer) {
-               // deliberately empty
-       }
-}
index 8cf8d7b..114ba81 100644 (file)
@@ -44,12 +44,6 @@ abstract class AbstractValidator implements ValidatorInterface {
        protected $options = array();
 
        /**
-        * @var \TYPO3\CMS\Extbase\Mvc\Controller\ArgumentError[]
-        * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1. You should use constructor parameter to set validation options.
-        */
-       protected $errors = array();
-
-       /**
         * @var \TYPO3\CMS\Extbase\Error\Result
         */
        protected $result;
@@ -116,28 +110,7 @@ abstract class AbstractValidator implements ValidatorInterface {
        abstract protected function isValid($value);
 
        /**
-        * Sets options for the validator
-        *
-        * @param array $options Options for the validator
-        * @return void
-        * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1. use constructor instead.
-        */
-       public function setOptions(array $options) {
-               $this->options = $options;
-       }
-
-       /**
-        * Returns an array of errors which occurred during the last isValid() call.
-        *
-        * @return array An array of \TYPO3\CMS\Extbase\Validation\Error objects or an empty array if no errors occurred.
-        * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1. use validate() instead.
-        */
-       public function getErrors() {
-               return $this->errors;
-       }
-
-       /**
-        * Creates a new validation error object and adds it to $this->errors
+        * Creates a new validation error object and adds it to $this->results
         *
         * @param string $message The error message
         * @param integer $code The error code (a unix timestamp)
@@ -146,12 +119,7 @@ abstract class AbstractValidator implements ValidatorInterface {
         * @return void
         */
        protected function addError($message, $code, array $arguments = array(), $title = '') {
-               if ($this->result !== NULL) {
-                       // backwards compatibility before Extbase 1.4.0: we cannot expect the "result" object to be there.
-                       $this->result->addError(new \TYPO3\CMS\Extbase\Validation\Error($message, $code, $arguments, $title));
-               }
-               // the following is @deprecated since Extbase 1.4.0:
-               $this->errors[] = new \TYPO3\CMS\Extbase\Validation\Error($message, $code, $arguments, $title);
+               $this->result->addError(new \TYPO3\CMS\Extbase\Validation\Error($message, $code, $arguments, $title));
        }
 
        /**
index 91d5939..46c4ae6 100644 (file)
@@ -16,7 +16,7 @@ namespace TYPO3\CMS\Extbase\Validation\Validator;
 /**
  * Validator for boolean values
  */
-class BooleanValidator extends \TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator {
+class BooleanValidator extends AbstractValidator {
 
        /**
         * @var array
index 529cb23..0ba105c 100644 (file)
@@ -72,20 +72,8 @@ class CollectionValidator extends GenericObjectValidator {
         *
         * @param mixed $value A collection to be validated
         * @return void
-        * @todo: method must be protected once the old property mapper is removed
         */
-       public function isValid($value) {
-               if (!$this->configurationManager->isFeatureEnabled('rewrittenPropertyMapper')) {
-                       // @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
-                       if ($this->validatedInstancesContainer == NULL) {
-                               $this->validatedInstancesContainer = new \SplObjectStorage();
-                       }
-
-                       if ($this->result == NULL) {
-                               $this->result = new \TYPO3\CMS\Extbase\Error\Result();
-                       }
-               }
-
+       protected function isValid($value) {
                foreach ($value as $index => $collectionElement) {
                        if (isset($this->options['elementValidator'])) {
                                $collectionElementValidator = $this->validatorResolver->createValidator($this->options['elementValidator']);
index 98efe90..c178430 100644 (file)
@@ -13,6 +13,7 @@ namespace TYPO3\CMS\Extbase\Validation\Validator;
  *
  * The TYPO3 project - inspiring people to share!
  */
+use TYPO3\CMS\Extbase\Error\Result;
 
 /**
  * Validator to chain many validators in a conjunction (logical and).
@@ -26,13 +27,15 @@ class ConjunctionValidator extends AbstractCompositeValidator {
         * Every validator has to be valid, to make the whole conjunction valid.
         *
         * @param mixed $value The value that should be validated
-        * @return \TYPO3\CMS\Extbase\Error\Result
+        * @return Result
         * @api
         */
        public function validate($value) {
                $validators = $this->getValidators();
                if ($validators->count() > 0) {
+                       /** @var Result $result */
                        $result = NULL;
+                       /** @var AbstractValidator $validator */
                        foreach ($validators as $validator) {
                                if ($result === NULL) {
                                        $result = $validator->validate($value);
@@ -41,29 +44,9 @@ class ConjunctionValidator extends AbstractCompositeValidator {
                                }
                        }
                } else {
-                       $result = new \TYPO3\CMS\Extbase\Error\Result;
+                       $result = new Result;
                }
 
                return $result;
        }
-
-       /**
-        * Checks if the given value is valid according to the validators of the conjunction.
-        *
-        * If at least one error occurred, the result is FALSE.
-        *
-        * @param mixed $value The value that should be validated
-        * @return boolean
-        * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
-        */
-       public function isValid($value) {
-               $result = TRUE;
-               foreach ($this->validators as $validator) {
-                       if ($validator->isValid($value) === FALSE) {
-                               $this->errors = array_merge($this->errors, $validator->getErrors());
-                               $result = FALSE;
-                       }
-               }
-               return $result;
-       }
 }
index 673660c..56b8020 100644 (file)
@@ -30,7 +30,7 @@ class DateTimeValidator extends AbstractValidator {
         * @return boolean TRUE if the value is valid, FALSE if an error occurred
         */
        public function isValid($value) {
-               $this->errors = array();
+               $this->result->clear();
                if ($value instanceof \DateTime) {
                        return;
                }
index b749781..3f33490 100644 (file)
@@ -59,28 +59,4 @@ class DisjunctionValidator extends AbstractCompositeValidator {
 
                return $result;
        }
-
-       /**
-        * Checks if the given value is valid according to the validators of the conjunction.
-        *
-        * If at least one error occurred, the result is FALSE.
-        *
-        * @param mixed $value The value that should be validated
-        * @return boolean TRUE if the value is valid, FALSE if an error occurred
-        * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
-        */
-       public function isValid($value) {
-               $result = FALSE;
-               foreach ($this->validators as $validator) {
-                       if ($validator->isValid($value) === FALSE) {
-                               $this->errors = array_merge($this->errors, $validator->getErrors());
-                       } else {
-                               $result = TRUE;
-                       }
-               }
-               if ($result === TRUE) {
-                       $this->errors = array();
-               }
-               return $result;
-       }
 }
index dc95946..b8dc2a5 100644 (file)
@@ -13,13 +13,15 @@ namespace TYPO3\CMS\Extbase\Validation\Validator;
  *
  * The TYPO3 project - inspiring people to share!
  */
+use TYPO3\CMS\Extbase\Reflection\ObjectAccess;
+
 /**
  * A generic object validator which allows for specifying property validators
  */
 class GenericObjectValidator extends AbstractValidator implements ObjectValidatorInterface {
 
        /**
-        * @var array
+        * @var \SplObjectStorage[]
         */
        protected $propertyValidators = array();
 
@@ -55,10 +57,10 @@ class GenericObjectValidator extends AbstractValidator implements ObjectValidato
         */
        protected function getPropertyValue($object, $propertyName) {
                // TODO: add support for lazy loading proxies, if needed
-               if (\TYPO3\CMS\Extbase\Reflection\ObjectAccess::isPropertyGettable($object, $propertyName)) {
-                       return \TYPO3\CMS\Extbase\Reflection\ObjectAccess::getProperty($object, $propertyName);
+               if (ObjectAccess::isPropertyGettable($object, $propertyName)) {
+                       return ObjectAccess::getProperty($object, $propertyName);
                } else {
-                       return \TYPO3\CMS\Extbase\Reflection\ObjectAccess::getProperty($object, $propertyName, TRUE);
+                       return ObjectAccess::getProperty($object, $propertyName, TRUE);
                }
        }
 
@@ -67,11 +69,12 @@ class GenericObjectValidator extends AbstractValidator implements ObjectValidato
         * found errors to the $messages object.
         *
         * @param mixed $value The value to be validated
-        * @param array $validators The validators to be called on the value
+        * @param \Traversable $validators The validators to be called on the value
         * @param string $propertyName Name of ther property to check
         * @return void
         */
        protected function checkProperty($value, $validators, $propertyName) {
+               /** @var \TYPO3\CMS\Extbase\Error\Result $result */
                $result = NULL;
                foreach ($validators as $validator) {
                        if ($validator instanceof ObjectValidatorInterface) {
@@ -97,35 +100,11 @@ class GenericObjectValidator extends AbstractValidator implements ObjectValidato
         * @param mixed $object The value that should be validated
         * @return void
         * @api
-        * @todo: method must be protected once the old property mapper is removed
         */
-       public function isValid($object) {
-               if ($this->configurationManager->isFeatureEnabled('rewrittenPropertyMapper')) {
-                       foreach ($this->propertyValidators as $propertyName => $validators) {
-                               $propertyValue = $this->getPropertyValue($object, $propertyName);
-                               $this->checkProperty($propertyValue, $validators, $propertyName);
-                       }
-
-                       return;
-               } else {
-                       /* @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1 */
-                       if (!is_object($object)) {
-                               $this->addError(
-                                       $this->translateErrorMessage(
-                                               'validator.genericobject.noobject',
-                                               'extbase'
-                                       ), 1241099148);
-
-                               return FALSE;
-                       }
-                       $result = TRUE;
-                       foreach (array_keys($this->propertyValidators) as $propertyName) {
-                               if ($this->isPropertyValid($object, $propertyName) === FALSE) {
-                                       $result = FALSE;
-                               }
-                       }
-
-                       return $result;
+       protected function isValid($object) {
+               foreach ($this->propertyValidators as $propertyName => $validators) {
+                       $propertyValue = $this->getPropertyValue($object, $propertyName);
+                       $this->checkProperty($propertyValue, $validators, $propertyName);
                }
        }
 
@@ -141,57 +120,14 @@ class GenericObjectValidator extends AbstractValidator implements ObjectValidato
        }
 
        /**
-        * Checks if the specified property of the given object is valid.
-        *
-        * If at least one error occurred, the result is FALSE.
-        *
-        * @param object $object The object containing the property to validate
-        * @param string $propertyName Name of the property to validate
-        * @throws \InvalidArgumentException
-        * @return boolean TRUE if the property value is valid, FALSE if an error occurred
-        * @api
-        * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
-        */
-       public function isPropertyValid($object, $propertyName) {
-               if (!is_object($object)) {
-                       throw new \InvalidArgumentException('Object expected, ' . gettype($object) . ' given.', 1241099149);
-               }
-               if (!isset($this->propertyValidators[$propertyName])) {
-                       return TRUE;
-               }
-               $result = TRUE;
-               foreach ($this->propertyValidators[$propertyName] as $validator) {
-                       $validator->isValid(\TYPO3\CMS\Extbase\Reflection\ObjectAccess::getProperty($object, $propertyName));
-                       if (count($validator->getErrors()) > 0) {
-                               $this->addErrorsForProperty($validator->getErrors(), $propertyName);
-                               $result = FALSE;
-                       }
-               }
-               return $result;
-       }
-
-       /**
-        * @param array $errors Array of \TYPO3\CMS\Extbase\Validation\Error
-        * @param string $propertyName Name of the property to add errors
-        * @return void
-        * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
-        */
-       protected function addErrorsForProperty($errors, $propertyName) {
-               if (!isset($this->errors[$propertyName])) {
-                       $this->errors[$propertyName] = new \TYPO3\CMS\Extbase\Validation\PropertyError($propertyName);
-               }
-               $this->errors[$propertyName]->addErrors($errors);
-       }
-
-       /**
         * Adds the given validator for validation of the specified property.
         *
         * @param string $propertyName Name of the property to validate
-        * @param \TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface $validator The property validator
+        * @param ValidatorInterface $validator The property validator
         * @return void
         * @api
         */
-       public function addPropertyValidator($propertyName, \TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface $validator) {
+       public function addPropertyValidator($propertyName, ValidatorInterface $validator) {
                if (!isset($this->propertyValidators[$propertyName])) {
                        $this->propertyValidators[$propertyName] = new \SplObjectStorage();
                }
@@ -230,20 +166,6 @@ class GenericObjectValidator extends AbstractValidator implements ObjectValidato
        }
 
        /**
-        * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
-        */
-       protected $configurationManager;
-
-       /**
-        * @param \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager
-        * @return void
-        */
-       public function injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager) {
-               // @todo: remove configuration manager once the old property mapper is removed
-               $this->configurationManager = $configurationManager;
-       }
-
-       /**
         * @var \SplObjectStorage
         */
        protected $validatedInstancesContainer;
index 6d4f4b0..d6ff40d 100644 (file)
@@ -26,9 +26,7 @@ class NumberRangeValidator extends AbstractValidator {
         */
        protected $supportedOptions = array(
                'minimum' => array(0, 'The minimum value to accept', 'integer'),
-               'maximum' => array(PHP_INT_MAX, 'The maximum value to accept', 'integer'),
-               'startRange' => array(0, 'The minimum value to accept', 'integer'),
-               'endRange' => array(PHP_INT_MAX, 'The maximum value to accept', 'integer')
+               'maximum' => array(PHP_INT_MAX, 'The maximum value to accept', 'integer')
        );
 
        /**
@@ -48,24 +46,8 @@ class NumberRangeValidator extends AbstractValidator {
                        return;
                }
 
-               /**
-                * @todo: remove this fallback to startRange/endRange in 6.3 when the setOptions() method is removed too
-                * @deprecated since Extbase 1.4, will be removed two versions after Extbase 6.1
-                */
-               if (isset($this->options['minimum'])) {
-                       $minimum = $this->options['minimum'];
-               } elseif (isset($this->options['startRange'])) {
-                       $minimum = $this->options['startRange'];
-               } else {
-                       $minimum = 0;
-               }
-               if (isset($this->options['maximum'])) {
-                       $maximum = $this->options['maximum'];
-               } elseif (isset($this->options['endRange'])) {
-                       $maximum = $this->options['endRange'];
-               } else {
-                       $maximum = PHP_INT_MAX;
-               }
+               $minimum = $this->options['minimum'];
+               $maximum = $this->options['maximum'];
 
                if ($minimum > $maximum) {
                        $x = $minimum;
index 3d9beae..de9715c 100644 (file)
@@ -21,29 +21,6 @@ namespace TYPO3\CMS\Extbase\Validation\Validator;
 interface ObjectValidatorInterface extends ValidatorInterface {
 
        /**
-        * Checks the given object can be validated by the validator implementation
-        *
-        * @param object $object The object to be checked
-        * @return boolean TRUE if this validator can validate instances of the given object or FALSE if it can't
-        *
-        * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
-        */
-       public function canValidate($object);
-
-       /**
-        * Checks if the specified property of the given object is valid.
-        *
-        * If at least one error occurred, the result is FALSE.
-        *
-        * @param object $object The object containing the property to validate
-        * @param string $propertyName Name of the property to validate
-        * @return boolean TRUE if the property value is valid, FALSE if an error occurred
-        *
-        * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
-        */
-       public function isPropertyValid($object, $propertyName);
-
-       /**
         * Allows to set a container to keep track of validated instances.
         *
         * @param \SplObjectStorage $validatedInstancesContainer A container to keep track of validated instances
index b61fe4e..8e8f4a3 100644 (file)
@@ -35,15 +35,13 @@ interface ValidatorInterface {
         * @param mixed $value The value that should be validated
         * @return \TYPO3\CMS\Extbase\Error\Result
         * @api
-        * @todo: enable once the old property mapper is removed
         */
-       //public function validate($value);
+       public function validate($value);
 
        /**
         * Returns the options of this validator which can be specified in the constructor
         *
         * @return array
-        * @todo: enable once the old property mapper is removed
         */
-       //public function getOptions();
+       public function getOptions();
 }
index 39bdfd2..8d7601f 100644 (file)
@@ -80,7 +80,7 @@ class ValidatorResolver implements \TYPO3\CMS\Core\SingletonInterface {
         * the \TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface or NULL if no validator
         * could be resolved.
         *
-        * @param string $validatorName Either one of the built-in data types or fully qualified validator class name
+        * @param string $validatorType Either one of the built-in data types or fully qualified validator class name
         * @param array $validatorOptions Options to be passed to the validator
         * @return \TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface Validator or NULL if none found.
         */
@@ -110,7 +110,7 @@ class ValidatorResolver implements \TYPO3\CMS\Core\SingletonInterface {
         * If no validator could be resolved (which usually means that no validation is necessary),
         * NULL is returned.
         *
-        * @param string $dataType The data type to search a validator for. Usually the fully qualified object name
+        * @param string $targetClassName The data type to search a validator for. Usually the fully qualified object name
         * @return \TYPO3\CMS\Extbase\Validation\Validator\ConjunctionValidator The validator conjunction or NULL
         */
        public function getBaseValidatorConjunction($targetClassName) {
@@ -130,12 +130,13 @@ class ValidatorResolver implements \TYPO3\CMS\Core\SingletonInterface {
         * @param string $methodName
         * @param array $methodParameters Optional pre-compiled array of method parameters
         * @param array $methodValidateAnnotations Optional pre-compiled array of validate annotations (as array)
-        * @return array An Array of ValidatorConjunctions for each method parameters.
+        * @return ConjunctionValidator[] An Array of ValidatorConjunctions for each method parameters.
         * @throws \TYPO3\CMS\Extbase\Validation\Exception\InvalidValidationConfigurationException
         * @throws \TYPO3\CMS\Extbase\Validation\Exception\NoSuchValidatorException
         * @throws \TYPO3\CMS\Extbase\Validation\Exception\InvalidTypeHintException
         */
        public function buildMethodArgumentsValidatorConjunctions($className, $methodName, array $methodParameters = NULL, array $methodValidateAnnotations = NULL) {
+               /** @var ConjunctionValidator[] $validatorConjunctions */
                $validatorConjunctions = array();
 
                if ($methodParameters === NULL) {
@@ -146,7 +147,8 @@ class ValidatorResolver implements \TYPO3\CMS\Core\SingletonInterface {
                }
 
                foreach ($methodParameters as $parameterName => $methodParameter) {
-                       $validatorConjunction = $this->createValidator('TYPO3\CMS\Extbase\Validation\Validator\ConjunctionValidator');
+                       /** @var ConjunctionValidator $validatorConjunction */
+                       $validatorConjunction = $this->createValidator('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ConjunctionValidator');
 
                        if (!array_key_exists('type', $methodParameter)) {
                                throw new Exception\InvalidTypeHintException('Missing type information, probably no @param annotation for parameter "$' . $parameterName . '" in ' . $className . '->' . $methodName . '()', 1281962564);
index d8606c5..c6a0677 100644 (file)
@@ -53,9 +53,7 @@ return array(
        'Tx_Extbase_MVC_Controller_AbstractController' => 'TYPO3\\CMS\\Extbase\\Mvc\\Controller\\AbstractController',
        'Tx_Extbase_MVC_Controller_ActionController' => 'TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ActionController',
        'Tx_Extbase_MVC_Controller_Argument' => 'TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument',
-       'Tx_Extbase_MVC_Controller_ArgumentError' => 'TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ArgumentError',
        'Tx_Extbase_MVC_Controller_Arguments' => 'TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Arguments',
-       'Tx_Extbase_MVC_Controller_ArgumentsValidator' => 'TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ArgumentsValidator',
        'Tx_Extbase_MVC_Controller_CommandController' => 'TYPO3\\CMS\\Extbase\\Mvc\\Controller\\CommandController',
        'Tx_Extbase_MVC_Controller_CommandControllerInterface' => 'TYPO3\\CMS\\Extbase\\Mvc\\Controller\\CommandControllerInterface',
        'Tx_Extbase_MVC_Controller_ControllerContext' => 'TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ControllerContext',
@@ -226,8 +224,6 @@ return array(
        'Tx_Extbase_Property_Exception_InvalidTargetException' => 'TYPO3\\CMS\\Extbase\\Property\\Exception\\InvalidTargetException',
        'Tx_Extbase_Property_Exception_TargetNotFoundException' => 'TYPO3\\CMS\\Extbase\\Property\\Exception\\TargetNotFoundException',
        'Tx_Extbase_Property_Exception_TypeConverterException' => 'TYPO3\\CMS\\Extbase\\Property\\Exception\\TypeConverterException',
-       'Tx_Extbase_Property_Mapper' => 'TYPO3\\CMS\\Extbase\\Property\\Mapper',
-       'Tx_Extbase_Property_MappingResults' => 'TYPO3\\CMS\\Extbase\\Property\\MappingResults',
        'Tx_Extbase_Property_PropertyMapper' => 'TYPO3\\CMS\\Extbase\\Property\\PropertyMapper',
        'Tx_Extbase_Property_PropertyMappingConfiguration' => 'TYPO3\\CMS\\Extbase\\Property\\PropertyMappingConfiguration',
        'Tx_Extbase_Property_PropertyMappingConfigurationBuilder' => 'TYPO3\\CMS\\Extbase\\Property\\PropertyMappingConfigurationBuilder',
@@ -264,7 +260,6 @@ return array(
        'Tx_Extbase_Scheduler_FieldProvider' => 'TYPO3\\CMS\\Extbase\\Scheduler\\FieldProvider',
        'Tx_Extbase_Scheduler_Task' => 'TYPO3\\CMS\\Extbase\\Scheduler\\Task',
        'Tx_Extbase_Scheduler_TaskExecutor' => 'TYPO3\\CMS\\Extbase\\Scheduler\\TaskExecutor',
-       'Tx_Extbase_Security_Channel_RequestHashService' => 'TYPO3\\CMS\\Extbase\\Security\\Channel\\RequestHashService',
        'Tx_Extbase_Security_Cryptography_HashService' => 'TYPO3\\CMS\\Extbase\\Security\\Cryptography\\HashService',
        'Tx_Extbase_Security_Exception' => 'TYPO3\\CMS\\Extbase\\Security\\Exception',
        'Tx_Extbase_Security_Exception_InvalidArgumentForHashGeneration' => 'TYPO3\\CMS\\Extbase\\Security\\Exception\\InvalidArgumentForHashGenerationException',
@@ -293,9 +288,7 @@ return array(
        'Tx_Extbase_Validation_Exception_InvalidValidationOptions' => 'TYPO3\\CMS\\Extbase\\Validation\\Exception\\InvalidValidationOptionsException',
        'Tx_Extbase_Validation_Exception_NoSuchValidator' => 'TYPO3\\CMS\\Extbase\\Validation\\Exception\\NoSuchValidatorException',
        'Tx_Extbase_Validation_Exception_NoValidatorFound' => 'TYPO3\\CMS\\Extbase\\Validation\\Exception\\NoValidatorFoundException',
-       'Tx_Extbase_Validation_PropertyError' => 'TYPO3\\CMS\\Extbase\\Validation\\PropertyError',
        'Tx_Extbase_Validation_Validator_AbstractCompositeValidator' => 'TYPO3\\CMS\\Extbase\\Validation\\Validator\\AbstractCompositeValidator',
-       'Tx_Extbase_Validation_Validator_AbstractObjectValidator' => 'TYPO3\\CMS\\Extbase\\Validation\\Validator\\AbstractObjectValidator',
        'Tx_Extbase_Validation_Validator_AbstractValidator' => 'TYPO3\\CMS\\Extbase\\Validation\\Validator\\AbstractValidator',
        'Tx_Extbase_Validation_Validator_AlphanumericValidator' => 'TYPO3\\CMS\\Extbase\\Validation\\Validator\\AlphanumericValidator',
        'Tx_Extbase_Validation_Validator_ConjunctionValidator' => 'TYPO3\\CMS\\Extbase\\Validation\\Validator\\ConjunctionValidator',
index e9590f2..4cbff0b 100644 (file)
@@ -91,106 +91,6 @@ class ActionControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @test
-        * @author Robert Lemke <robert@typo3.org>
-        */
-       public function callActionMethodAppendsStringsReturnedByActionMethodToTheResponseObject() {
-               $mockRequest = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Request', array(), array(), '', FALSE);
-               $mockResponse = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\ResponseInterface', array(), array(), '', FALSE);
-               $mockResponse->expects($this->once())->method('appendContent')->with('the returned string');
-               $mockArguments = new \ArrayObject();
-               $mockArgumentMappingResults = $this->getMock('TYPO3\\CMS\\Extbase\\Property\\MappingResults', array(), array(), '', FALSE);
-               $mockArgumentMappingResults->expects($this->once())->method('hasErrors')->will($this->returnValue(FALSE));
-               $mockController = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ActionController', array('fooAction', 'initializeAction'), array(), '', FALSE);
-               $mockSignalSlotDispatcher = $this->getMock('TYPO3\\CMS\Extbase\\SignalSlot\\Dispatcher', array(), array(), '', FALSE);
-               $mockController->_set('signalSlotDispatcher', $mockSignalSlotDispatcher);
-               $this->enableDeprecatedPropertyMapperInController($mockController);
-               $mockController->expects($this->once())->method('fooAction')->will($this->returnValue('the returned string'));
-               $mockController->_set('request', $mockRequest);
-               $mockController->_set('response', $mockResponse);
-               $mockController->_set('arguments', $mockArguments);
-               $mockController->_set('actionMethodName', 'fooAction');
-               $mockController->_set('argumentsMappingResults', $mockArgumentMappingResults);
-               $mockController->_call('callActionMethod');
-       }
-
-       /**
-        * @test
-        * @author Robert Lemke <robert@typo3.org>
-        */
-       public function callActionMethodRendersTheViewAutomaticallyIfTheActionReturnedNullAndAViewExists() {
-               $mockRequest = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Request', array(), array(), '', FALSE);
-               $mockResponse = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\ResponseInterface', array(), array(), '', FALSE);
-               $mockResponse->expects($this->once())->method('appendContent')->with('the view output');
-               $mockView = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\View\\ViewInterface');
-               $mockView->expects($this->once())->method('render')->will($this->returnValue('the view output'));
-               $mockArguments = new \ArrayObject();
-               $mockArgumentMappingResults = $this->getMock('TYPO3\\CMS\\Extbase\\Property\\MappingResults', array(), array(), '', FALSE);
-               $mockArgumentMappingResults->expects($this->once())->method('hasErrors')->will($this->returnValue(FALSE));
-               $mockController = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ActionController', array('fooAction', 'initializeAction'), array(), '', FALSE);
-               $mockSignalSlotDispatcher = $this->getMock('TYPO3\\CMS\Extbase\\SignalSlot\\Dispatcher', array(), array(), '', FALSE);
-               $mockController->_set('signalSlotDispatcher', $mockSignalSlotDispatcher);
-               $this->enableDeprecatedPropertyMapperInController($mockController);
-               $mockController->expects($this->once())->method('fooAction');
-               $mockController->_set('request', $mockRequest);
-               $mockController->_set('response', $mockResponse);
-               $mockController->_set('arguments', $mockArguments);
-               $mockController->_set('actionMethodName', 'fooAction');
-               $mockController->_set('argumentsMappingResults', $mockArgumentMappingResults);
-               $mockController->_set('view', $mockView);
-               $mockController->_call('callActionMethod');
-       }
-
-       /**
-        * @test
-        * @author Robert Lemke <robert@typo3.org>
-        */
-       public function callActionMethodCallsTheErrorActionIfTheMappingResultsHaveErrors() {
-               $mockRequest = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Request', array(), array(), '', FALSE);
-               $mockResponse = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\ResponseInterface', array(), array(), '', FALSE);
-               $mockResponse->expects($this->once())->method('appendContent')->with('the returned string');
-               $mockArguments = new \ArrayObject();
-               $mockArgumentMappingResults = $this->getMock('TYPO3\\CMS\\Extbase\\Property\\MappingResults', array(), array(), '', FALSE);
-               $mockArgumentMappingResults->expects($this->once())->method('hasErrors')->will($this->returnValue(TRUE));
-               $mockController = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ActionController', array('barAction', 'initializeAction'), array(), '', FALSE);
-               $this->enableDeprecatedPropertyMapperInController($mockController);
-               $mockController->expects($this->once())->method('barAction')->will($this->returnValue('the returned string'));
-               $mockController->_set('request', $mockRequest);
-               $mockController->_set('response', $mockResponse);
-               $mockController->_set('arguments', $mockArguments);
-               $mockController->_set('actionMethodName', 'fooAction');
-               $mockController->_set('errorMethodName', 'barAction');
-               $mockController->_set('argumentsMappingResults', $mockArgumentMappingResults);
-               $mockController->_call('callActionMethod');
-       }
-
-       /**
-        * @test
-        * @author Sebastian Kurfürst <sebastian@typo3.org>
-        */
-       public function callActionMethodPassesDefaultValuesAsArguments() {
-               $mockRequest = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Request', array(), array(), '', FALSE);
-               $mockResponse = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\ResponseInterface', array(), array(), '', FALSE);
-               $arguments = new \ArrayObject();
-               $optionalArgument = new \TYPO3\CMS\Extbase\Mvc\Controller\Argument('name1', 'Text');
-               $optionalArgument->setDefaultValue('Default value');
-               $arguments[] = $optionalArgument;
-               $mockArgumentMappingResults = $this->getMock('TYPO3\\CMS\\Extbase\\Property\\MappingResults', array(), array(), '', FALSE);
-               $mockArgumentMappingResults->expects($this->once())->method('hasErrors')->will($this->returnValue(FALSE));
-               $mockController = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ActionController', array('fooAction', 'initializeAction'), array(), '', FALSE);
-               $mockSignalSlotDispatcher = $this->getMock('TYPO3\\CMS\Extbase\\SignalSlot\\Dispatcher', array(), array(), '', FALSE);
-               $mockController->_set('signalSlotDispatcher', $mockSignalSlotDispatcher);
-               $this->enableDeprecatedPropertyMapperInController($mockController);
-               $mockController->expects($this->once())->method('fooAction')->with('Default value');
-               $mockController->_set('request', $mockRequest);
-               $mockController->_set('response', $mockResponse);
-               $mockController->_set('arguments', $arguments);
-               $mockController->_set('actionMethodName', 'fooAction');
-               $mockController->_set('argumentsMappingResults', $mockArgumentMappingResults);
-               $mockController->_call('callActionMethod');
-       }
-
-       /**
-        * @test
         * @author Karsten Dambekalns <karsten@typo3.org>
         */
        public function resolveViewUsesFluidTemplateViewIfTemplateIsAvailable() {
@@ -423,201 +323,6 @@ class ActionControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @test
-        * @author Sebastian Kurfürst <sbastian@typo3.org>
-        */
-       public function initializeActionMethodValidatorsCorrectlyRegistersValidatorsBasedOnDataType() {
-               $mockController = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ActionController', array('fooAction'), array(), '', FALSE);
-               $this->enableDeprecatedPropertyMapperInController($mockController);
-               $argument = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array('getName'), array(), '', FALSE);
-               $argument->expects($this->any())->method('getName')->will($this->returnValue('arg1'));
-               $arguments = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Arguments', array('dummy'));
-               $arguments->addArgument($argument);
-               $methodTagsValues = array();
-               $methodArgumentsValidatorConjunctions = array();
-               $methodArgumentsValidatorConjunctions['arg1'] = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ConjunctionValidator', array(), array(), '', FALSE);
-               $mockReflectionService = $this->getMock('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService', array(), array(), '', FALSE);
-               $mockReflectionService->expects($this->once())->method('getMethodTagsValues')->with(get_class($mockController), 'fooAction')->will($this->returnValue($methodTagsValues));
-               $mockValidatorResolver = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array(), array(), '', FALSE);
-               $mockValidatorResolver->expects($this->once())->method('buildMethodArgumentsValidatorConjunctions')->with(get_class($mockController), 'fooAction')->will($this->returnValue($methodArgumentsValidatorConjunctions));
-               $mockController->_set('reflectionService', $mockReflectionService);
-               $mockController->_set('validatorResolver', $mockValidatorResolver);
-               $mockController->_set('arguments', $arguments);
-               $mockController->_set('actionMethodName', 'fooAction');
-               $mockController->_call('initializeActionMethodValidators');
-               $this->assertEquals($methodArgumentsValidatorConjunctions['arg1'], $arguments['arg1']->getValidator());
-       }
-
-       /**
-        * @test
-        * @author Sebastian Kurfürst <sbastian@typo3.org>
-        */
-       public function initializeActionMethodValidatorsRegistersModelBasedValidators() {
-               $mockController = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ActionController', array('fooAction'), array(), '', FALSE);
-               $this->enableDeprecatedPropertyMapperInController($mockController);
-               $argument = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array('getName', 'getDataType'), array(), '', FALSE);
-               $argument->expects($this->any())->method('getName')->will($this->returnValue('arg1'));
-               $argument->expects($this->any())->method('getDataType')->will($this->returnValue('F3_Foo_Quux'));
-               $arguments = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Arguments', array('dummy'));
-               $arguments->addArgument($argument);
-               $methodTagsValues = array();
-               $quuxBaseValidatorConjunction = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ConjunctionValidator', array(), array(), '', FALSE);
-               $methodArgumentsValidatorConjunctions = array();
-               $methodArgumentsValidatorConjunctions['arg1'] = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ConjunctionValidator', array(), array(), '', FALSE);
-               $methodArgumentsValidatorConjunctions['arg1']->expects($this->once())->method('addValidator')->with($quuxBaseValidatorConjunction);
-               $mockReflectionService = $this->getMock('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService', array(), array(), '', FALSE);
-               $mockReflectionService->expects($this->once())->method('getMethodTagsValues')->with(get_class($mockController), 'fooAction')->will($this->returnValue($methodTagsValues));
-               $mockValidatorResolver = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array(), array(), '', FALSE);
-               $mockValidatorResolver->expects($this->once())->method('buildMethodArgumentsValidatorConjunctions')->with(get_class($mockController), 'fooAction')->will($this->returnValue($methodArgumentsValidatorConjunctions));
-               $mockValidatorResolver->expects($this->once())->method('getBaseValidatorConjunction')->with('F3_Foo_Quux')->will($this->returnValue($quuxBaseValidatorConjunction));
-               $mockController->_set('reflectionService', $mockReflectionService);
-               $mockController->_set('validatorResolver', $mockValidatorResolver);
-               $mockController->_set('arguments', $arguments);
-               $mockController->_set('actionMethodName', 'fooAction');
-               $mockController->_call('initializeActionMethodValidators');
-               $this->assertEquals($methodArgumentsValidatorConjunctions['arg1'], $arguments['arg1']->getValidator());
-       }
-
-       /**
-        * @test
-        * @author Sebastian Kurfürst <sbastian@typo3.org>
-        */
-       public function initializeActionMethodValidatorsDoesNotRegisterModelBasedValidatorsIfDontValidateAnnotationIsSet() {
-               $mockController = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ActionController', array('fooAction'), array(), '', FALSE);
-               $this->enableDeprecatedPropertyMapperInController($mockController);
-               $argument = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array('getName', 'getDataType'), array(), '', FALSE);
-               $argument->expects($this->any())->method('getName')->will($this->returnValue('arg1'));
-               $argument->expects($this->any())->method('getDataType')->will($this->returnValue('F3_Foo_Quux'));
-               $arguments = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Arguments', array('dummy'));
-               $arguments->addArgument($argument);
-               $methodTagsValues = array(
-                       'dontvalidate' => array(
-                               '$arg1'
-                       )
-               );
-               $methodArgumentsValidatorConjunctions = array();
-               $methodArgumentsValidatorConjunctions['arg1'] = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ConjunctionValidator', array(), array(), '', FALSE);
-               $mockReflectionService = $this->getMock('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService', array(), array(), '', FALSE);
-               $mockReflectionService->expects($this->once())->method('getMethodTagsValues')->with(get_class($mockController), 'fooAction')->will($this->returnValue($methodTagsValues));
-               $mockValidatorResolver = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array(), array(), '', FALSE);
-               $mockValidatorResolver->expects($this->once())->method('buildMethodArgumentsValidatorConjunctions')->with(get_class($mockController), 'fooAction')->will($this->returnValue($methodArgumentsValidatorConjunctions));
-               $mockValidatorResolver->expects($this->any())->method('getBaseValidatorConjunction')->will($this->throwException(new \Exception('This should not be called because the dontvalidate annotation is set.')));
-               $mockController->_set('reflectionService', $mockReflectionService);
-               $mockController->_set('validatorResolver', $mockValidatorResolver);
-               $mockController->_set('arguments', $arguments);
-               $mockController->_set('actionMethodName', 'fooAction');
-               $mockController->_call('initializeActionMethodValidators');
-               $this->assertEquals($methodArgumentsValidatorConjunctions['arg1'], $arguments['arg1']->getValidator());
-       }
-
-       /**
-        * @test
-        * @author Christopher Hlubek <hlubek@networkteam.com>
-        */
-       public function defaultErrorActionSetsArgumentMappingResultsErrorsInRequest() {
-               $mockRequest = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Request', array(), array(), '', FALSE);
-               $mockError = $this->getMock('TYPO3\\CMS\\Extbase\\Error\\Error', array('getMessage'), array(), '', FALSE);
-               $mockArgumentsMappingResults = $this->getMock('TYPO3\\CMS\\Extbase\\Property\\MappingResults', array('getErrors', 'getWarnings'), array(), '', FALSE);
-               $mockArgumentsMappingResults->expects($this->atLeastOnce())->method('getErrors')->will($this->returnValue(array($mockError)));
-               $mockArgumentsMappingResults->expects($this->any())->method('getWarnings')->will($this->returnValue(array()));
-               /** @var $mockController \TYPO3\CMS\Extbase\Mvc\Controller\ActionController|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
-               $mockController = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ActionController', array('clearCacheOnError'), array(), '', FALSE);
-               $controllerContext = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ControllerContext', array('getFlashMessageQueue'));
-               $controllerContext->expects($this->any())->method('getFlashMessageQueue')->will($this->returnValue(new \TYPO3\CMS\Core\Messaging\FlashMessageQueue('foo')));
-               $this->enableDeprecatedPropertyMapperInController($mockController);
-               $mockController->_set('controllerContext', $controllerContext);
-               $mockController->_set('request', $mockRequest);
-               $mockController->_set('argumentsMappingResults', $mockArgumentsMappingResults);
-               $mockRequest->expects($this->once())->method('setErrors')->with(array($mockError));
-               $mockController->_call('errorAction');
-       }
-
-       /**
-        * Data Provider for checkRequestHashDoesNotThrowExceptionInNormalOperations
-        *
-        * @return array
-        */
-       public function checkRequestHashInNormalOperation() {
-               return array(
-                       // HMAC is verified
-                       array(TRUE),
-                       // HMAC not verified, but objects are directly fetched from persistence layer
-                       array(FALSE, FALSE, \TYPO3\CMS\Extbase\Mvc\Controller\Argument::ORIGIN_PERSISTENCE, \TYPO3\CMS\Extbase\Mvc\Controller\Argument::ORIGIN_PERSISTENCE),
-                       // HMAC not verified, objects new and modified, but dontverifyrequesthash-annotation set
-                       array(FALSE, TRUE, \TYPO3\CMS\Extbase\Mvc\Controller\Argument::ORIGIN_PERSISTENCE, \TYPO3\CMS\Extbase\Mvc\Controller\Argument::ORIGIN_PERSISTENCE_AND_MODIFIED, array('dontverifyrequesthash' => ''))
-               );
-       }
-
-       /**
-        * @test
-        * @author Sebastian Kurfürst <sebastian@typo3.org>
-        * @dataProvider checkRequestHashInNormalOperation
-        * @param boolean $hmacVerified
-        * @param boolean $reflectionServiceNeedsInitialization
-        * @param integer $argument1Origin
-        * @param integer $argument2Origin
-        * @param array $methodTagsValues
-        */
-       public function checkRequestHashDoesNotThrowExceptionInNormalOperations($hmacVerified, $reflectionServiceNeedsInitialization = FALSE, $argument1Origin = 3, $argument2Origin = 3, array $methodTagsValues = array()) {
-               $mockRequest = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request', array('isHmacVerified'), array(), '', FALSE);
-               $mockRequest->expects($this->once())->method('isHmacVerified')->will($this->returnValue($hmacVerified));
-               $argument1 = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array('getOrigin'), array(), '', FALSE);
-               $argument1->expects($this->any())->method('getOrigin')->will($this->returnValue($argument1Origin));
-               $argument2 = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array('getOrigin'), array(), '', FALSE);
-               $argument2->expects($this->any())->method('getOrigin')->will($this->returnValue($argument2Origin));
-               $mockController = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ActionController', array('dummy'), array(), '', FALSE);
-               $this->enableDeprecatedPropertyMapperInController($mockController);
-               $mockReflectionService = $this->getMock('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService', array('getMethodTagsValues'), array(), '', FALSE);
-               if ($reflectionServiceNeedsInitialization) {
-                       // Somehow this is needed, else I get "Mocked method does not exist."
-                       $mockReflectionService->expects($this->any())->method('getMethodTagsValues')->with(get_class($mockController), 'fooAction')->will($this->returnValue($methodTagsValues));
-               }
-               $mockController->_set('arguments', array($argument1, $argument2));
-               $mockController->_set('request', $mockRequest);
-               $mockController->_set('actionMethodName', 'fooAction');
-               $mockController->_set('reflectionService', $mockReflectionService);
-               $mockController->_call('checkRequestHash');
-       }
-
-       /**
-        * @test
-        * @expectedException \TYPO3\CMS\Extbase\Mvc\Exception\InvalidOrNoRequestHashException
-        * @author Sebastian Kurfürst <sebastian@typo3.org>
-        */
-       public function checkRequestHashThrowsExceptionIfNeeded() {
-               $hmacVerified = FALSE;
-               $argument1Origin = \TYPO3\CMS\Extbase\Mvc\Controller\Argument::ORIGIN_PERSISTENCE_AND_MODIFIED;
-               $argument2Origin = \TYPO3\CMS\Extbase\Mvc\Controller\Argument::ORIGIN_PERSISTENCE;
-               $methodTagsValues = array();
-               $mockRequest = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request', array('isHmacVerified'), array(), '', FALSE);
-               $mockRequest->expects($this->once())->method('isHmacVerified')->will($this->returnValue($hmacVerified));
-               $argument1 = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array('getOrigin'), array(), '', FALSE);
-               $argument1->expects($this->any())->method('getOrigin')->will($this->returnValue($argument1Origin));
-               $argument2 = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array('getOrigin'), array(), '', FALSE);
-               $argument2->expects($this->any())->method('getOrigin')->will($this->returnValue($argument2Origin));
-               $mockController = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ActionController', array('dummy'), array(), '', FALSE);
-               $this->enableDeprecatedPropertyMapperInController($mockController);
-               $mockReflectionService = $this->getMock('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService', array('getMethodTagsValues'), array(), '', FALSE);
-               $mockReflectionService->expects($this->any())->method('getMethodTagsValues')->with(get_class($mockController), 'fooAction')->will($this->returnValue($methodTagsValues));
-               $mockController->_set('arguments', array($argument1, $argument2));
-               $mockController->_set('request', $mockRequest);
-               $mockController->_set('actionMethodName', 'fooAction');
-               $mockController->_set('reflectionService', $mockReflectionService);
-               $mockController->_call('checkRequestHash');
-       }
-
-       /**
-        * Helper which enables the deprecated property mapper in the ActionController class.
-        *
-        * @param \TYPO3\CMS\Extbase\Mvc\Controller\ActionController $actionController
-        */
-       protected function enableDeprecatedPropertyMapperInController(\TYPO3\CMS\Extbase\Mvc\Controller\ActionController $actionController) {
-               $mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
-               $mockConfigurationManager->expects($this->any())->method('isFeatureEnabled')->with('rewrittenPropertyMapper')->will($this->returnValue(FALSE));
-               $actionController->injectConfigurationManager($mockConfigurationManager);
-       }
-
-       /**
-        * @test
         * @dataProvider templateRootPathDataProvider
         * @param array $configuration
         * @param array $expected
diff --git a/typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ArgumentBehaviorBeforeExtbase14Test.php b/typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ArgumentBehaviorBeforeExtbase14Test.php
deleted file mode 100644 (file)
index 6df991f..0000000
+++ /dev/null
@@ -1,177 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extbase\Tests\Unit\Mvc\Controller;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * This test checks the Argument behavior before Extbase 1.4, i.e. with the old property mapper.
- *
- * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
- */
-class ArgumentBehaviorBeforeExtbase14Test extends \TYPO3\CMS\Core\Tests\UnitTestCase {
-
-       /**
-        * @test
-        * @expectedException \InvalidArgumentException
-        */
-       public function constructingArgumentWithoutNameThrowsException() {
-               new \TYPO3\CMS\Extbase\Mvc\Controller\Argument(NULL, 'Text');
-       }
-
-       /**
-        * @test
-        * @expectedException \InvalidArgumentException
-        */
-       public function constructingArgumentWithInvalidNameThrowsException() {
-               new \TYPO3\CMS\Extbase\Mvc\Controller\Argument(new \ArrayObject(), 'Text');
-       }
-
-       /**
-        * @test
-        */
-       public function passingDataTypeToConstructorReallySetsTheDataType() {
-               $argument = new \TYPO3\CMS\Extbase\Mvc\Controller\Argument('dummy', 'Number');
-               $this->assertEquals('Number', $argument->getDataType(), 'The specified data type has not been set correctly.');
-       }
-
-       /**
-        * @test
-        */
-       public function setShortNameProvidesFluentInterface() {
-               $argument = new \TYPO3\CMS\Extbase\Mvc\Controller\Argument('dummy', 'Text');
-               $returnedArgument = $argument->setShortName('x');
-               $this->assertSame($argument, $returnedArgument, 'The returned argument is not the original argument.');
-       }
-
-       /**
-        * @test
-        */
-       public function setValueProvidesFluentInterface() {
-               $argument = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Argument', array('dummy'), array('dummy', 'Text'));
-               $this->enableDeprecatedPropertyMapperInArgument($argument);
-               $returnedArgument = $argument->setValue('x');
-               $this->assertSame($argument, $returnedArgument, 'The returned argument is not the original argument.');
-       }
-
-       /**
-        * @test
-        * @author Karsten Dambekalns <karsten@typo3.org>
-        */
-       public function setValueUsesNullAsIs() {
-               $argument = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array('transformValue'), array('dummy', 'ArrayObject'));
-               $this->enableDeprecatedPropertyMapperInArgument($argument);
-               $argument->expects($this->never())->method('transformValue');
-               $argument->setValue(NULL);
-       }
-
-       /**
-        * @test
-        * @author Karsten Dambekalns <karsten@typo3.org>
-        */
-       public function setValueUsesMatchingInstanceAsIs() {
-               $argument = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array('transformValue'), array('dummy', 'ArrayObject'));
-               $this->enableDeprecatedPropertyMapperInArgument($argument);
-               $argument->expects($this->never())->method('transformValue');
-               $argument->setValue(new \ArrayObject());
-       }
-
-       /**
-        * @test
-        */
-       public function setValueTriesToConvertAnUidIntoTheRealObjectIfTheDataTypeClassSchemaIsSet() {
-               $object = new \StdClass();
-               $argument = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array('findObjectByUid'), array(), '', FALSE);
-               $this->enableDeprecatedPropertyMapperInArgument($argument);
-               $argument->expects($this->once())->method('findObjectByUid')->with('42')->will($this->returnValue($object));
-               $argument->_set('dataTypeClassSchema', 'stdClass');
-               $argument->_set('dataType', 'stdClass');
-               // $argument->_set('queryFactory', $mockQueryFactory);
-               $argument->setValue('42');
-               $this->assertSame($object, $argument->_get('value'));
-               $this->assertSame(\TYPO3\CMS\Extbase\Mvc\Controller\Argument::ORIGIN_PERSISTENCE, $argument->getOrigin());
-       }
-
-       /**
-        * @test
-        */
-       public function toStringReturnsTheStringVersionOfTheArgumentsValue() {
-               $argument = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Argument', array('dummy'), array('dummy', 'Text'));
-               $this->enableDeprecatedPropertyMapperInArgument($argument);
-               $argument->setValue(123);
-               $this->assertSame((string) $argument, '123', 'The returned argument is not a string.');
-               $this->assertNotSame((string) $argument, 123, 'The returned argument is identical to the set value.');
-       }
-
-       /**
-        * @test
-        */
-       public function setNewValidatorConjunctionCreatesANewValidatorConjunctionObject() {
-               $argument = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Argument', array('dummy'), array('dummy', 'Text'));
-               $mockConjunctionValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ConjunctionValidator');
-               $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
-               $mockObjectManager->expects($this->once())->method('get')->with('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ConjunctionValidator')->will($this->returnValue($mockConjunctionValidator));
-               $argument->_set('objectManager', $mockObjectManager);
-               $argument->setNewValidatorConjunction(array());
-               $this->assertSame($mockConjunctionValidator, $argument->getValidator());
-       }
-
-       /**
-        * @test
-        */
-       public function setNewValidatorConjunctionAddsThePassedValidatorsToTheCreatedValidatorChain() {
-               eval('class Validator1 implements TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface {
-                       public function isValid($value) {}
-                       public function setOptions(array $validationOptions) {}
-                       public function getErrors() {}
-               }');
-               eval('class Validator2 implements TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface {
-                       public function isValid($value) {}
-                       public function setOptions(array $validationOptions) {}
-                       public function getErrors() {}
-               }');
-               $validator1 = new \Validator1();
-               $validator2 = new \Validator2();
-               $mockValidatorConjunction = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ConjunctionValidator');
-               $mockValidatorConjunction->expects($this->at(0))->method('addValidator')->with($validator1);
-               $mockValidatorConjunction->expects($this->at(1))->method('addValidator')->with($validator2);
-               $argument = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array('dummy'), array(), '', FALSE);
-               $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
-               $mockObjectManager->expects($this->never())->method('create');
-               $mockObjectManager->expects($this->at(0))->method('get')->with('Validator1')->will($this->returnValue($validator1));
-               $mockObjectManager->expects($this->at(1))->method('get')->with('Validator2')->will($this->returnValue($validator2));
-               $argument->_set('objectManager', $mockObjectManager);
-               $argument->_set('validator', $mockValidatorConjunction);
-               $argument->setNewValidatorConjunction(array('Validator1', 'Validator2'));
-       }
-
-       /**
-        * @test
-        */
-       public function settingDefaultValueReallySetsDefaultValue() {
-               $argument = new \TYPO3\CMS\Extbase\Mvc\Controller\Argument('dummy', 'Text');
-               $argument->setDefaultValue(42);
-               $this->assertEquals(42, $argument->getValue(), 'The default value was not stored in the Argument.');
-       }
-
-       /**
-        * Helper which enables the deprecated property mapper in the Argument class.
-        *
-        * @param \TYPO3\CMS\Extbase\Mvc\Controller\Argument $argument
-        */
-       protected function enableDeprecatedPropertyMapperInArgument(\TYPO3\CMS\Extbase\Mvc\Controller\Argument $argument) {
-               $mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
-               $mockConfigurationManager->expects($this->any())->method('isFeatureEnabled')->with('rewrittenPropertyMapper')->will($this->returnValue(FALSE));
-               $argument->_set('configurationManager', $mockConfigurationManager);
-       }
-}
index 819cb76..2392928 100644 (file)
@@ -160,7 +160,6 @@ class ArgumentTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @author Robert Lemke <robert@typo3.org>
         */
        public function setValueProvidesFluentInterface() {
-               $this->enableRewrittenPropertyMapperInArgument($this->simpleValueArgument);
                $returnedArgument = $this->simpleValueArgument->setValue(NULL);
                $this->assertSame($this->simpleValueArgument, $returnedArgument, 'The returned argument is not the original argument.');
        }
@@ -172,64 +171,15 @@ class ArgumentTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function setValueUsesNullAsIs() {
                $this->simpleValueArgument = new \TYPO3\CMS\Extbase\Mvc\Controller\Argument('dummy', 'string');
                $this->simpleValueArgument = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Argument', array('dummy'), array('dummy', 'string'));
-               $this->enableRewrittenPropertyMapperInArgument($this->simpleValueArgument);
                $this->simpleValueArgument->setValue(NULL);
                $this->assertNull($this->simpleValueArgument->getValue());
        }
 
        /**
-        * @return array
-        */
-       public function validClassNameDataTypes() {
-               return array(
-                       array('Tx_Foo_Bar'),
-                       array('ExtbaseTeam\\BlogExample\\Foo\\Bar'),
-               );
-       }
-
-       /**
-        * @test
-        * @dataProvider validClassNameDataTypes
-        */
-       public function classSchemaIsBuiltForClassNameDataTypesWhenReflectionServiceIsInjected($dataType) {
-               /** @var $argument \TYPO3\CMS\Extbase\Mvc\Controller\Argument|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
-               $argument = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array('dummy'), array(), '', FALSE);
-               $argument->_set('dataType', $dataType);
-               $reflectionService = $this->getMock('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService');
-               $reflectionService->expects($this->once())->method('getClassSchema')->with($dataType);
-               $argument->injectReflectionService($reflectionService);
-       }
-
-       /**
-        * @return array
-        */
-       public function primitiveOrBuiltInObjectsDataTypes() {
-               return array(
-                       array('integer'),
-                       array('array'),
-                       array('DateTime'),
-               );
-       }
-
-       /**
-        * @test
-        * @dataProvider primitiveOrBuiltInObjectsDataTypes
-        */
-       public function classSchemaIsNotBuiltForPrimitiveDataTypesWhenReflectionServiceIsInjected($dataType) {
-               /** @var $argument \TYPO3\CMS\Extbase\Mvc\Controller\Argument|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
-               $argument = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array('dummy'), array(), '', FALSE);
-               $argument->_set('dataType', $dataType);
-               $reflectionService = $this->getMock('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService');
-               $reflectionService->expects($this->never())->method('getClassSchema');
-               $argument->injectReflectionService($reflectionService);
-       }
-
-       /**
         * @test
         * @author Karsten Dambekalns <karsten@typo3.org>
         */
        public function setValueUsesMatchingInstanceAsIs() {
-               $this->enableRewrittenPropertyMapperInArgument($this->objectArgument);
                $this->mockPropertyMapper->expects($this->never())->method('convert');
                $this->objectArgument->setValue(new \DateTime());
        }
@@ -248,7 +198,6 @@ class ArgumentTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         */
        public function setValueShouldCallPropertyMapperCorrectlyAndStoreResultInValue() {
-               $this->enableRewrittenPropertyMapperInArgument($this->simpleValueArgument);
                $this->setupPropertyMapperAndSetValue();
                $this->assertSame('convertedValue', $this->simpleValueArgument->getValue());
                $this->assertTrue($this->simpleValueArgument->isValid());
@@ -259,7 +208,6 @@ class ArgumentTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         */
        public function setValueShouldBeFluentInterface() {
-               $this->enableRewrittenPropertyMapperInArgument($this->simpleValueArgument);
                $this->assertSame($this->simpleValueArgument, $this->setupPropertyMapperAndSetValue());
        }
 
@@ -268,9 +216,8 @@ class ArgumentTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         */
        public function setValueShouldSetValidationErrorsIfValidatorIsSetAndValidationFailed() {
-               $this->enableRewrittenPropertyMapperInArgument($this->simpleValueArgument);
                $error = new \TYPO3\CMS\Extbase\Error\Error('Some Error', 1234);
-               $mockValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate'));
+               $mockValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate', 'getOptions'));
                $validationMessages = new \TYPO3\CMS\Extbase\Error\Result();
                $validationMessages->addError($error);
                $mockValidator->expects($this->once())->method('validate')->with('convertedValue')->will($this->returnValue($validationMessages));
@@ -288,15 +235,4 @@ class ArgumentTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->assertNull($this->simpleValueArgument->getPropertyMappingConfiguration()->getConfigurationValue('TYPO3\CMS\Extbase\Property\TypeConverter\PersistentObjectConverter', \TYPO3\CMS\Extbase\Property\TypeConverter\PersistentObjectConverter::CONFIGURATION_CREATION_ALLOWED));
                $this->assertNull($this->simpleValueArgument->getPropertyMappingConfiguration()->getConfigurationValue('TYPO3\CMS\Extbase\Property\TypeConverter\PersistentObjectConverter', \TYPO3\CMS\Extbase\Property\TypeConverter\PersistentObjectConverter::CONFIGURATION_MODIFICATION_ALLOWED));
        }
-
-       /**
-        * Helper which enables the new property mapper in the Argument class.
-        *
-        * @param \TYPO3\CMS\Extbase\Mvc\Controller\Argument $argument
-        */
-       protected function enableRewrittenPropertyMapperInArgument(\TYPO3\CMS\Extbase\Mvc\Controller\Argument $argument) {
-               $mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
-               $mockConfigurationManager->expects($this->any())->method('isFeatureEnabled')->with('rewrittenPropertyMapper')->will($this->returnValue(TRUE));
-               $argument->_set('configurationManager', $mockConfigurationManager);
-       }
 }
diff --git a/typo3/sysext/extbase/Tests/Unit/Property/MapperTest.php b/typo3/sysext/extbase/Tests/Unit/Property/MapperTest.php
deleted file mode 100644 (file)
index cdafed7..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extbase\Tests\Unit\Property;
-
-/*                                                                        *
- * This script belongs to the Extbase framework.                            *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License as published by the *
- * Free Software Foundation, either version 3 of the License, or (at your *
- * option) any later version.                                             *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-require_once __DIR__ . '/../../Fixture/TxClassWithGettersAndSetters.php';
-
-/**
- * Test case
- */
-class MapperTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
-
-       /**
-        * @var \TYPO3\CMS\Extbase\Property\Mapper
-        */
-       protected $subject;
-
-       /**
-        * Sets up this test case
-        *
-        * @return void
-        * @author Sebastian Kurfürst <sebastian@typo3.org>
-        */
-       public function setUp() {
-               /** @var \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager $persistenceManager */
-               $persistenceManager = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\PersistenceManager');
-
-               /** @var \TYPO3\CMS\Extbase\Persistence\Generic\QueryFactory $queryFactory */
-               $queryFactory = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QueryFactory');
-
-               /** @var \TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService */
-               $reflectionService = $this-> getAccessibleMock('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService');
-
-               /** @var \TYPO3\CMS\Extbase\Validation\ValidatorResolver $validatorResolver */
-               $validatorResolver = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver');
-
-               $this->subject = $this->getAccessibleMock('TYPO3\CMS\Extbase\Property\Mapper', array('dummy'));
-               $this->subject->_set('persistenceManager', $persistenceManager);
-               $this->subject->_set('queryFactory', $queryFactory);
-               $this->subject->_set('reflectionService', $reflectionService);
-               $this->subject->_set('validatorResolver', $validatorResolver);
-       }
-
-       /**
-        * @test
-        */
-       public function mapReturnsObjectForNamespaceClasses() {
-               /** @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface|\PHPUnit_Framework_MockObject_MockObject $objectManager */
-               $objectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
-               $objectManager->expects($this->at(0))->method('get')->will($this->returnValue($this->getMock('TYPO3\\CMS\\Extbase\\Tests\\Fixture\\ClassWithGettersAndSetters')));
-               $this->subject->_set('objectManager', $objectManager);
-
-               $source = array(
-                       'property1' => 'foo',
-                       'property2' => 'bar'
-               );
-
-               $expectedObject = $this->getMock('TYPO3\\CMS\\Extbase\\Tests\\Fixture\\ClassWithGettersAndSetters');
-               $expectedObject->setProperty1($source['property1']);
-               $expectedObject->setProperty2($source['property2']);
-
-               $this->assertEquals($expectedObject, $this->subject->map(array('property1', 'property2'), $source, 'TYPO3\\CMS\\Extbase\\Tests\\Fixture\\ClassWithGettersAndSetters'));
-       }
-
-       /**
-        * @test
-        */
-       public function mapReturnsObjectForOldTxClasses() {
-
-               /** @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface|\PHPUnit_Framework_MockObject_MockObject $objectManager */
-               $objectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
-               $objectManager->expects($this->at(0))->method('get')->will($this->returnValue($this->getMock('Tx_Extbase_Tests_Fixture_TxClassWithGettersAndSetters')));
-               $this->subject->_set('objectManager', $objectManager);
-               $source = array(
-                       'property1' => 'foo',
-                       'property2' => 'bar'
-               );
-
-               $expectedObject = $this->getMock('Tx_Extbase_Tests_Fixture_TxClassWithGettersAndSetters');
-               $expectedObject->setProperty1($source['property1']);
-               $expectedObject->setProperty2($source['property2']);
-
-               $this->assertEquals($expectedObject, $this->subject->map(array('property1', 'property2'), $source, 'Tx_Extbase_Tests_Fixture_TxClassWithGettersAndSetters'));
-       }
-}
diff --git a/typo3/sysext/extbase/Tests/Unit/Security/Channel/RequestHashServiceTest.php b/typo3/sysext/extbase/Tests/Unit/Security/Channel/RequestHashServiceTest.php
deleted file mode 100644 (file)
index e420901..0000000
+++ /dev/null
@@ -1,413 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extbase\Tests\Unit\Security\Channel;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Test case
- */
-class RequestHashServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
-
-       /**
-        * @return array
-        */
-       public function dataProviderForGenerateRequestHash() {
-               return array(
-                       // Simple cases
-                       array(
-                               array(),
-                               array()
-                       ),
-                       array(
-                               array('field1'),
-                               array('field1' => 1)
-                       ),
-                       array(
-                               array('field1', 'field2'),
-                               array(
-                                       'field1' => 1,
-                                       'field2' => 1
-                               )
-                       ),
-                       // recursion
-                       array(
-                               array('field1', 'field[subfield1]', 'field[subfield2]'),
-                               array(
-                                       'field1' => 1,
-                                       'field' => array(
-                                               'subfield1' => 1,
-                                               'subfield2' => 1
-                                       )
-                               )
-                       ),
-                       // recursion with duplicated field name
-                       array(
-                               array('field1', 'field[subfield1]', 'field[subfield2]', 'field1'),
-                               array(
-                                       'field1' => 1,
-                                       'field' => array(
-                                               'subfield1' => 1,
-                                               'subfield2' => 1
-                                       )
-                               )
-                       ),
-                       // Recursion with un-named fields at the end (...[]). There, they should be made explicit by increasing the counter
-                       array(
-                               array('field1', 'field[subfield1][]', 'field[subfield1][]', 'field[subfield2]'),
-                               array(
-                                       'field1' => 1,
-                                       'field' => array(
-                                               'subfield1' => array(
-                                                       0 => 1,
-                                                       1 => 1
-                                               ),
-                                               'subfield2' => 1
-                                       )
-                               )
-                       )
-               );
-       }
-
-       /**
-        * Data provider for error cases which should throw an exception
-        *
-        * @return array
-        */
-       public function dataProviderForGenerateRequestHashWithUnallowedValues() {
-               return array(
-                       // Overriding form fields (string overridden by array)
-                       array(
-                               array('field1', 'field2', 'field2[bla]', 'field2[blubb]')
-                       ),
-                       array(
-                               array('field1', 'field2[bla]', 'field2[bla][blubb][blubb]')
-                       ),
-                       // Overriding form fields (array overridden by string)
-                       array(
-                               array('field1', 'field2[bla]', 'field2[blubb]', 'field2')
-                       ),
-                       array(
-                               array('field1', 'field2[bla][blubb][blubb]', 'field2[bla]')
-                       ),
-                       // Empty [] not as last argument
-                       array(
-                               array('field1', 'field2[][bla]')
-                       )
-               );
-       }
-
-       /**
-        * @test
-        * @author Sebastian Kurfürst <sebastian@typo3.org>
-        * @dataProvider dataProviderForGenerateRequestHash
-        * @param mixed $input
-        * @param mixed $expected
-        */
-       public function generateRequestHashGeneratesTheCorrectHashesInNormalOperation($input, $expected) {
-               $requestHashService = $this->getMock('TYPO3\\CMS\\Extbase\\Security\\Channel\\RequestHashService', array('serializeAndHashFormFieldArray'));
-               $requestHashService->expects($this->once())->method('serializeAndHashFormFieldArray')->with($expected);
-               $requestHashService->generateRequestHash($input);
-       }
-
-       /**
-        * @test
-        * @author Sebastian Kurfürst <sebastian@typo3.org>
-        * @dataProvider dataProviderForGenerateRequestHashWithUnallowedValues
-        * @expectedException \TYPO3\CMS\Extbase\Security\Exception\InvalidArgumentForRequestHashGenerationException
-        * @param mixed $input
-        */
-       public function generateRequestHashThrowsExceptionInWrongCases($input) {
-               $requestHashService = $this->getMock('TYPO3\\CMS\\Extbase\\Security\\Channel\\RequestHashService', array('serializeAndHashFormFieldArray'));
-               $requestHashService->generateRequestHash($input);
-       }
-
-       /**
-        * @test
-        * @author Sebastian Kurfürst <sebastian@typo3.org>
-        */
-       public function serializeAndHashFormFieldArrayWorks() {
-               $formFieldArray = array(
-                       'bla' => array(
-                               'blubb' => 1,
-                               'hu' => 1
-                       )
-               );
-               $mockHash = '12345';
-               $hashService = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Security\\Cryptography\\HashService', array('generateHmac'));
-               $hashService->expects($this->once())->method('generateHmac')->with(serialize($formFieldArray))->will($this->returnValue($mockHash));
-               $requestHashService = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Security\\Channel\\RequestHashService', array('dummy'));
-               $requestHashService->_set('hashService', $hashService);
-               $expected = serialize($formFieldArray) . $mockHash;
-               $actual = $requestHashService->_call('serializeAndHashFormFieldArray', $formFieldArray);
-               $this->assertEquals($expected, $actual);
-       }
-
-       /**
-        * @test
-        * @author Sebastian Kurfürst
-        */
-       public function verifyRequestHashSetsHmacVerifiedToFalseIfRequestDoesNotHaveAnHmacArgument() {
-               $request = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request', array('getInternalArgument', 'setHmacVerified'));
-               $request->expects($this->any())->method('getInternalArgument')->with('__hmac')->will($this->returnValue(FALSE));
-               $request->expects($this->once())->method('setHmacVerified')->with(FALSE);
-               $requestHashService = new \TYPO3\CMS\Extbase\Security\Channel\RequestHashService();
-               $requestHashService->verifyRequest($request);
-       }
-
-       /**
-        * @test
-        * @expectedException \TYPO3\CMS\Extbase\Security\Exception\SyntacticallyWrongRequestHashException
-        * @author Sebastian Kurfürst
-        */
-       public function verifyRequestHashThrowsExceptionIfHmacIsShortherThan40Characters() {
-               $request = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request', array('getInternalArgument', 'setHmacVerified'));
-               $request->expects($this->any())->method('getInternalArgument')->with('__hmac')->will($this->returnValue('abc'));
-               $requestHashService = new \TYPO3\CMS\Extbase\Security\Channel\RequestHashService();
-               $requestHashService->verifyRequest($request);
-       }
-
-       /**
-        * @test
-        * @author Sebastian Kurfürst
-        */
-       public function verifyRequestHashValidatesTheHashAndSetsHmacVerifiedToFalseIfHashCouldNotBeVerified() {
-               $request = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request', array('getInternalArgument', 'setHmacVerified'));
-               $request->expects($this->any())->method('getInternalArgument')->with('__hmac')->will($this->returnValue('11111' . '0000000000000000000000000000000000000000'));
-               $request->expects($this->once())->method('setHmacVerified')->with(FALSE);
-               $hashService = $this->getMock('TYPO3\\CMS\\Extbase\\Security\\Cryptography\\HashService', array('validateHmac'));
-               $hashService->expects($this->once())->method('validateHmac')->with('11111', '0000000000000000000000000000000000000000')->will($this->returnValue(FALSE));
-               $requestHashService = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Security\\Channel\\RequestHashService', array('dummy'));
-               $requestHashService->_set('hashService', $hashService);
-               $requestHashService->verifyRequest($request);
-       }
-
-       /**
-        * @test
-        * @author Sebastian Kurfürst
-        */
-       public function verifyRequestHashValidatesTheHashAndSetsHmacVerifiedToTrueIfArgumentsAreIncludedInTheAllowedArgumentList() {
-               $data = serialize(array('a' => 1));
-               $request = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request', array('getInternalArgument', 'getArguments', 'setHmacVerified'));
-               $request->expects($this->any())->method('getInternalArgument')->with('__hmac')->will($this->returnValue($data . '0000000000000000000000000000000000000000'));
-               $request->expects($this->once())->method('getArguments')->will($this->returnValue(array(
-                       '__hmac' => 'ABC',
-                       '__referrer' => '...',
-                       'a' => 'bla'
-               )));
-               $request->expects($this->once())->method('setHmacVerified')->with(TRUE);
-               $hashService = $this->getMock('TYPO3\\CMS\\Extbase\\Security\\Cryptography\\HashService', array('validateHmac'));
-               $hashService->expects($this->once())->method('validateHmac')->with($data, '0000000000000000000000000000000000000000')->will($this->returnValue(TRUE));
-               $requestHashService = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Security\\Channel\\RequestHashService', array('checkFieldNameInclusion'));
-               $requestHashService->expects($this->once())->method('checkFieldNameInclusion')->with(array('a' => 'bla'), array('a' => 1))->will($this->returnValue(TRUE));
-               $requestHashService->_set('hashService', $hashService);
-               $requestHashService->verifyRequest($request);
-       }
-
-       /**
-        * @test
-        * @author Sebastian Kurfürst
-        */
-       public function verifyRequestHashValidatesTheHashAndSetsHmacVerifiedToFalseIfNotAllArgumentsAreIncludedInTheAllowedArgumentList() {
-               $data = serialize(array('a' => 1));
-               $request = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request', array('getInternalArgument', 'getArguments', 'setHmacVerified'));
-               $request->expects($this->any())->method('getInternalArgument')->with('__hmac')->will($this->returnValue($data . '0000000000000000000000000000000000000000'));
-               $request->expects($this->once())->method('getArguments')->will($this->returnValue(array(
-                       '__hmac' => 'ABC',
-                       '__referrer' => '...',
-                       'a' => 'bla',
-                       'b' => 'blubb'
-               )));
-               $request->expects($this->once())->method('setHmacVerified')->with(FALSE);
-               $hashService = $this->getMock('TYPO3\\CMS\\Extbase\\Security\\Cryptography\\HashService', array('validateHmac'));
-               $hashService->expects($this->once())->method('validateHmac')->with($data, '0000000000000000000000000000000000000000')->will($this->returnValue(TRUE));
-               $requestHashService = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Security\\Channel\\RequestHashService', array('checkFieldNameInclusion'));
-               $requestHashService->expects($this->once())->method('checkFieldNameInclusion')->with(array('a' => 'bla', 'b' => 'blubb'), array('a' => 1))->will($this->returnValue(FALSE));
-               $requestHashService->_set('hashService', $hashService);
-               $requestHashService->verifyRequest($request);
-       }
-
-       /**
-        * Data Provider for checkFieldNameInclusionWorks
-        *
-        * @return array
-        */
-       public function dataProviderForCheckFieldNameInclusion() {
-               return array(
-                       // Simple fields with requestfields = responsefields
-                       array(
-                               // Request
-                               array(
-                                       'a' => 'X',
-                                       'b' => 'X',
-                                       'c' => 'X'
-                               ),
-                               // Allowed
-                               array(
-                                       'a' => 1,
-                                       'b' => 1,
-                                       'c' => 1
-                               ),
-                               // Expected result
-                               TRUE
-                       ),
-                       // Simple fields with requestfields < responsefields
-                       array(
-                               // Request
-                               array(
-                                       'a' => 'X',
-                                       'c' => 'X'
-                               ),
-                               // Allowed
-                               array(
-                                       'a' => 1,
-                                       'b' => 1,
-                                       'c' => 1
-                               ),
-                               // Expected result
-                               TRUE
-                       ),
-                       // Simple fields with requestfields > responsefields
-                       array(
-                               // Request
-                               array(
-                                       'a' => 'X',
-                                       'b' => 'X',
-                                       'c' => 'X'
-                               ),
-                               // Allowed
-                               array(
-                                       'a' => 1,
-                                       'b' => 1
-                               ),
-                               // Expected result
-                               FALSE
-                       ),
-                       // Hierarchical fields with requestfields < responsefields
-                       array(
-                               // Request
-                               array(
-                                       'a' => array(
-                                               'b' => 'X'
-                                       ),
-                                       'c' => 'X'
-                               ),
-                               // Allowed
-                               array(
-                                       'a' => array(
-                                               'b' => 1,
-                                               'abc' => 1
-                                       ),
-                                       'c' => 1
-                               ),
-                               // Expected result
-                               TRUE
-                       ),
-                       // Hierarchical fields with requestfields > responsefields
-                       array(
-                               // Request
-                               array(
-                                       'a' => array(
-                                               'b' => 'X',
-                                               'abc' => 'X'
-                                       ),
-                                       'c' => 'X'
-                               ),
-                               // Allowed
-                               array(
-                                       'a' => array(
-                                               'b' => 1
-                                       ),
-                                       'c' => 1
-                               ),
-                               // Expected result
-                               FALSE
-                       ),
-                       // hierarchical fields with requestfields != responsefields (different types) - 1
-                       array(
-                               // Request
-                               array(
-                                       'a' => array(
-                                               'b' => 'X',
-                                               'c' => 'X'
-                                       ),
-                                       'b' => 'X',
-                                       'c' => 'X'
-                               ),
-                               // Allowed
-                               array(
-                                       'a' => 1,
-                                       'b' => 1,
-                                       'c' => 1
-                               ),
-                               // Expected result
-                               FALSE
-                       ),
-                       // hierarchical fields with requestfields != responsefields (different types) - 2
-                       array(
-                               // Request
-                               array(
-                                       'a' => 'X',
-                                       'b' => 'X',
-                                       'c' => 'X'
-                               ),
-                               // Allowed
-                               array(
-                                       'a' => array(
-                                               'x' => 1,
-                                               'y' => 1
-                                       ),
-                                       'b' => 1,
-                                       'c' => 1
-                               ),
-                               // Expected result
-                               FALSE
-                       ),
-                       // hierarchical fields with requestfields != responsefields (different types)
-                       // This case happens if an array of checkboxes is rendered, in case they are fully unchecked.
-                       array(
-                               // Request
-                               array(
-                                       'a' => '',
-                                       // this is the only allowed value.
-                                       'b' => 'X',
-                                       'c' => 'X'
-                               ),
-                               // Allowed
-                               array(
-                                       'a' => array(
-                                               'x' => 1,
-                                               'y' => 1
-                                       ),
-                                       'b' => 1,
-                                       'c' => 1
-                               ),
-                               // Expected result
-                               TRUE
-                       )
-               );
-       }
-
-       /**
-        * @test
-        * @author Sebastian Kurfürst <sebastian@typo3.org>
-        * @dataProvider dataProviderForCheckFieldNameInclusion
-        * @param mixed $requestArguments
-        * @param mixed $allowedFields
-        * @param mixed $expectedResult
-        */
-       public function checkFieldNameInclusionWorks($requestArguments, $allowedFields, $expectedResult) {
-               $requestHashService = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Security\\Channel\\RequestHashService', array('dummy'));
-               $this->assertEquals($expectedResult, $requestHashService->_call('checkFieldNameInclusion', $requestArguments, $allowedFields));
-       }
-}
diff --git a/typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/AlphanumericValidatorTest.php b/typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/AlphanumericValidatorTest.php
deleted file mode 100644 (file)
index 9129e24..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator\BeforeExtbase14;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Test case
- *
- * This testcase checks the expected behavior for Extbase < 1.4.0, to make sure
- * we do not break backwards compatibility.
- */
-class AlphanumericValidatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
-
-       /**
-        * @test
-        */
-       public function alphanumericValidatorReturnsTrueForAnAlphanumericString() {
-               $alphanumericValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\AlphanumericValidator', array('dummy'), array(), '', FALSE);
-               $alphanumericValidator->expects($this->never())->method('addError');
-               $alphanumericValidator->isValid('12ssDF34daweidf');
-       }
-
-       /**
-        * @test
-        */
-       public function alphanumericValidatorReturnsFalseForAStringWithSpecialCharacters() {
-               /** @var \TYPO3\CMS\Extbase\Validation\Validator\AlphanumericValidator $alphanumericValidator */
-               $alphanumericValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\AlphanumericValidator', array('translateErrorMessage'), array(), '', FALSE);
-               $alphanumericValidator->expects($this->never())->method('addError');
-               $alphanumericValidator->isValid('adsf%&/$jklsfdö');
-       }
-
-       /**
-        * @test
-        */
-       public function alphanumericValidatorCreatesTheCorrectErrorForAnInvalidSubject() {
-               $alphanumericValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\AlphanumericValidator', array('addError', 'translateErrorMessage'), array(), '', FALSE);
-               // we only test for the error key, after the translation method is mocked.
-               $alphanumericValidator->expects($this->once())->method('addError')->with(NULL, 1221551320);
-               $alphanumericValidator->isValid('adsf%&/$jklsfdö');
-       }
-}
diff --git a/typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/ConjunctionValidatorTest.php b/typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/ConjunctionValidatorTest.php
deleted file mode 100644 (file)
index 81453d7..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator\BeforeExtbase14;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Test case
- *
- * This testcase checks the expected behavior for Extbase < 1.4.0, to make sure
- * we do not break backwards compatibility.
- */
-class ConjunctionValidatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
-
-       /**
-        * @test
-        */
-       public function addingValidatorsToAJunctionValidatorWorks() {
-               $proxyClassName = $this->buildAccessibleProxy('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ConjunctionValidator');
-               $conjunctionValidator = new $proxyClassName();
-               $mockValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('isValid'));
-               $conjunctionValidator->addValidator($mockValidator);
-               $this->assertTrue($conjunctionValidator->_get('validators')->contains($mockValidator));
-       }
-
-       /**
-        * @test
-        */
-       public function allValidatorsInTheConjunctionAreCalledEvenIfOneReturnsFalse() {
-               $validatorConjunction = new \TYPO3\CMS\Extbase\Validation\Validator\ConjunctionValidator();
-               $validatorObject = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('isValid'));
-               $validatorObject->expects($this->once())->method('isValid')->will($this->returnValue(TRUE));
-               $secondValidatorObject = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('isValid', 'getErrors'));
-               $secondValidatorObject->expects($this->once())->method('isValid')->will($this->returnValue(FALSE));
-               $secondValidatorObject->expects($this->any())->method('getErrors')->will($this->returnValue(array()));
-               $thirdValidatorObject = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('isValid'));
-               $thirdValidatorObject->expects($this->once())->method('isValid')->will($this->returnValue(TRUE));
-               $validatorConjunction->addValidator($validatorObject);
-               $validatorConjunction->addValidator($secondValidatorObject);
-               $validatorConjunction->addValidator($thirdValidatorObject);
-               $validatorConjunction->isValid('some subject');
-       }
-
-       /**
-        * @test
-        */
-       public function validatorConjunctionReturnsTrueIfAllJunctionedValidatorsReturnTrue() {
-               $validatorConjunction = new \TYPO3\CMS\Extbase\Validation\Validator\ConjunctionValidator();
-               $validatorObject = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('isValid'));
-               $validatorObject->expects($this->any())->method('isValid')->will($this->returnValue(TRUE));
-               $secondValidatorObject = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('isValid'));
-               $secondValidatorObject->expects($this->any())->method('isValid')->will($this->returnValue(TRUE));
-               $validatorConjunction->addValidator($validatorObject);
-               $validatorConjunction->addValidator($secondValidatorObject);
-               $this->assertTrue($validatorConjunction->isValid('some subject'));
-       }
-
-       /**
-        * @test
-        */
-       public function validatorConjunctionReturnsFalseIfOneValidatorReturnsFalse() {
-               $validatorConjunction = new \TYPO3\CMS\Extbase\Validation\Validator\ConjunctionValidator();
-               $validatorObject = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('isValid', 'getErrors'));
-               $validatorObject->expects($this->any())->method('isValid')->will($this->returnValue(FALSE));
-               $validatorObject->expects($this->any())->method('getErrors')->will($this->returnValue(array()));
-               $validatorConjunction->addValidator($validatorObject);
-               $this->assertFalse($validatorConjunction->isValid('some subject'));
-       }
-
-       /**
-        * @test
-        */
-       public function removingAValidatorOfTheValidatorConjunctionWorks() {
-               $validatorConjunction = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ConjunctionValidator', array('dummy'), array(), '', TRUE);
-               $validator1 = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface');
-               $validator2 = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface');
-               $validatorConjunction->addValidator($validator1);
-               $validatorConjunction->addValidator($validator2);
-               $validatorConjunction->removeValidator($validator1);
-               $this->assertFalse($validatorConjunction->_get('validators')->contains($validator1));
-               $this->assertTrue($validatorConjunction->_get('validators')->contains($validator2));
-       }
-
-       /**
-        * @test
-        * @expectedException \TYPO3\CMS\Extbase\Validation\Exception\NoSuchValidatorException
-        */
-       public function removingANotExistingValidatorIndexThrowsException() {
-               $validatorConjunction = new \TYPO3\CMS\Extbase\Validation\Validator\ConjunctionValidator();
-               $validator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface');
-               $validatorConjunction->removeValidator($validator);
-       }
-
-       /**
-        * @test
-        */
-       public function countReturnesTheNumberOfValidatorsContainedInTheConjunction() {
-               $validatorConjunction = new \TYPO3\CMS\Extbase\Validation\Validator\ConjunctionValidator();
-               $validator1 = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface');
-               $validator2 = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface');
-               $this->assertSame(0, count($validatorConjunction));
-               $validatorConjunction->addValidator($validator1);
-               $validatorConjunction->addValidator($validator2);
-               $this->assertSame(2, count($validatorConjunction));
-       }
-}
diff --git a/typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/DateTimeValidatorTest.php b/typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/DateTimeValidatorTest.php
deleted file mode 100644 (file)
index 20c0320..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator\BeforeExtbase14;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Test case
- *
- * This testcase checks the expected behavior for Extbase < 1.4.0, to make sure
- * we do not break backwards compatibility.
- */
-class DateTimeValidatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
-
-       /**
-        * @test
-        */
-       public function dateTimeValidatorReturnsTrueForAValidDateTimeObject() {
-               $dateTimeValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\DateTimeValidator', array('addError'), array(), '', FALSE);
-               $dateTimeValidator->expects($this->never())->method('addError');
-               $dateTimeValidator->isValid(new \DateTime());
-       }
-
-       /**
-        * @test
-        */
-       public function dateTimeValidatorReturnsFalseForAnInvalidDateTimeObject() {
-               $dateTimeValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\DateTimeValidator', array('addError', 'translateErrorMessage'), array(), '', FALSE);
-               $dateTimeValidator->expects($this->once())->method('addError');
-               $dateTimeValidator->isValid('blah');
-       }
-}
diff --git a/typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/EmailAddressValidatorTest.php b/typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/EmailAddressValidatorTest.php
deleted file mode 100644 (file)
index fe891c0..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator\BeforeExtbase14;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Test case
- *
- * This testcase checks the expected behavior for Extbase < 1.4.0, to make sure
- * we do not break backwards compatibility.
- */
-class EmailAddressValidatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
-
-       /**
-        * Data provider with valid email addresses
-        *
-        * @return array
-        */
-       public function validAddresses() {
-               return array(
-                       array('andreas.foerthner@netlogix.de'),
-                       array('user@localhost.localdomain'),
-                       array('info@guggenheim.museum'),
-                       array('just@test.invalid'),
-                       array('just+spam@test.de')
-               );
-       }
-
-       /**
-        * @test
-        * @dataProvider validAddresses
-        * @param mixed $address
-        */
-       public function emailAddressValidatorReturnsTrueForAValidEmailAddress($address) {
-               $emailAddressValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\EmailAddressValidator', array('addError'), array(), '', FALSE);
-               $emailAddressValidator->expects($this->never())->method('addError');
-               $emailAddressValidator->isValid($address);
-       }
-
-       /**
-        * Data provider with invalid email addresses
-        *
-        * @return array
-        */
-       public function invalidAddresses() {
-               return array(
-                       array('andreas.foerthner@'),
-                       array('andreas@foerthner@example.com'),
-                       array('@typo3.org'),
-                       array('someone@typo3.'),
-                       array('local@192.168.2'),
-                       array('local@192.168.270.1'),
-                       array('just@test.invalid ')
-               );
-       }
-
-       /**
-        * @test
-        * @dataProvider invalidAddresses
-        * @param mixed $address
-        */
-       public function emailAddressValidatorReturnsFalseForAnInvalidEmailAddress($address) {
-               $emailAddressValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\EmailAddressValidator', array('addError', 'translateErrorMessage'), array(), '', FALSE);
-               $emailAddressValidator->expects($this->once())->method('addError');
-               $emailAddressValidator->isValid($address);
-       }
-
-       /**
-        * @test
-        */
-       public function emailValidatorCreatesTheCorrectErrorForAnInvalidEmailAddress() {
-               $emailAddressValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\EmailAddressValidator', array('addError', 'translateErrorMessage'), array(), '', FALSE);
-               // we only test for the error key, after the translation method is mocked.
-               $emailAddressValidator->expects($this->once())->method('addError')->with(NULL, 1221559976);
-               $emailAddressValidator->isValid('notAValidMail@Address');
-       }
-}
diff --git a/typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/FloatValidatorTest.php b/typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/FloatValidatorTest.php
deleted file mode 100644 (file)
index c3da189..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator\BeforeExtbase14;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Test case
- *
- * This testcase checks the expected behavior for Extbase < 1.4.0, to make sure
- * we do not break backwards compatibility.
- */
-class FloatValidatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
-
-       /**
-        * Data provider with valid floating point numbers
-        *
-        * @return array Floats, both as float and string
-        */
-       public function validFloatingPointNumbers() {
-               return array(
-                       array(1029437.234726),
-                       array(-666.66),
-                       array('123.45'),
-                       array('+123.45'),
-                       array('-123.45'),
-                       array('123.45e3'),
-                       array(123450.0)
-               );
-       }
-
-       /**
-        * Data provider with valid floating point numbers
-        *
-        * @return array Floats, both as float and string
-        */
-       public function invalidFloatingPointNumbers() {
-               return array(
-                       array(1029437),
-                       array(-666),
-                       array('1029437'),
-                       array('-666'),
-                       array('not a number')
-               );
-       }
-
-       /**
-        * @test
-        * @dataProvider validFloatingPointNumbers
-        * @param mixed $number
-        */
-       public function floatValidatorReturnsTrueForAValidFloat($number) {
-               $floatValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\FloatValidator', array('addError'), array(), '', FALSE);
-               $floatValidator->expects($this->never())->method('addError');
-               $floatValidator->isValid($number);
-       }
-
-       /**
-        * @test
-        * @dataProvider invalidFloatingPointNumbers
-        * @param mixed $number
-        */
-       public function floatValidatorReturnsFalseForAnInvalidFloat($number) {
-               $floatValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\FloatValidator', array('addError', 'translateErrorMessage'), array(), '', FALSE);
-               $floatValidator->expects($this->once())->method('addError');
-               $floatValidator->isValid($number);
-       }
-
-       /**
-        * @test
-        */
-       public function floatValidatorCreatesTheCorrectErrorForAnInvalidSubject() {
-               $floatValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\FloatValidator', array('addError', 'translateErrorMessage'), array(), '', FALSE);
-               // we only test for the error key, after the translation method is mocked.
-               $floatValidator->expects($this->once())->method('addError')->with(NULL, 1221560288);
-               $floatValidator->isValid(123456);
-       }
-}
diff --git a/typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/GenericObjectValidatorTest.php b/typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/GenericObjectValidatorTest.php
deleted file mode 100644 (file)
index 67a0996..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator\BeforeExtbase14;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Test case
- *
- * This testcase checks the expected behavior for Extbase < 1.4.0, to make sure
- * we do not break backwards compatibility.
- */
-class GenericObjectValidatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
-
-       /**
-        * @test
-        */
-       public function isValidReturnsFalseIfTheValueIsNoObject() {
-               $configurationManager = $this->getMock('TYPO3\CMS\Extbase\Configuration\ConfigurationManager', array('isFeatureEnabled'), array(), '', FALSE);
-               $configurationManager->expects($this->any())->method('isFeatureEnabled')->with('rewrittenPropertyMapper')->will($this->returnValue(FALSE));
-               $validator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\GenericObjectValidator', array('addError', 'translateErrorMessage'), array(), '', FALSE);
-               $validator->injectConfigurationManager($configurationManager);
-               $this->assertFalse($validator->isValid('foo'));
-       }
-
-       /**
-        * @test
-        */
-       public function isValidChecksAllPropertiesForWhichAPropertyValidatorExists() {
-               $configurationManager = $this->getMock('TYPO3\CMS\Extbase\Configuration\ConfigurationManager', array('isFeatureEnabled'), array(), '', FALSE);
-               $configurationManager->expects($this->any())->method('isFeatureEnabled')->with('rewrittenPropertyMapper')->will($this->returnValue(FALSE));
-               $mockPropertyValidators = array('foo' => 'validator', 'bar' => 'validator');
-               $mockObject = new \stdClass();
-               $validator = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\GenericObjectValidator', array('addError', 'isPropertyValid'), array(), '', FALSE);
-               $validator->injectConfigurationManager($configurationManager);
-               $validator->_set('propertyValidators', $mockPropertyValidators);
-               $validator->expects($this->at(0))->method('isPropertyValid')->with($mockObject, 'foo')->will($this->returnValue(TRUE));
-               $validator->expects($this->at(1))->method('isPropertyValid')->with($mockObject, 'bar')->will($this->returnValue(TRUE));
-               $validator->isValid($mockObject);
-       }
-}
diff --git a/typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/IntegerValidatorTest.php b/typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/IntegerValidatorTest.php
deleted file mode 100644 (file)
index f289c92..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator\BeforeExtbase14;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Test case
- *
- * This testcase checks the expected behavior for Extbase < 1.4.0, to make sure
- * we do not break backwards compatibility.
- */
-class IntegerValidatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
-
-       /**
-        * Data provider with valid integer numbers
-        *
-        * @return array Integers, both as int and strings
-        */
-       public function validIntegerNumbers() {
-               return array(
-                       array(1029437),
-                       array(-666),
-                       array('12345'),
-                       array('+12345'),
-                       array('-12345')
-               );
-       }
-
-       /**
-        * Data provider with invalid integer numbers
-        *
-        * @return array Various values of int, float and strings
-        */
-       public function invalidIntegerNumbers() {
-               return array(
-                       array('not a number'),
-                       array(3.1415),
-                       array(-0.75),
-                       array('12345.987'),
-                       array('-123.45')
-               );
-       }
-
-       /**
-        * @test
-        * @dataProvider validIntegerNumbers
-        * @param mixed $number
-        */
-       public function integerValidatorReturnsTrueForAValidInteger($number) {
-               $integerValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\IntegerValidator', array('addError'), array(), '', FALSE);
-               $integerValidator->expects($this->never())->method('addError');
-               $integerValidator->isValid($number);
-       }
-
-       /**
-        * @test
-        * @dataProvider invalidIntegerNumbers
-        * @param mixed $number
-        */
-       public function integerValidatorReturnsFalseForAnInvalidInteger($number) {
-               $integerValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\IntegerValidator', array('addError', 'translateErrorMessage'), array(), '', FALSE);
-               $integerValidator->expects($this->once())->method('addError');
-               $integerValidator->isValid($number);
-       }
-
-       /**
-        * @test
-        */
-       public function integerValidatorCreatesTheCorrectErrorForAnInvalidSubject() {
-               $integerValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\IntegerValidator', array('addError', 'translateErrorMessage'), array(), '', FALSE);
-               // we only test for the error key, after the translation method is mocked.
-               $integerValidator->expects($this->once())->method('addError')->with(NULL, 1221560494);
-               $integerValidator->isValid('not a number');
-       }
-}
diff --git a/typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/NotEmptyValidatorTest.php b/typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/NotEmptyValidatorTest.php
deleted file mode 100644 (file)
index 9b3e938..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator\BeforeExtbase14;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Test case
- *
- * This testcase checks the expected behavior for Extbase < 1.4.0, to make sure
- * we do not break backwards compatibility.
- */
-class NotEmptyValidatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
-
-       /**
-        * @test
-        */
-       public function notEmptyValidatorReturnsTrueForASimpleString() {
-               $notEmptyValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\NotEmptyValidator', array('addError'), array(), '', FALSE);
-               $notEmptyValidator->expects($this->never())->method('addError');
-               $notEmptyValidator->isValid('a not empty string');
-       }
-
-       /**
-        * @test
-        */
-       public function notEmptyValidatorReturnsFalseForAnEmptyString() {
-               $notEmptyValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\NotEmptyValidator', array('addError', 'translateErrorMessage'), array(), '', FALSE);
-               $notEmptyValidator->expects($this->once())->method('addError');
-               $notEmptyValidator->isValid('');
-       }
-
-       /**
-        * @test
-        */
-       public function notEmptyValidatorReturnsFalseForANullValue() {
-               $notEmptyValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\NotEmptyValidator', array('addError', 'translateErrorMessage'), array(), '', FALSE);
-               $notEmptyValidator->expects($this->once())->method('addError');
-               $notEmptyValidator->isValid(NULL);
-       }
-
-       /**
-        * @test
-        */
-       public function notEmptyValidatorCreatesTheCorrectErrorForAnEmptySubject() {
-               $notEmptyValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\NotEmptyValidator', array('addError', 'translateErrorMessage'), array(), '', FALSE);
-               // we only test for the error key, after the translation method is mocked.
-               $notEmptyValidator->expects($this->once())->method('addError')->with(NULL, 1221560718);
-               $notEmptyValidator->isValid('');
-       }
-
-       /**
-        * @test
-        */
-       public function notEmptyValidatorCreatesTheCorrectErrorForANullValue() {
-               $notEmptyValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\NotEmptyValidator', array('addError', 'translateErrorMessage'), array(), '', FALSE);
-               // we only test for the error key, after the translation method is mocked.
-               $notEmptyValidator->expects($this->once())->method('addError')->with(NULL, 1221560910);
-               $notEmptyValidator->isValid(NULL);
-       }
-}
diff --git a/typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/NumberRangeValidatorTest.php b/typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/NumberRangeValidatorTest.php
deleted file mode 100644 (file)
index 978d8e2..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator\BeforeExtbase14;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Test case
- *
- * This testcase checks the expected behavior for Extbase < 1.4.0, to make sure
- * we do not break backwards compatibility.
- */
-class NumberRangeValidatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
-
-       /**
-        * @test
-        */
-       public function deprecatedOptionsAreStillSupported() {
-               $this->getMock(
-                       'TYPO3\\CMS\\Extbase\\Validation\\Validator\\NumberRangeValidator',
-                       array(),
-                       array(array('startRange' => 0, 'endRange' => 1000))
-               );
-       }
-
-       /**
-        * @test
-        */
-       public function numberRangeValidatorReturnsTrueForASimpleIntegerInRange() {
-               $numberRangeValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\NumberRangeValidator', array('addError'), array(), '', FALSE);
-               $numberRangeValidator->expects($this->never())->method('addError');
-               $numberRangeValidator->setOptions(array('startRange' => 0, 'endRange' => 1000));
-               $numberRangeValidator->isValid(10.5);
-       }
-
-       /**
-        * @test
-        */
-       public function numberRangeValidatorReturnsFalseForANumberOutOfRange() {
-               $numberRangeValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\NumberRangeValidator', array('addError', 'translateErrorMessage'), array(), '', FALSE);
-               $numberRangeValidator->expects($this->once())->method('addError');
-               $numberRangeValidator->setOptions(array('startRange' => 0, 'endRange' => 1000));
-               $numberRangeValidator->isValid(1000.1);
-       }
-
-       /**
-        * @test
-        */
-       public function numberRangeValidatorReturnsTrueForANumberInReversedRange() {
-               $numberRangeValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\NumberRangeValidator', array('addError'), array(), '', FALSE);
-               $numberRangeValidator->expects($this->never())->method('addError');
-               $numberRangeValidator->setOptions(array('startRange' => 1000, 'endRange' => 0));
-               $numberRangeValidator->isValid(100);
-       }
-
-       /**
-        * @test
-        */
-       public function numberRangeValidatorReturnsFalseForAString() {
-               $numberRangeValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\NumberRangeValidator', array('addError', 'translateErrorMessage'), array(), '', FALSE);
-               $numberRangeValidator->expects($this->once())->method('addError');
-               $numberRangeValidator->setOptions(array('startRange' => 0, 'endRange' => 1000));
-               $numberRangeValidator->isValid('not a number');
-       }
-
-       /**
-        * @test
-        */
-       public function numberRangeValidatorCreatesTheCorrectErrorForANumberOutOfRange() {
-               $startRange = 1;
-               $endRange = 42;
-
-               $numberRangeValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\NumberRangeValidator', array('addError', 'translateErrorMessage'), array(), '', FALSE);
-               // we only test for the error key, after the translation method is mocked.
-               $numberRangeValidator->expects($this->once())->method('addError')->with(NULL, 1221561046, array(1, 42));
-               $numberRangeValidator->setOptions(array('startRange' => $startRange, 'endRange' => $endRange));
-               $numberRangeValidator->isValid(4711);
-       }
-
-       /**
-        * @test
-        */
-       public function numberRangeValidatorCreatesTheCorrectErrorForAStringSubject() {
-               $numberRangeValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\NumberRangeValidator', array('addError', 'translateErrorMessage'), array(), '', FALSE);
-               // we only test for the error key, after the translation method is mocked.
-               $numberRangeValidator->expects($this->once())->method('addError')->with(NULL, 1221563685);
-               $numberRangeValidator->setOptions(array('startRange' => 0, 'endRange' => 42));
-               $numberRangeValidator->isValid('this is not between 0 an 42');
-       }
-}
diff --git a/typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/NumberValidatorTest.php b/typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/NumberValidatorTest.php
deleted file mode 100644 (file)
index 72e4d81..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator\BeforeExtbase14;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Test case
- *
- * This testcase checks the expected behavior for Extbase < 1.4.0, to make sure
- * we do not break backwards compatibility.
- */
-class NumberValidatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
-
-       /**
-        * @test
-        */
-       public function numberValidatorReturnsTrueForASimpleInteger() {
-               $numberValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\NumberValidator', array('addError'), array(), '', FALSE);
-               $numberValidator->expects($this->never())->method('addError');
-               $numberValidator->isValid(1029437);
-       }
-
-       /**
-        * @test
-        */
-       public function numberValidatorReturnsFalseForAString() {
-               $numberValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\NumberValidator', array('addError', 'translateErrorMessage'), array(), '', FALSE);
-               $numberValidator->expects($this->once())->method('addError');
-               $numberValidator->isValid('not a number');
-       }
-
-       /**
-        * @test
-        */
-       public function numberValidatorCreatesTheCorrectErrorForAnInvalidSubject() {
-               $numberValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\NumberValidator', array('addError', 'translateErrorMessage'), array(), '', FALSE);
-               // we only test for the error key, after the translation method is mocked.
-               $numberValidator->expects($this->once())->method('addError')->with(NULL, 1221563685);
-               $numberValidator->isValid('this is not a number');
-       }
-}
diff --git a/typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/RawValidatorTest.php b/typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/RawValidatorTest.php
deleted file mode 100644 (file)
index d0096d3..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator\BeforeExtbase14;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Test case
- *
- * This testcase checks the expected behavior for Extbase < 1.4.0, to make sure
- * we do not break backwards compatibility.
- */
-class RawValidatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
-
-       /**
-        * @test
-        */
-       public function theRawValidatorAlwaysReturnsTRUE() {
-               $rawValidator = $this->getMock('TYPO3\CMS\Extbase\Validation\Validator\RawValidator', array('addError'), array(), '', FALSE);
-               $rawValidator->expects($this->never())->method('addError');
-               $rawValidator->isValid('simple1expression');
-               $rawValidator->isValid('');
-               $rawValidator->isValid(NULL);
-               $rawValidator->isValid(FALSE);
-               $rawValidator->isValid(new \ArrayObject());
-       }
-}
diff --git a/typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/RegularExpressionValidatorTest.php b/typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/RegularExpressionValidatorTest.php
deleted file mode 100644 (file)
index 02e2759..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator\BeforeExtbase14;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Test case
- *
- * This testcase checks the expected behavior for Extbase < 1.4.0, to make sure
- * we do not break backwards compatibility.
- */
-class RegularExpressionValidatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
-
-       /**
-        * @test
-        */
-       public function regularExpressionValidatorMatchesABasicExpressionCorrectly() {
-               $regularExpressionValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\RegularExpressionValidator', array('addError', 'translateErrorMessage'), array(), '', FALSE);
-               $regularExpressionValidator->expects($this->once())->method('addError');
-               $regularExpressionValidator->setOptions(array('regularExpression' => '/^simple[0-9]expression$/'));
-               $regularExpressionValidator->isValid('simple1expression');
-               $regularExpressionValidator->isValid('simple1expressions');
-       }
-
-       /**
-        * @test
-        */
-       public function regularExpressionValidatorCreatesTheCorrectErrorIfTheExpressionDidNotMatch() {
-               $regularExpressionValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\RegularExpressionValidator', array('addError', 'translateErrorMessage'), array(), '', FALSE);
-               // we only test for the error key, after the translation method is mocked.
-               $regularExpressionValidator->expects($this->once())->method('addError')->with(NULL, 1221565130);
-               $regularExpressionValidator->setOptions(array('regularExpression' => '/^simple[0-9]expression$/'));
-               $regularExpressionValidator->isValid('some subject that will not match');
-       }
-}
diff --git a/typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/StringLengthValidatorTest.php b/typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/StringLengthValidatorTest.php
deleted file mode 100644 (file)
index e1d6dc6..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator\BeforeExtbase14;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Test case
- *
- * This testcase checks the expected behavior for Extbase < 1.4.0, to make sure
- * we do not break backwards compatibility.
- */
-class StringLengthValidatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
-
-       /**
-        * @test
-        */
-       public function stgringLengthValidatorReturnsTrueForAStringShorterThanMaxLengthAndLongerThanMinLength() {
-               $stringLengthValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\StringLengthValidator', array('addError'), array(), '', FALSE);
-               $stringLengthValidator->expects($this->never())->method('addError');
-               $stringLengthValidator->setOptions(array('minimum' => 0, 'maximum' => 50));
-               $stringLengthValidator->isValid('this is a very simple string');
-       }
-
-       /**
-        * @test
-        */
-       public function stringLengthValidatorReturnsFalseForAStringShorterThanThanMinLength() {
-               $stringLengthValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\StringLengthValidator', array('addError', 'translateErrorMessage'), array(), '', FALSE);
-               $stringLengthValidator->expects($this->once())->method('addError');
-               $stringLengthValidator->setOptions(array('minimum' => 50, 'maximum' => 100));
-               $stringLengthValidator->isValid('this is a very short string');
-       }
-
-       /**
-        * @test
-        */
-       public function stringLengthValidatorReturnsFalseForAStringLongerThanThanMaxLength() {
-               $stringLengthValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\StringLengthValidator', array('addError', 'translateErrorMessage'), array(), '', FALSE);
-               $stringLengthValidator->expects($this->once())->method('addError');
-               $stringLengthValidator->setOptions(array('minimum' => 5, 'maximum' => 10));
-               $stringLengthValidator->isValid('this is a very short string');
-       }
-
-       /**
-        * @test
-        * @expectedException \TYPO3\CMS\Extbase\Validation\Exception\InvalidValidationOptionsException
-        */
-       public function stringLengthValidatorReturnsTrueForAStringLongerThanThanMinLengthAndMaxLengthNotSpecified() {
-               $stringLengthValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\StringLengthValidator', array('addError'), array(), '', FALSE);
-               $stringLengthValidator->setOptions(array('minimum' => 5));
-               $stringLengthValidator->isValid('this is a very short string');
-       }
-
-       /**
-        * @test
-        */
-       public function stringLengthValidatorReturnsTrueForAStringShorterThanThanMaxLengthAndMinLengthNotSpecified() {
-               $stringLengthValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\StringLengthValidator', array('addError'), array(), '', FALSE);
-               $stringLengthValidator->expects($this->never())->method('addError');
-               $stringLengthValidator->setOptions(array('maximum' => 100));
-       }
-
-       /**
-        * @test
-        */
-       public function stringLengthValidatorReturnsTrueForAStringLengthEqualToMaxLengthAndMinLengthNotSpecified() {
-               $stringLengthValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\StringLengthValidator', array('addError'), array(), '', FALSE);
-               $stringLengthValidator->expects($this->never())->method('addError');
-               $stringLengthValidator->setOptions(array('maximum' => 10));
-               $stringLengthValidator->isValid('1234567890');
-       }
-
-       /**
-        * @test
-        * @expectedException \TYPO3\CMS\Extbase\Validation\Exception\InvalidValidationOptionsException
-        */
-       public function stringLengthValidatorReturnsTrueForAStringLengthEqualToMinLengthAndMaxLengthNotSpecified() {
-               $stringLengthValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\StringLengthValidator', array('addError'), array(), '', FALSE);
-               $stringLengthValidator->setOptions(array('minimum' => 10));
-               $stringLengthValidator->isValid('1234567890');
-       }
-
-       /**
-        * @test
-        */
-       public function stringLengthValidatorReturnsTrueIfMinLengthAndMaxLengthAreEqualAndTheGivenStringMatchesThisValue() {
-               $stringLengthValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\StringLengthValidator', array('addError'), array(), '', FALSE);
-               $stringLengthValidator->expects($this->never())->method('addError');
-               $stringLengthValidator->setOptions(array('minimum' => 10, 'maximum' => 10));
-               $stringLengthValidator->isValid('1234567890');
-       }
-
-       /**
-        * @test
-        */
-       public function stringLengthValidatorReturnsTrueIfTheStringLengthIsEqualToMaxLength() {
-               $stringLengthValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\StringLengthValidator', array('addError'), array(), '', FALSE);
-               $stringLengthValidator->expects($this->never())->method('addError');
-               $stringLengthValidator->setOptions(array('minimum' => 1, 'maximum' => 10));
-               $stringLengthValidator->isValid('1234567890');
-       }
-
-       /**
-        * @test
-        */
-       public function stringLengthValidatorReturnsTrueIfTheStringLengthIsEqualToMinLength() {
-               $stringLengthValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\StringLengthValidator', array('addError'), array(), '', FALSE);
-               $stringLengthValidator->expects($this->never())->method('addError');
-               $stringLengthValidator->setOptions(array('minimum' => 10, 'maximum' => 100));
-               $stringLengthValidator->isValid('1234567890');
-       }
-
-       /**
-        * @test
-        * @expectedException \TYPO3\CMS\Extbase\Validation\Exception\InvalidValidationOptionsException
-        */
-       public function stringLengthValidatorThrowsAnExceptionIfMinLengthIsGreaterThanMaxLength() {
-               $stringLengthValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\StringLengthValidator', array('addError'), array(), '', FALSE);
-               $stringLengthValidator->setOptions(array('minimum' => 101, 'maximum' => 100));
-               $stringLengthValidator->isValid('1234567890');
-       }
-
-       /**
-        * @test
-        */
-       public function stringLengthValidatorInsertsAnErrorObjectIfValidationFails() {
-               $stringLengthValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\StringLengthValidator', array('addError', 'translateErrorMessage'), array(), '', FALSE);
-               $stringLengthValidator->expects($this->once())->method('addError');
-               $stringLengthValidator->setOptions(array('minimum' => 50, 'maximum' => 100));
-               $stringLengthValidator->isValid('this is a very short string');
-       }
-
-       /**
-        * @test
-        */
-       public function stringLengthValidatorCanHandleAnObjectWithAToStringMethod() {
-               $stringLengthValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\StringLengthValidator', array('addError'), array(), '', FALSE);
-               $stringLengthValidator->expects($this->never())->method('addError');
-               $stringLengthValidator->setOptions(array('minimum' => 5, 'maximum' => 100));
-               $className = uniqid('TestClass');
-               eval('
-                       class ' . $className . ' {
-                               public function __toString() {
-                                       return \'some string\';
-                               }
-                       }
-               ');
-               $object = new $className();
-               $stringLengthValidator->isValid($object);
-       }
-
-       /**
-        * @test
-        */
-       public function stringLengthValidatorAddsAnErrorIfTheGivenObjectCanNotBeConvertedToAString() {
-               $stringLengthValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\StringLengthValidator', array('addError', 'translateErrorMessage'), array(), '', FALSE);
-               $stringLengthValidator->expects($this->once())->method('addError');
-               $stringLengthValidator->setOptions(array('minimum' => 5, 'maximum' => 100));
-               $className = uniqid('TestClass');
-               eval('
-                       class ' . $className . ' {
-                               protected $someProperty;
-                       }
-               ');
-               $object = new $className();
-               $stringLengthValidator->isValid($object);
-       }
-}
diff --git a/typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/TextValidatorTest.php b/typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/TextValidatorTest.php
deleted file mode 100644 (file)
index 6718ad4..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator\BeforeExtbase14;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Test case
- *
- * This testcase checks the expected behavior for Extbase < 1.4.0, to make sure
- * we do not break backwards compatibility.
- */
-class TextValidatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
-
-       /**
-        * @test
-        */
-       public function textValidatorReturnsTrueForASimpleString() {
-               $textValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\TextValidator', array('addError'), array(), '', FALSE);
-               $textValidator->expects($this->never())->method('addError');
-               $textValidator->isValid('this is a very simple string');
-       }
-
-       /**
-        * @test
-        */
-       public function textValidatorAllowsTheNewLineCharacter() {
-               $sampleText = 'Ierd Frot uechter mä get, Kirmesdag Milliounen all en, sinn main Stréi mä och.
-Vu dan durch jéngt gréng, ze rou Monn voll stolz.
-Ke kille Minutt d\'Kirmes net. Hir Wand Lann Gaas da, wär hu Heck Gart zënter, Welt Ronn grousse der ke. Wou fond eraus Wisen am. Hu dénen d\'Gaassen eng, eng am virun geplot d\'Lëtzebuerger, get botze rëscht Blieder si. Dat Dauschen schéinste Milliounen fu. Ze riede méngem Keppchen déi, si gét fergiess erwaacht, räich jéngt duerch en nun. Gëtt Gaas d\'Vullen hie hu, laacht Grénge der dé. Gemaacht gehéiert da aus, gutt gudden d\'wäiss mat wa.';
-               $textValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\TextValidator', array('addError'), array(), '', FALSE);
-               $textValidator->expects($this->never())->method('addError');
-               $textValidator->isValid($sampleText);
-       }
-
-       /**
-        * @test
-        */
-       public function textValidatorAllowsCommonSpecialCharacters() {
-               $sampleText = '3% of most people tend to use semikolae; we need to check & allow that. And hashes (#) are not evil either, nor is the sign called \'quote\'.';
-               $textValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\TextValidator', array('addError'), array(), '', FALSE);
-               $textValidator->expects($this->never())->method('addError');
-               $textValidator->isValid($sampleText);
-       }
-
-       /**
-        * @test
-        */
-       public function textValidatorReturnsFalseForAStringWithHtml() {
-               $textValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\TextValidator', array('addError', 'translateErrorMessage'), array(), '', FALSE);
-               $textValidator->expects($this->once())->method('addError');
-               $textValidator->isValid('<span style="color: #BBBBBB;">a nice text</span>');
-       }
-
-       /**
-        * @test
-        */
-       public function textValidatorCreatesTheCorrectErrorIfTheSubjectContainsHtmlEntities() {
-               $textValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\TextValidator', array('addError', 'translateErrorMessage'), array(), '', FALSE);
-               // we only test for the error key, after the translation method is mocked.
-               $textValidator->expects($this->once())->method('addError')->with(NULL, 1221565786);
-               $textValidator->isValid('<span style="color: #BBBBBB;">a nice text</span>');
-       }
-}
index 1085c40..7674cde 100644 (file)
@@ -37,11 +37,6 @@ class CollectionValidatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        protected $mockValidatorResolver;
 
        /**
-        * @var \TYPO3\CMS\Core\Configuration\ConfigurationManager
-        */
-       protected $configurationManager;
-
-       /**
         * @var \TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface
         */
        protected $validator;
@@ -64,18 +59,6 @@ class CollectionValidatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        array('createValidator', 'buildBaseValidatorConjunction', 'getBaseValidatorConjunction')
                );
                $this->validator = $this->getValidator();
-               $this->configurationManager = $this->getMock(
-                       'TYPO3\CMS\Extbase\Configuration\ConfigurationManager',
-                       array('isFeatureEnabled'),
-                       array(),
-                       '',
-                       FALSE
-               );
-               $this->configurationManager->expects($this->any())
-                       ->method('isFeatureEnabled')
-                       ->with('rewrittenPropertyMapper')
-                       ->will($this->returnValue(TRUE));
-               $this->validator->injectConfigurationManager($this->configurationManager);
                $this->validator->_set('validatorResolver', $this->mockValidatorResolver);
        }
 
@@ -133,7 +116,6 @@ class CollectionValidatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
                // Create validators
                $aValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\GenericObjectValidator', array('translateErrorMessage'), array(array()));
-               $aValidator->injectConfigurationManager($this->configurationManager);
                $this->validator->_set('options', array('elementValidator' => 'Integer'));
                $integerValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\IntegerValidator', array('translateErrorMessage'), array(array()));
 
@@ -168,7 +150,6 @@ class CollectionValidatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        // only in this test case we want to mock the isValid method
                $validator = $this->getValidator(array('elementType' => $elementType), array('isValid'));
                $validator->expects($this->never())->method('isValid');
-               $validator->injectConfigurationManager($this->configurationManager);
                $this->mockValidatorResolver->expects($this->never())->method('createValidator');
                $validator->validate($lazyObjectStorage);
        }
@@ -182,7 +163,6 @@ class CollectionValidatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $objectStorage = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
                $objectStorage->attach($entity);
                $aValidator = new \TYPO3\CMS\Extbase\Validation\Validator\GenericObjectValidator(array());
-               $aValidator->injectConfigurationManager($this->configurationManager);
 
                $this->mockValidatorResolver->expects($this->never())->method('createValidator');
                $this->mockValidatorResolver->expects($this->once())
index b07447c..b937272 100644 (file)
@@ -46,13 +46,13 @@ class ConjunctionValidatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function allValidatorsInTheConjunctionAreCalledEvenIfOneReturnsError() {
                $validatorConjunction = new \TYPO3\CMS\Extbase\Validation\Validator\ConjunctionValidator(array());
-               $validatorObject = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate'));
+               $validatorObject = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate', 'getOptions'));
                $validatorObject->expects($this->once())->method('validate')->will($this->returnValue(new \TYPO3\CMS\Extbase\Error\Result()));
                $errors = new \TYPO3\CMS\Extbase\Error\Result();
                $errors->addError(new \TYPO3\CMS\Extbase\Error\Error('Error', 123));
-               $secondValidatorObject = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate'));
+               $secondValidatorObject = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate', 'getOptions'));
                $secondValidatorObject->expects($this->once())->method('validate')->will($this->returnValue($errors));
-               $thirdValidatorObject = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate'));
+               $thirdValidatorObject = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate', 'getOptions'));
                $thirdValidatorObject->expects($this->once())->method('validate')->will($this->returnValue(new \TYPO3\CMS\Extbase\Error\Result()));
                $validatorConjunction->addValidator($validatorObject);
                $validatorConjunction->addValidator($secondValidatorObject);
@@ -66,9 +66,9 @@ class ConjunctionValidatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function validatorConjunctionReturnsNoErrorsIfAllJunctionedValidatorsReturnNoErrors() {
                $validatorConjunction = new \TYPO3\CMS\Extbase\Validation\Validator\ConjunctionValidator(array());
-               $validatorObject = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate'));
+               $validatorObject = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate', 'getOptions'));
                $validatorObject->expects($this->any())->method('validate')->will($this->returnValue(new \TYPO3\CMS\Extbase\Error\Result()));
-               $secondValidatorObject = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate'));
+               $secondValidatorObject = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate', 'getOptions'));
                $secondValidatorObject->expects($this->any())->method('validate')->will($this->returnValue(new \TYPO3\CMS\Extbase\Error\Result()));
                $validatorConjunction->addValidator($validatorObject);
                $validatorConjunction->addValidator($secondValidatorObject);
@@ -82,7 +82,7 @@ class ConjunctionValidatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function validatorConjunctionReturnsErrorsIfOneValidatorReturnsErrors() {
                $validatorConjunction = new \TYPO3\CMS\Extbase\Validation\Validator\ConjunctionValidator(array());
-               $validatorObject = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate'));
+               $validatorObject = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate', 'getOptions'));
                $errors = new \TYPO3\CMS\Extbase\Error\Result();
                $errors->addError(new \TYPO3\CMS\Extbase\Error\Error('Error', 123));
                $validatorObject->expects($this->any())->method('validate')->will($this->returnValue($errors));
@@ -97,8 +97,8 @@ class ConjunctionValidatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function removingAValidatorOfTheValidatorConjunctionWorks() {
                /** @var \TYPO3\CMS\Extbase\Validation\Validator\ConjunctionValidator|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
                $validatorConjunction = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ConjunctionValidator', array('dummy'), array(array()), '', TRUE);
-               $validator1 = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate'));
-               $validator2 = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate'));
+               $validator1 = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate', 'getOptions'));
+               $validator2 = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate', 'getOptions'));
                $validatorConjunction->addValidator($validator1);
                $validatorConjunction->addValidator($validator2);
                $validatorConjunction->removeValidator($validator1);
@@ -113,7 +113,7 @@ class ConjunctionValidatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function removingANotExistingValidatorIndexThrowsException() {
                $validatorConjunction = new \TYPO3\CMS\Extbase\Validation\Validator\ConjunctionValidator(array());
-               $validator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate'));
+               $validator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate', 'getOptions'));
                $validatorConjunction->removeValidator($validator);
        }
 
@@ -123,8 +123,8 @@ class ConjunctionValidatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function countReturnesTheNumberOfValidatorsContainedInTheConjunction() {
                $validatorConjunction = new \TYPO3\CMS\Extbase\Validation\Validator\ConjunctionValidator(array());
-               $validator1 = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate'));
-               $validator2 = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate'));
+               $validator1 = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate', 'getOptions'));
+               $validator2 = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate', 'getOptions'));
                $this->assertSame(0, count($validatorConjunction));
                $validatorConjunction->addValidator($validator1);
                $validatorConjunction->addValidator($validator2);
index c9eac20..7400c26 100644 (file)
@@ -33,11 +33,11 @@ class DisjunctionValidatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function allValidatorsInTheDisjunctionAreCalledEvenIfOneReturnsNoError() {
                $this->markTestSkipped('Needs a bugfix of Flow first.');
                $validatorDisjunction = new \TYPO3\CMS\Extbase\Validation\Validator\DisjunctionValidator(array());
-               $validatorObject = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate'));
+               $validatorObject = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate', 'getOptions'));
                $validatorObject->expects($this->once())->method('validate')->will($this->returnValue(new \TYPO3\CMS\Extbase\Error\Result()));
                $errors = new \TYPO3\CMS\Extbase\Error\Result();
                $errors->addError(new \TYPO3\CMS\Extbase\Error\Error('Error', 123));
-               $secondValidatorObject = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate'));
+               $secondValidatorObject = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate', 'getOptions'));
                $secondValidatorObject->expects($this->exactly(1))->method('validate')->will($this->returnValue($errors));
                $validatorDisjunction->addValidator($validatorObject);
                $validatorDisjunction->addValidator($secondValidatorObject);
@@ -50,11 +50,11 @@ class DisjunctionValidatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function validateReturnsNoErrorsIfOneValidatorReturnsNoError() {
                $validatorDisjunction = new \TYPO3\CMS\Extbase\Validation\Validator\DisjunctionValidator(array());
-               $validatorObject = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate'));
+               $validatorObject = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate', 'getOptions'));
                $validatorObject->expects($this->any())->method('validate')->will($this->returnValue(new \TYPO3\CMS\Extbase\Error\Result()));
                $errors = new \TYPO3\CMS\Extbase\Error\Result();
                $errors->addError(new \TYPO3\CMS\Extbase\Error\Error('Error', 123));
-               $secondValidatorObject = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate'));
+               $secondValidatorObject = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate', 'getOptions'));
                $secondValidatorObject->expects($this->any())->method('validate')->will($this->returnValue($errors));
                $validatorDisjunction->addValidator($validatorObject);
                $validatorDisjunction->addValidator($secondValidatorObject);
@@ -71,11 +71,11 @@ class DisjunctionValidatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $error2 = new \TYPO3\CMS\Extbase\Error\Error('Error2', 123);
                $errors1 = new \TYPO3\CMS\Extbase\Error\Result();
                $errors1->addError($error1);
-               $validatorObject = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate'));
+               $validatorObject = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate', 'getOptions'));
                $validatorObject->expects($this->any())->method('validate')->will($this->returnValue($errors1));
                $errors2 = new \TYPO3\CMS\Extbase\Error\Result();
                $errors2->addError($error2);
-               $secondValidatorObject = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate'));
+               $secondValidatorObject = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate', 'getOptions'));
                $secondValidatorObject->expects($this->any())->method('validate')->will($this->returnValue($errors2));
                $validatorDisjunction->addValidator($validatorObject);
                $validatorDisjunction->addValidator($secondValidatorObject);
index 0c19c92..6e69a36 100644 (file)
@@ -48,4 +48,15 @@ class AbstractCompositeValidatorClass extends \TYPO3\CMS\Extbase\Validation\Vali
        }
 
 
+       /**
+        * Checks if the given value is valid according to the validator, and returns
+        * the Error Messages object which occurred.
+        *
+        * @param mixed $value The value that should be validated
+        * @return \TYPO3\CMS\Extbase\Error\Result
+        * @api
+        */
+       public function validate($value) {
+               return new \TYPO3\CMS\Extbase\Error\Result();
+       }
 }
index fcbe0ac..00c0264 100644 (file)
@@ -30,17 +30,8 @@ class GenericObjectValidatorTest extends \TYPO3\CMS\Extbase\Tests\Unit\Validatio
 
        protected $validatorClassName = 'TYPO3\\CMS\\Extbase\\Validation\\Validator\\GenericObjectValidator';
 
-       /**
-        * @var \TYPO3\CMS\Core\Configuration\ConfigurationManager
-        */
-       protected $configurationManager;
-
        public function setUp() {
                parent::setUp();
-
-               $this->configurationManager = $this->getMock('TYPO3\CMS\Extbase\Configuration\ConfigurationManager', array('isFeatureEnabled'), array(), '', FALSE);
-               $this->configurationManager->expects($this->any())->method('isFeatureEnabled')->with('rewrittenPropertyMapper')->will($this->returnValue(TRUE));
-               $this->validator->injectConfigurationManager($this->configurationManager);
        }
 
        /**
@@ -92,9 +83,9 @@ class GenericObjectValidatorTest extends \TYPO3\CMS\Extbase\Tests\Unit\Validatio
         * @param mixed $errors
         */
        public function validateChecksAllPropertiesForWhichAPropertyValidatorExists($mockObject, $validationResultForFoo, $validationResultForBar, $errors) {
-               $validatorForFoo = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate'));
+               $validatorForFoo = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate', 'getOptions'));
                $validatorForFoo->expects($this->once())->method('validate')->with('foovalue')->will($this->returnValue($validationResultForFoo));
-               $validatorForBar = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate'));
+               $validatorForBar = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate', 'getOptions'));
                $validatorForBar->expects($this->once())->method('validate')->with('barvalue')->will($this->returnValue($validationResultForBar));
                $this->validator->addPropertyValidator('foo', $validatorForFoo);
                $this->validator->addPropertyValidator('bar', $validatorForBar);
@@ -118,9 +109,6 @@ class GenericObjectValidatorTest extends \TYPO3\CMS\Extbase\Tests\Unit\Validatio
                $aValidator = new \TYPO3\CMS\Extbase\Validation\Validator\GenericObjectValidator(array());
                $bValidator = new \TYPO3\CMS\Extbase\Validation\Validator\GenericObjectValidator(array());
 
-               $aValidator->injectConfigurationManager($this->configurationManager);
-               $bValidator->injectConfigurationManager($this->configurationManager);
-
                $aValidator->addPropertyValidator('b', $bValidator);
                $bValidator->addPropertyValidator('a', $aValidator);
                $this->assertFalse($aValidator->validate($A)->hasErrors());
@@ -142,15 +130,12 @@ class GenericObjectValidatorTest extends \TYPO3\CMS\Extbase\Tests\Unit\Validatio
                $aValidator = $this->getValidator();
                $bValidator = $this->getValidator();
 
-               $aValidator->injectConfigurationManager($this->configurationManager);
-               $bValidator->injectConfigurationManager($this->configurationManager);
-
                $aValidator->addPropertyValidator('b', $bValidator);
                $bValidator->addPropertyValidator('a', $aValidator);
                $error = new \TYPO3\CMS\Extbase\Error\Error('error1', 123);
                $result = new \TYPO3\CMS\Extbase\Error\Result();
                $result->addError($error);
-               $mockUuidValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate'));
+               $mockUuidValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate', 'getOptions'));
                $mockUuidValidator->expects($this->any())->method('validate')->with(15)->will($this->returnValue($result));
                $bValidator->addPropertyValidator('uuid', $mockUuidValidator);
                $this->assertSame(array('b.uuid' => array($error)), $aValidator->validate($A)->getFlattenedErrors());
@@ -172,15 +157,12 @@ class GenericObjectValidatorTest extends \TYPO3\CMS\Extbase\Tests\Unit\Validatio
                $aValidator = $this->getValidator();
                $bValidator = $this->getValidator();
 
-               $aValidator->injectConfigurationManager($this->configurationManager);
-               $bValidator->injectConfigurationManager($this->configurationManager);
-
                $aValidator->addPropertyValidator('b', $bValidator);
                $bValidator->addPropertyValidator('a', $aValidator);
                $error1 = new \TYPO3\CMS\Extbase\Error\Error('error1', 123);
                $result1 = new \TYPO3\CMS\Extbase\Error\Result();
                $result1->addError($error1);
-               $mockUuidValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate'));
+               $mockUuidValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array('validate', 'getOptions'));
                $mockUuidValidator->expects($this->any())->method('validate')->with(15)->will($this->returnValue($result1));
                $aValidator->addPropertyValidator('uuid', $mockUuidValidator);
                $bValidator->addPropertyValidator('uuid', $mockUuidValidator);
index 1fa30c5..c0a58cc 100644 (file)
@@ -45,7 +45,9 @@ class ValidatorResolverTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $className = uniqid('Foo');
                $realClassName = 'Tx_' . $extensionName . '_Validation_Validator_' . $className . 'Validator';
                $validatorName = $extensionName . ':' . $className;
-               eval('class ' . $realClassName . ' implements TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface {}');
+               eval('class ' . $realClassName . ' implements TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface {
+               public function validate($value){} public function getOptions(){}
+               }');
                $this->assertEquals($realClassName, $this->validatorResolver->_call('resolveValidatorObjectName', $validatorName));
        }
 
@@ -80,7 +82,9 @@ class ValidatorResolverTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function resolveValidatorObjectNameReturnsValidatorNameIfClassExists() {
                $className = uniqid('Foo_');
                $expectedValidatorName = $className . 'Validator';
-               eval('class ' . $expectedValidatorName . ' implements TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface {}');
+               eval('class ' . $expectedValidatorName . ' implements TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface {
+               public function validate($value){} public function getOptions(){}
+               }');
                $this->assertEquals(
                        $expectedValidatorName,
                        $this->validatorResolver->_call('resolveValidatorObjectName', $className)
@@ -128,7 +132,9 @@ class ValidatorResolverTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @dataProvider namespacedShorthandValidatornames
         */
        public function resolveValidatorObjectNameCanResolveNamespacedShorthandValidatornames($namespace, $className, $shorthandValidatorname) {
-               eval('namespace ' . $namespace . '; class ' . $className . ' implements \TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface {}');
+               eval('namespace ' . $namespace . '; class ' . $className . ' implements \TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface {
+               public function validate($value){} public function getOptions(){}
+               }');
                $this->assertSame($namespace . '\\' . $className, $this->validatorResolver->_call('resolveValidatorObjectName', $shorthandValidatorname));
        }
 
@@ -136,7 +142,9 @@ class ValidatorResolverTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function resolveValidatorObjectNameCanResolveShortNamesOfBuiltInValidators() {
-               eval('namespace TYPO3\\CMS\\Extbase\\Validation\\Validator;' . LF . 'class FooValidator implements \TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface {}');
+               eval('namespace TYPO3\\CMS\\Extbase\\Validation\\Validator;' . LF . 'class FooValidator implements \TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface {
+               public function validate($value){} public function getOptions(){}
+               }');
                $this->assertSame('TYPO3\\CMS\\Extbase\\Validation\\Validator\\FooValidator', $this->validatorResolver->_call('resolveValidatorObjectName', 'Foo'));
        }
 
@@ -145,14 +153,13 @@ class ValidatorResolverTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function createValidatorResolvesAndReturnsAValidatorAndPassesTheGivenOptions() {
                $className = uniqid('Test');
-               $validatorOptions = array('requiredOption' => 'foo', 'demoOption' => 'bar');
-               $mockValidator = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Tests\\Unit\\Validation\\Validator\\Fixture\\AbstractValidatorClass', array('dummy'), array($validatorOptions), $className);
-               $this->mockObjectManager->expects($this->any())->method('get')->with($className, $validatorOptions)->will($this->returnValue($mockValidator));
+               $mockValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ObjectValidatorInterface', array('validate', 'getOptions', 'setValidatedInstancesContainer'), array(), $className);
+               $this->mockObjectManager->expects($this->any())->method('get')->with($className)->will($this->returnValue($mockValidator));
+               /** @var \TYPO3\CMS\Extbase\Validation\ValidatorResolver $validatorResolver */
                $validatorResolver = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array('resolveValidatorObjectName'));
                $validatorResolver->_set('objectManager', $this->mockObjectManager);
                $validatorResolver->expects($this->once())->method('resolveValidatorObjectName')->with($className)->will($this->returnValue($className));
-               $validator = $validatorResolver->createValidator($className, $validatorOptions);
-               $this->assertEquals($validatorOptions, $validator->_get('options'));
+               $validator = $validatorResolver->createValidator($className);
                $this->assertSame($mockValidator, $validator);
        }
 
@@ -361,7 +368,9 @@ class ValidatorResolverTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function resolveValidatorObjectNameCallsGetValidatorType() {
                $validatorName = uniqid('FooValidator');
-               eval('namespace TYPO3\CMS\Extbase\Validation\Validator;' . LF . 'class ' . $validatorName . 'Validator implements \TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface {}');
+               eval('namespace TYPO3\CMS\Extbase\Validation\Validator;' . LF . 'class ' . $validatorName . 'Validator implements \TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface {
+               public function validate($value){} public function getOptions(){}
+               }');
                $mockValidatorResolver = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array('getValidatorType'));
                $mockValidatorResolver->expects($this->once())->method('getValidatorType')->with($validatorName)->will($this->returnValue($validatorName));
 
index 63b741c..5fed874 100644 (file)
@@ -92,8 +92,6 @@ config.tx_extbase {
                }
        }
        features {
-                # this enables/disables the reworked property mapper (see http://forge.typo3.org/projects/typo3v4-mvc/wiki/PropertyMapper_rework)
-               rewrittenPropertyMapper = 1
                 # if enabled, default controller and/or action is skipped when creating URIs through the URI Builder (see http://forge.typo3.org/projects/typo3v4-mvc/wiki/Skip_default_arguments_in_URIs)
                skipDefaultArguments = 0
                # if set to 1, the enable fields are ignored in BE context
index 1c5e7a5..b7303d1 100644 (file)
@@ -20,6 +20,8 @@ namespace TYPO3\CMS\Fluid\ViewHelpers\Form;
  *                                                                        *
  * The TYPO3 project - inspiring people to share!                         *
  *                                                                        */
+use TYPO3\CMS\Extbase\Reflection\ObjectAccess;
+
 /**
  * Abstract Form View Helper. Bundles functionality related to direct property access of objects in other Form ViewHelpers.
  *
@@ -28,7 +30,7 @@ namespace TYPO3\CMS\Fluid\ViewHelpers\Form;
  *
  * @api
  */
-abstract class AbstractFormFieldViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormViewHelper {
+abstract class AbstractFormFieldViewHelper extends AbstractFormViewHelper {
 
        /**
         * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
@@ -101,16 +103,19 @@ abstract class AbstractFormFieldViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\
         */
        protected function getValue($convertObjects = TRUE) {
                $value = NULL;
+
                if ($this->hasArgument('value')) {
                        $value = $this->arguments['value'];
-               } elseif ($this->configurationManager->isFeatureEnabled('rewrittenPropertyMapper') && $this->hasMappingErrorOccurred()) {
-                       $this->addAdditionalIdentityPropertiesIfNeeded();
-                       $value = $this->getLastSubmittedFormData();
-               } elseif ($this->isObjectAccessorMode() && $this->viewHelperVariableContainer->exists('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObject')) {
+               } elseif ($this->isObjectAccessorMode()) {
+                       if ($this->hasMappingErrorOccurred()) {
+                               $value = $this->getLastSubmittedFormData();
+                       } else {
+                               $value = $this->getPropertyValue();
+                       }
                        $this->addAdditionalIdentityPropertiesIfNeeded();
-                       $value = $this->getPropertyValue();
                }
-               if ($convertObjects === TRUE && is_object($value)) {
+
+               if ($convertObjects && is_object($value)) {
                        $identifier = $this->persistenceManager->getIdentifierByObject($value);
                        if ($identifier !== NULL) {
                                $value = $identifier;
@@ -136,7 +141,7 @@ abstract class AbstractFormFieldViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\
         */
        protected function getLastSubmittedFormData() {
                $propertyPath = rtrim(preg_replace('/(\\]\\[|\\[|\\])/', '.', $this->getNameWithoutPrefix()), '.');
-               $value = \TYPO3\CMS\Extbase\Reflection\ObjectAccess::getPropertyPath($this->controllerContext->getRequest()->getOriginalRequest()->getArguments(), $propertyPath);
+               $value = ObjectAccess::getPropertyPath($this->controllerContext->getRequest()->getOriginalRequest()->getArguments(), $propertyPath);
                return $value;
        }
 
@@ -154,7 +159,7 @@ abstract class AbstractFormFieldViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\
                        $objectName = $this->viewHelperVariableContainer->get('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObjectName');
                        // If Count == 2 -> we need to go through the for-loop exactly once
                        for ($i = 1; $i < count($propertySegments); $i++) {
-                               $object = \TYPO3\CMS\Extbase\Reflection\ObjectAccess::getPropertyPath($formObject, implode('.', array_slice($propertySegments, 0, $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
@@ -179,7 +184,7 @@ abstract class AbstractFormFieldViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\
                if (is_array($formObject)) {
                        return isset($formObject[$propertyName]) ? $formObject[$propertyName] : NULL;
                }
-               return \TYPO3\CMS\Extbase\Reflection\ObjectAccess::getPropertyPath($formObject, $propertyName);
+               return ObjectAccess::getPropertyPath($formObject, $propertyName);
        }
 
        /**
@@ -202,34 +207,22 @@ abstract class AbstractFormFieldViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\
                } else {
                        $cssClass = '';
                }
-               if ($this->configurationManager->isFeatureEnabled('rewrittenPropertyMapper')) {
-                       $mappingResultsForProperty = $this->getMappingResultsForProperty();
-                       if ($mappingResultsForProperty->hasErrors()) {
-                               if ($this->hasArgument('errorClass')) {
-                                       $cssClass .= $this->arguments['errorClass'];
-                               } else {
-                                       $cssClass .= 'error';
-                               }
-                               $this->tag->addAttribute('class', $cssClass);
-                       }
-               } else {
-                       // @deprecated since Fluid 1.4.0, will will be removed two versions after Fluid 6.1.
-                       $errors = $this->getErrorsForProperty();
-                       if (count($errors) > 0) {
-                               if ($this->hasArgument('errorClass')) {
-                                       $cssClass .= $this->arguments['errorClass'];
-                               } else {
-                                       $cssClass .= 'error';
-                               }
-                               $this->tag->addAttribute('class', $cssClass);
+
+               $mappingResultsForProperty = $this->getMappingResultsForProperty();
+               if ($mappingResultsForProperty->hasErrors()) {
+                       if ($this->hasArgument('errorClass')) {
+                               $cssClass .= $this->arguments['errorClass'];
+                       } else {
+                               $cssClass .= 'error';
                        }
+                       $this->tag->addAttribute('class', $cssClass);
                }
        }
 
        /**
         * Get errors for the property and form name of this view helper
         *
-        * @return array<Tx_Extbase_Error_Result> Array of errors
+        * @return \TYPO3\CMS\Extbase\Error\Result Array of errors
         */
        protected function getMappingResultsForProperty() {
                if (!$this->isObjectAccessorMode()) {
@@ -241,32 +234,6 @@ abstract class AbstractFormFieldViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\
        }
 
        /**
-        * Get errors for the property and form name of this view helper
-        *
-        * @return array An array of Tx_Fluid_Error_Error objects
-        * @deprecated since Fluid 1.4.0, will will be removed two versions after Fluid 6.1.
-        */
-       protected function getErrorsForProperty() {
-               if (!$this->isObjectAccessorMode()) {
-                       return array();
-               }
-               $errors = $this->controllerContext->getRequest()->getErrors();
-               $formObjectName = $this->viewHelperVariableContainer->get('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObjectName');
-               $propertyName = $this->arguments['property'];
-               foreach ($errors as $error) {
-                       if ($error instanceof \TYPO3\CMS\Extbase\Validation\PropertyError && $error->getPropertyName() === $formObjectName) {
-                               $formErrors = $error->getErrors();
-                               foreach ($formErrors as $formError) {
-                                       if ($formError instanceof \TYPO3\CMS\Extbase\Validation\PropertyError && $formError->getPropertyName() === $propertyName) {
-                                               return $formError->getErrors();
-                                       }
-                               }
-                       }
-               }
-               return array();
-       }
-
-       /**
         * Renders a hidden field with the same name as the element, to make sure the empty value is submitted
         * in case nothing is selected. This is needed for checkbox and multiple select fields
         *
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Form/ErrorsViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Form/ErrorsViewHelper.php
deleted file mode 100644 (file)
index 9f5d728..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-<?php
-namespace TYPO3\CMS\Fluid\ViewHelpers\Form;
-
-/*                                                                        *
- * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License, either version 3   *
- *  of the License, or (at your option) any later version.                *
- *                                                                        *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-/**
- * Error messages view helper, which is deprecated in Extbase 1.4.0, with the old property mapper.
- *
- * = Examples =
- *
- * <code title="Output error messages as a list">
- * <ul class="errors">
- * <f:form.errors>
- * <li>{error.code}: {error.message}</li>
- * </f:form.errors>
- * </ul>
- * </code>
- * <output>
- * <ul>
- * <li>1234567890: Validation errors for argument "newBlog"</li>
- * </ul>
- * </output>
- *
- * <code title="Output error messages for a single property">
- * <f:form.errors for="someProperty">
- * <div class="error">
- * <strong>{error.propertyName}</strong>: <f:for each="{error.errors}" as="errorDetail">{errorDetail.message}</f:for>
- * </div>
- * </f:form.errors>
- * </code>
- * <output>
- * <div class="error>
- * <strong>someProperty:</strong> errorMessage1 errorMessage2
- * </div>
- * </output>
- *
- * @api
- * @deprecated since Fluid 1.4.0, will be removed two versions after Fluid 6.1.
- */
-class ErrorsViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper {
-
-       /**
-        * Iterates through selected errors of the request.
-        *
-        * @param string $for The name of the error name (e.g. argument name or property name). This can also be a property path (like blog.title), and will then only display the validation errors of that property.
-        * @param string $as The name of the variable to store the current error
-        * @return string Rendered string
-        * @api
-        */
-       public function render($for = '', $as = 'error') {
-               $errors = $this->controllerContext->getRequest()->getErrors();
-               if ($for !== '' && $for !== NULL) {
-                       $propertyPath = explode('.', $for);
-                       foreach ($propertyPath as $currentPropertyName) {
-                               $errors = $this->getErrorsForProperty($currentPropertyName, $errors);
-                       }
-               }
-               $output = '';
-               foreach ($errors as $errorKey => $error) {
-                       $this->templateVariableContainer->add($as, $error);
-                       $output .= $this->renderChildren();
-                       $this->templateVariableContainer->remove($as);
-               }
-               return $output;
-       }
-
-       /**
-        * Find errors for a specific property in the given errors array
-        *
-        * @param string $propertyName The property name to look up
-        * @param array $errors An array of Tx_Fluid_Error_Error objects
-        * @return array An array of errors for $propertyName
-        */
-       protected function getErrorsForProperty($propertyName, $errors) {
-               foreach ($errors as $error) {
-                       if ($error instanceof \TYPO3\CMS\Extbase\Validation\PropertyError) {
-                               if ($error->getPropertyName() === $propertyName) {
-                                       return $error->getErrors();
-                               }
-                       }
-               }
-               return array();
-       }
-}
index 4a45dd7..5e1b13e 100644 (file)
@@ -55,12 +55,6 @@ class FormViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormViewH
        protected $tagName = 'form';
 
        /**
-        * @var \TYPO3\CMS\Extbase\Security\Channel\RequestHashService
-        * @inject
-        */
-       protected $requestHashService;
-
-       /**
         * @var \TYPO3\CMS\Extbase\Security\Cryptography\HashService
         * @inject
         */
@@ -87,12 +81,6 @@ class FormViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormViewH
        protected $formActionUriArguments;
 
        /**
-        * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
-        * @inject
-        */
-       protected $configurationManager;
-
-       /**
         * Initialize arguments.
         *
         * @return void
@@ -153,13 +141,10 @@ class FormViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormViewH
                $content .= $this->renderHiddenIdentityField($this->arguments['object'], $this->getFormObjectName());
                $content .= $this->renderAdditionalIdentityFields();
                $content .= $this->renderHiddenReferrerFields();
-               if ($this->configurationManager->isFeatureEnabled('rewrittenPropertyMapper') === FALSE) {
-                       // Render hmac after everything else has been rendered
-                       $content .= $this->renderRequestHashField();
-               } else {
-                       // Render the trusted list of all properties after everything else has been rendered
-                       $content .= $this->renderTrustedPropertiesField();
-               }
+
+               // Render the trusted list of all properties after everything else has been rendered
+               $content .= $this->renderTrustedPropertiesField();
+
                $content .= chr(10) . '</div>' . chr(10);
                $content .= $formContent;
                $this->tag->setContent($content);
@@ -219,20 +204,14 @@ class FormViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormViewH
                $controllerName = $request->getControllerName();
                $actionName = $request->getControllerActionName();
                $result = chr(10);
-               if ($this->configurationManager->isFeatureEnabled('rewrittenPropertyMapper')) {
-                       $result .= '<input type="hidden" name="' . $this->prefixFieldName('__referrer[@extension]') . '" value="' . $extensionName . '" />' . chr(10);
-                       if ($vendorName !== NULL) {
-                               $result .= '<input type="hidden" name="' . $this->prefixFieldName('__referrer[@vendor]') . '" value="' . $vendorName . '" />' . chr(10);
-                       }
-                       $result .= '<input type="hidden" name="' . $this->prefixFieldName('__referrer[@controller]') . '" value="' . $controllerName . '" />' . chr(10);
-                       $result .= '<input type="hidden" name="'&nb