[TASK] Change injectMethods to annotations 65/23865/4
authorStefan Froemken <froemken@gmail.com>
Tue, 17 Sep 2013 08:59:14 +0000 (10:59 +0200)
committerMarkus Klein <klein.t3@mfc-linz.at>
Tue, 19 Nov 2013 09:48:04 +0000 (10:48 +0100)
Change injectMethods as already done in extbase
to inject annotations

Resolves: #52040
Releases: 6.2
Change-Id: I1e4ba873981c4692cc0b3d867bd3756934661a90
Reviewed-on: https://review.typo3.org/23865
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
Reviewed-by: Markus Klein
Tested-by: Markus Klein
40 files changed:
typo3/sysext/fluid/Classes/Compatibility/TemplateParserBuilder.php
typo3/sysext/fluid/Classes/Core/Parser/Interceptor/Escape.php
typo3/sysext/fluid/Classes/Core/Parser/ParsingState.php
typo3/sysext/fluid/Classes/Core/Parser/TemplateParser.php
typo3/sysext/fluid/Classes/Core/Rendering/RenderingContext.php
typo3/sysext/fluid/Classes/Core/ViewHelper/AbstractTagBasedViewHelper.php
typo3/sysext/fluid/Classes/Core/ViewHelper/AbstractViewHelper.php
typo3/sysext/fluid/Classes/Core/Widget/AbstractWidgetViewHelper.php
typo3/sysext/fluid/Classes/Core/Widget/WidgetRequestHandler.php
typo3/sysext/fluid/Classes/Service/AbstractGenerator.php
typo3/sysext/fluid/Classes/View/AbstractTemplateView.php
typo3/sysext/fluid/Classes/View/TemplateView.php
typo3/sysext/fluid/Classes/ViewHelpers/Be/TableListViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Be/Widget/PaginateViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Form/AbstractFormFieldViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Form/AbstractFormViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/FormViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Widget/AutocompleteViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Widget/PaginateViewHelper.php
typo3/sysext/fluid/Tests/Unit/Core/Parser/Interceptor/EscapeTest.php
typo3/sysext/fluid/Tests/Unit/Core/Parser/SyntaxTree/ViewHelperNodeTest.php
typo3/sysext/fluid/Tests/Unit/Core/Parser/TemplateParserTest.php
typo3/sysext/fluid/Tests/Unit/Core/Rendering/RenderingContextTest.php
typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/AbstractTagBasedViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/AbstractViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/Core/Widget/AbstractWidgetViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/View/StandaloneViewTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/AbstractFormFieldViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/ButtonViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/CheckboxViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/FormFieldViewHelperBaseTestcase.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/HiddenViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/PasswordViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/RadioViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/SelectViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/SubmitViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/TextareaViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/TextfieldViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/UploadViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/ViewHelperBaseTestcase.php

index a57f281..922c74f 100644 (file)
@@ -26,8 +26,9 @@ class TemplateParserBuilder {
         * @return \TYPO3\CMS\Fluid\Core\Parser\TemplateParser A correctly initialized Template Parser
         */
        static public function build() {
-               $templateParser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser');
-               $templateParser->injectObjectManager(\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager'));
+               /** @var \TYPO3\CMS\Extbase\Object\ObjectManager $objectManager */
+               $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
+               $templateParser = $objectManager->get('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser');
                return $templateParser;
        }
 }
index b12fe1f..38771f9 100644 (file)
@@ -33,20 +33,11 @@ class Escape implements \TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
+        * @inject
         */
        protected $objectManager;
 
        /**
-        * Inject object manager
-        *
-        * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
-        * @return void
-        */
-       public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
-               $this->objectManager = $objectManager;
-       }
-
-       /**
         * Adds a ViewHelper node using the Format\HtmlspecialcharsViewHelper to the given node.
         * If "escapingInterceptorEnabled" in the ViewHelper is FALSE, will disable itself inside the ViewHelpers body.
         *
index 054a2f1..d74248b 100644 (file)
@@ -37,6 +37,7 @@ class ParsingState implements \TYPO3\CMS\Fluid\Core\Parser\ParsedTemplateInterfa
         * store things in.
         *
         * @var \TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer
+        * @inject
         */
        protected $variableContainer;
 
@@ -53,17 +54,6 @@ class ParsingState implements \TYPO3\CMS\Fluid\Core\Parser\ParsedTemplateInterfa
        protected $compilable = TRUE;
 
        /**
-        * Injects a variable container. ViewHelpers implementing the PostParse
-        * Facet can store information inside this variableContainer.
-        *
-        * @param \TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer $variableContainer
-        * @return void
-        */
-       public function injectVariableContainer(\TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer $variableContainer) {
-               $this->variableContainer = $variableContainer;
-       }
-
-       /**
         * Set root node of this parsing state
         *
         * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $rootNode
index 149a1f4..25acbfb 100644 (file)
@@ -253,6 +253,7 @@ class TemplateParser {
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
+        * @inject
         */
        protected $objectManager;
 
@@ -285,16 +286,6 @@ class TemplateParser {
        }
 
        /**
-        * Inject object factory
-        *
-        * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
-        * @return void
-        */
-       public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
-               $this->objectManager = $objectManager;
-       }
-
-       /**
         * Set the configuration for the parser.
         *
         * @param \TYPO3\CMS\Fluid\Core\Parser\Configuration $configuration
index 6912e86..4b36427 100644 (file)
@@ -25,6 +25,7 @@ class RenderingContext implements \TYPO3\CMS\Fluid\Core\Rendering\RenderingConte
         * the whole syntax tree should be cacheable
         *
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
+        * @inject
         */
        protected $objectManager;
 
@@ -39,19 +40,11 @@ class RenderingContext implements \TYPO3\CMS\Fluid\Core\Rendering\RenderingConte
         * ViewHelper Variable Container
         *
         * @var \TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer
+        * @inject
         */
        protected $viewHelperVariableContainer;
 
        /**
-        * Inject the object manager
-        *
-        * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
-        */
-       public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
-               $this->objectManager = $objectManager;
-       }
-
-       /**
         * Returns the object manager. Only the ViewHelperNode should do this.
         *
         * @return \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
@@ -61,7 +54,7 @@ class RenderingContext implements \TYPO3\CMS\Fluid\Core\Rendering\RenderingConte
        }
 
        /**
-        * Injects the template variable container containing all variables available through ObjectAccessors
+        * Injects the template variable container containing all variables available through Object Accessors
         * in the template
         *
         * @param \TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer $templateVariableContainer The template variable container to set
@@ -98,16 +91,6 @@ class RenderingContext implements \TYPO3\CMS\Fluid\Core\Rendering\RenderingConte
        }
 
        /**
-        * Set the ViewHelperVariableContainer
-        *
-        * @param \TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer $viewHelperVariableContainer
-        * @return void
-        */
-       public function injectViewHelperVariableContainer(\TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer $viewHelperVariableContainer) {
-               $this->viewHelperVariableContainer = $viewHelperVariableContainer;
-       }
-
-       /**
         * Get the ViewHelperVariableContainer
         *
         * @return \TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer
index 0794fce..af31364 100644 (file)
@@ -31,6 +31,7 @@ abstract class AbstractTagBasedViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelp
         * Tag builder instance
         *
         * @var \TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder
+        * @inject
         * @api
         */
        protected $tag = NULL;
@@ -44,16 +45,6 @@ abstract class AbstractTagBasedViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelp
        protected $tagName = 'div';
 
        /**
-        * Inject a TagBuilder
-        *
-        * @param \TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder $tagBuilder Tag builder
-        * @return void
-        */
-       public function injectTagBuilder(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder $tagBuilder) {
-               $this->tag = $tagBuilder;
-       }
-
-       /**
         * Constructor
         *
         * @api
index 0da2c38..6f06ffc 100644 (file)
@@ -101,6 +101,7 @@ abstract class AbstractViewHelper {
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
+        * @inject
         */
        protected $objectManager;
 
@@ -112,14 +113,6 @@ abstract class AbstractViewHelper {
        protected $escapingInterceptorEnabled = TRUE;
 
        /**
-        * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
-        * @return void
-        */
-       public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
-               $this->objectManager = $objectManager;
-       }
-
-       /**
         * @param array $arguments
         * @return void
         */
index 13425ab..4d072f8 100644 (file)
@@ -55,6 +55,7 @@ abstract class AbstractWidgetViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper
 
        /**
         * @var \TYPO3\CMS\Extbase\Service\ExtensionService
+        * @inject
         */
        protected $extensionService;
 
@@ -81,14 +82,6 @@ abstract class AbstractWidgetViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper
        }
 
        /**
-        * @param \TYPO3\CMS\Extbase\Service\ExtensionService $extensionService
-        * @return void
-        */
-       public function injectExtensionService(\TYPO3\CMS\Extbase\Service\ExtensionService $extensionService) {
-               $this->extensionService = $extensionService;
-       }
-
-       /**
         * Initialize the arguments of the ViewHelper, and call the render() method of the ViewHelper.
         *
         * @return string the rendered ViewHelper.
index c099c6e..98946f7 100644 (file)
@@ -30,39 +30,21 @@ class WidgetRequestHandler extends \TYPO3\CMS\Extbase\Mvc\Web\AbstractRequestHan
 
        /**
         * @var \TYPO3\CMS\Fluid\Core\Widget\AjaxWidgetContextHolder
+        * @inject
         */
        protected $ajaxWidgetContextHolder;
 
        /**
         * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
+        * @inject
         */
        protected $configurationManager;
 
        /**
-        * @param \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager
-        * @return void
+        * @var \TYPO3\CMS\Fluid\Core\Widget\WidgetRequestBuilder
+        * @inject
         */
-       public function injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager) {
-               $this->configurationManager = $configurationManager;
-       }
-
-       /**
-        * @param \TYPO3\CMS\Fluid\Core\Widget\AjaxWidgetContextHolder $ajaxWidgetContextHolder
-        * @return void
-        */
-       public function injectAjaxWidgetContextHolder(\TYPO3\CMS\Fluid\Core\Widget\AjaxWidgetContextHolder $ajaxWidgetContextHolder) {
-               $this->ajaxWidgetContextHolder = $ajaxWidgetContextHolder;
-       }
-
-       /**
-        * Injects the request handler
-        *
-        * @param \TYPO3\CMS\Fluid\Core\Widget\WidgetRequestBuilder $requestBuilder
-        * @return void
-        */
-       public function injectRequestBuilder(\TYPO3\CMS\Fluid\Core\Widget\WidgetRequestBuilder $requestBuilder) {
-               $this->requestBuilder = $requestBuilder;
-       }
+       protected $requestBuilder;
 
        /**
         * Handles the web request. The response will automatically be sent to the client.
index c3f9b21..df5b982 100644 (file)
@@ -27,11 +27,13 @@ abstract class AbstractGenerator {
         * The doc comment parser.
         *
         * @var \TYPO3\CMS\Extbase\Reflection\DocCommentParser
+        * @inject
         */
        protected $docCommentParser;
 
        /**
         * @var \TYPO3\CMS\Extbase\Reflection\ReflectionService
+        * @inject
         */
        protected $reflectionService;
 
@@ -45,23 +47,6 @@ abstract class AbstractGenerator {
        }
 
        /**
-        *
-        * @param \TYPO3\CMS\Extbase\Reflection\DocCommentParser $docCommentParser
-        */
-       public function injectDocCommentParser(\TYPO3\CMS\Extbase\Reflection\DocCommentParser $docCommentParser) {
-               $this->docCommentParser = $docCommentParser;
-       }
-
-       /**
-        *
-        * @param \TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService
-        */
-       public function injectReflectionService(\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService) {
-               $this->reflectionService = $reflectionService;
-       }
-
-
-       /**
         * Get all class names inside this namespace and return them as array.
         *
         * @param string $namespace
index 157b232..ae241c7 100644 (file)
@@ -32,11 +32,13 @@ abstract class AbstractTemplateView implements \TYPO3\CMS\Extbase\Mvc\View\ViewI
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
+        * @inject
         */
        protected $objectManager;
 
        /**
         * @var \TYPO3\CMS\Fluid\Core\Parser\TemplateParser
+        * @inject
         */
        protected $templateParser;
 
@@ -72,26 +74,6 @@ abstract class AbstractTemplateView implements \TYPO3\CMS\Extbase\Mvc\View\ViewI
        protected $partialIdentifierCache = array();
 
        /**
-        * Injects the Object Manager
-        *
-        * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
-        * @return void
-        */
-       public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
-               $this->objectManager = $objectManager;
-       }
-
-       /**
-        * Inject the Template Parser
-        *
-        * @param \TYPO3\CMS\Fluid\Core\Parser\TemplateParser $templateParser The template parser
-        * @return void
-        */
-       public function injectTemplateParser(\TYPO3\CMS\Fluid\Core\Parser\TemplateParser $templateParser) {
-               $this->templateParser = $templateParser;
-       }
-
-       /**
         * @param \TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler
         * @return void
         */
index 4e1aaa4..1ef8e8b 100644 (file)
@@ -126,8 +126,8 @@ class TemplateView extends AbstractTemplateView {
        protected $layoutPathAndFilename = NULL;
 
        public function __construct() {
-               $this->injectTemplateParser(\TYPO3\CMS\Fluid\Compatibility\TemplateParserBuilder::build());
-               $this->injectObjectManager(GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager'));
+               $this->templateParser = \TYPO3\CMS\Fluid\Compatibility\TemplateParserBuilder::build();
+               $this->objectManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
                $this->setRenderingContext($this->objectManager->get('TYPO3\\CMS\\Fluid\\Core\\Rendering\\RenderingContextInterface'));
        }
 
@@ -631,4 +631,4 @@ class TemplateView extends AbstractTemplateView {
        protected function resolveFileNamePath($pathAndFilename) {
                return GeneralUtility::getFileAbsFileName($pathAndFilename);
        }
-}
\ No newline at end of file
+}
index d681446..82ae773 100644 (file)
@@ -48,18 +48,11 @@ class TableListViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBacken
 
        /**
         * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
+        * @inject
         */
        protected $configurationManager;
 
        /**
-        * @param \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager
-        * @return void
-        */
-       public function injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager) {
-               $this->configurationManager = $configurationManager;
-       }
-
-       /**
         * Renders a record list as known from the TYPO3 list module
         * Note: This feature is experimental!
         *
index 4ee4cb2..6682e15 100644 (file)
@@ -53,18 +53,11 @@ class PaginateViewHelper extends \TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetView
 
        /**
         * @var \TYPO3\CMS\Fluid\ViewHelpers\Be\Widget\Controller\PaginateController
+        * @inject
         */
        protected $controller;
 
        /**
-        * @param \TYPO3\CMS\Fluid\ViewHelpers\Be\Widget\Controller\PaginateController $controller
-        * @return void
-        */
-       public function injectController(\TYPO3\CMS\Fluid\ViewHelpers\Be\Widget\Controller\PaginateController $controller) {
-               $this->controller = $controller;
-       }
-
-       /**
         * @param \TYPO3\CMS\Extbase\Persistence\QueryResultInterface $objects
         * @param string $as
         * @param array $configuration
index 8492f82..b1bd57a 100644 (file)
@@ -32,18 +32,11 @@ abstract class AbstractFormFieldViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\
 
        /**
         * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
+        * @inject
         */
        protected $configurationManager;
 
        /**
-        * @param \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager
-        * @return void
-        */
-       public function injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager) {
-               $this->configurationManager = $configurationManager;
-       }
-
-       /**
         * Initialize arguments.
         *
         * @return void
index 422fe63..042d67d 100644 (file)
@@ -21,20 +21,11 @@ abstract class AbstractFormViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\A
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface
+        * @inject
         */
        protected $persistenceManager;
 
        /**
-        * Injects the Persistence Manager
-        *
-        * @param \TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface $persistenceManager
-        * @return void
-        */
-       public function injectPersistenceManager(\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface $persistenceManager) {
-               $this->persistenceManager = $persistenceManager;
-       }
-
-       /**
         * Prefixes / namespaces the given name with the form field prefix
         *
         * @param string $fieldName field name to be prefixed
index 2954721..4a45dd7 100644 (file)
@@ -56,21 +56,25 @@ class FormViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormViewH
 
        /**
         * @var \TYPO3\CMS\Extbase\Security\Channel\RequestHashService
+        * @inject
         */
        protected $requestHashService;
 
        /**
         * @var \TYPO3\CMS\Extbase\Security\Cryptography\HashService
+        * @inject
         */
        protected $hashService;
 
        /**
         * @var \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService
+        * @inject
         */
        protected $mvcPropertyMappingConfigurationService;
 
        /**
         * @var \TYPO3\CMS\Extbase\Service\ExtensionService
+        * @inject
         */
        protected $extensionService;
 
@@ -84,51 +88,11 @@ class FormViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormViewH
 
        /**
         * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
+        * @inject
         */
        protected $configurationManager;
 
        /**
-        * Inject a request hash service
-        *
-        * @param \TYPO3\CMS\Extbase\Security\Channel\RequestHashService $requestHashService The request hash service
-        * @return void
-        */
-       public function injectRequestHashService(\TYPO3\CMS\Extbase\Security\Channel\RequestHashService $requestHashService) {
-               $this->requestHashService = $requestHashService;
-       }
-
-       /**
-        * @param \TYPO3\CMS\Extbase\Security\Cryptography\HashService $hashService
-        */
-       public function injectHashService(\TYPO3\CMS\Extbase\Security\Cryptography\HashService $hashService) {
-               $this->hashService = $hashService;
-       }
-
-       /**
-        * @param \TYPO3\CMS\Extbase\Service\ExtensionService $extensionService
-        * @return void
-        */
-       public function injectExtensionService(\TYPO3\CMS\Extbase\Service\ExtensionService $extensionService) {
-               $this->extensionService = $extensionService;
-       }
-
-       /**
-        * @param \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager
-        * @return void
-        */
-       public function injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager) {
-               $this->configurationManager = $configurationManager;
-       }
-
-       /**
-        * @param \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService $mvcPropertyMapperConfigurationService
-        * @return void
-        */
-       public function injectMvcPropertyMapperConfigurationService(\TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService $mvcPropertyMapperConfigurationService) {
-               $this->mvcPropertyMappingConfigurationService = $mvcPropertyMapperConfigurationService;
-       }
-
-       /**
         * Initialize arguments.
         *
         * @return void
index 3fee991..60ab90d 100644 (file)
@@ -51,18 +51,11 @@ class AutocompleteViewHelper extends \TYPO3\CMS\Fluid\Core\Widget\AbstractWidget
 
        /**
         * @var \TYPO3\CMS\Fluid\ViewHelpers\Widget\Controller\AutocompleteController
+        * @inject
         */
        protected $controller;
 
        /**
-        * @param \TYPO3\CMS\Fluid\ViewHelpers\Widget\Controller\AutocompleteController $controller
-        * @return void
-        */
-       public function injectController(\TYPO3\CMS\Fluid\ViewHelpers\Widget\Controller\AutocompleteController $controller) {
-               $this->controller = $controller;
-       }
-
-       /**
         * @param \TYPO3\CMS\Extbase\Persistence\Generic\QueryResult $objects
         * @param string $for
         * @param string $searchProperty
index 5c78238..94be6e7 100644 (file)
@@ -54,18 +54,11 @@ class PaginateViewHelper extends \TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetView
 
        /**
         * @var \TYPO3\CMS\Fluid\ViewHelpers\Widget\Controller\PaginateController
+        * @inject
         */
        protected $controller;
 
        /**
-        * @param \TYPO3\CMS\Fluid\ViewHelpers\Widget\Controller\PaginateController $controller
-        * @return void
-        */
-       public function injectController(\TYPO3\CMS\Fluid\ViewHelpers\Widget\Controller\PaginateController $controller) {
-               $this->controller = $controller;
-       }
-
-       /**
         * @param \TYPO3\CMS\Extbase\Persistence\QueryResultInterface $objects
         * @param string $as
         * @param array $configuration
index 868fa98..45420fe 100644 (file)
@@ -92,7 +92,7 @@ class EscapeTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
                $mockObjectManager->expects($this->at(0))->method('get')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\HtmlspecialcharsViewHelper')->will($this->returnValue($mockEscapeViewHelper));
                $mockObjectManager->expects($this->at(1))->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ViewHelperNode', $mockEscapeViewHelper, array('value' => $mockNode))->will($this->returnValue($this->mockNode));
-               $this->escapeInterceptor->injectObjectManager($mockObjectManager);
+               $this->escapeInterceptor->_set('objectManager', $mockObjectManager);
 
                $actualResult = $this->escapeInterceptor->process($mockNode, $interceptorPosition, $this->mockParsingState);
                $this->assertSame($this->mockNode, $actualResult);
index ed88d3d..45eee45 100644 (file)
@@ -51,10 +51,10 @@ class ViewHelperNodeTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
         * Setup fixture
         */
        public function setUp() {
-               $this->renderingContext = new \TYPO3\CMS\Fluid\Core\Rendering\RenderingContext();
+               $this->renderingContext = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Rendering\\RenderingContext');
 
                $this->mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
-               $this->renderingContext->injectObjectManager($this->mockObjectManager);
+               $this->renderingContext->_set('objectManager', $this->mockObjectManager);
 
                $this->templateVariableContainer = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TemplateVariableContainer');
                $this->renderingContext->injectTemplateVariableContainer($this->templateVariableContainer);
@@ -63,7 +63,7 @@ class ViewHelperNodeTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->renderingContext->setControllerContext($this->controllerContext);
 
                $this->viewHelperVariableContainer = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\ViewHelperVariableContainer');
-               $this->renderingContext->injectViewHelperVariableContainer($this->viewHelperVariableContainer);
+               $this->renderingContext->_set('viewHelperVariableContainer', $this->viewHelperVariableContainer);
        }
 
        /**
index f598ec5..997fad6 100644 (file)
@@ -226,7 +226,7 @@ class TemplateParserTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockObjectManager->expects($this->at(1))->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode')->will($this->returnValue($mockRootNode));
 
                $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('dummy'));
-               $templateParser->injectObjectManager($mockObjectManager);
+               $templateParser->_set('objectManager', $mockObjectManager);
                $templateParser->_call('buildObjectTree', array(), \TYPO3\CMS\Fluid\Core\Parser\TemplateParser::CONTEXT_OUTSIDE_VIEWHELPER_ARGUMENTS);
        }
 
@@ -245,7 +245,7 @@ class TemplateParserTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockObjectManager->expects($this->at(1))->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode')->will($this->returnValue($mockRootNode));
 
                $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('dummy'));
-               $templateParser->injectObjectManager($mockObjectManager);
+               $templateParser->_set('objectManager', $mockObjectManager);
                $templateParser->_call('buildObjectTree', array(), \TYPO3\CMS\Fluid\Core\Parser\TemplateParser::CONTEXT_OUTSIDE_VIEWHELPER_ARGUMENTS);
        }
 
@@ -261,7 +261,7 @@ class TemplateParserTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockObjectManager->expects($this->at(1))->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode')->will($this->returnValue($mockRootNode));
 
                $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('textHandler', 'openingViewHelperTagHandler', 'closingViewHelperTagHandler', 'textAndShorthandSyntaxHandler'));
-               $templateParser->injectObjectManager($mockObjectManager);
+               $templateParser->_set('objectManager', $mockObjectManager);
                $templateParser->expects($this->at(0))->method('textAndShorthandSyntaxHandler')->with($mockState, 'The first part is simple');
                $templateParser->expects($this->at(1))->method('textHandler')->with($mockState, '<f:for each="{a: {a: 0, b: 2, c: 4}}" as="array"><f:for each="{array}" as="value">{value} </f:for>');
                $templateParser->expects($this->at(2))->method('openingViewHelperTagHandler')->with($mockState, 'f', 'format.printf', ' arguments="{number : 362525200}"', FALSE);
@@ -318,7 +318,7 @@ class TemplateParserTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockState->expects($this->once())->method('pushNodeToStack')->with($mockViewHelperNode);
 
                $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('abortIfUnregisteredArgumentsExist', 'abortIfRequiredArgumentsAreMissing', 'rewriteBooleanNodesInArgumentsObjectTree'));
-               $templateParser->injectObjectManager($mockObjectManager);
+               $templateParser->_set('objectManager', $mockObjectManager);
 
                $templateParser->_call('initializeViewHelperAndAddItToStack', $mockState, 'f', 'myown', array('arguments'));
        }
@@ -344,7 +344,7 @@ class TemplateParserTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockState->expects($this->once())->method('getNodeFromStack')->will($this->returnValue($mockNodeOnStack));
 
                $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('abortIfUnregisteredArgumentsExist', 'abortIfRequiredArgumentsAreMissing', 'rewriteBooleanNodesInArgumentsObjectTree'));
-               $templateParser->injectObjectManager($mockObjectManager);
+               $templateParser->_set('objectManager', $mockObjectManager);
                $templateParser->expects($this->once())->method('abortIfUnregisteredArgumentsExist')->with($expectedArguments, $argumentsObjectTree);
                $templateParser->expects($this->once())->method('abortIfRequiredArgumentsAreMissing')->with($expectedArguments, $argumentsObjectTree);
 
@@ -370,7 +370,7 @@ class TemplateParserTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockState->expects($this->once())->method('getVariableContainer')->will($this->returnValue($this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TemplateVariableContainer')));
 
                $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('abortIfUnregisteredArgumentsExist', 'abortIfRequiredArgumentsAreMissing', 'rewriteBooleanNodesInArgumentsObjectTree'));
-               $templateParser->injectObjectManager($mockObjectManager);
+               $templateParser->_set('objectManager', $mockObjectManager);
 
                $templateParser->_call('initializeViewHelperAndAddItToStack', $mockState, 'f', 'myown', array('arguments'));
                $this->assertTrue(\TYPO3\CMS\Fluid\Tests\Unit\Core\Parser\Fixtures\PostParseFacetViewHelper::$wasCalled, 'PostParse was not called!');
@@ -501,7 +501,7 @@ class TemplateParserTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockState->expects($this->once())->method('getNodeFromStack')->will($this->returnValue($mockNodeOnStack));
 
                $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('dummy'));
-               $templateParser->injectObjectManager($mockObjectManager);
+               $templateParser->_set('objectManager', $mockObjectManager);
 
                $templateParser->_call('objectAccessorHandler', $mockState, 'objectAccessorString', '', '', '');
        }
@@ -525,7 +525,7 @@ class TemplateParserTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockState->expects($this->once())->method('getNodeFromStack')->will($this->returnValue($mockNodeOnStack));
 
                $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('dummy'));
-               $templateParser->injectObjectManager($mockObjectManager);
+               $templateParser->_set('objectManager', $mockObjectManager);
                $templateParser->_set('configuration', $parserConfiguration);
 
                $templateParser->_call('objectAccessorHandler', $mockState, 'objectAccessorString', '', '', '');
@@ -562,7 +562,7 @@ class TemplateParserTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockObjectManager->expects($this->once())->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\TextNode', 'a very plain string')->will($this->returnValue('theTextNode'));
 
                $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('dummy'));
-               $templateParser->injectObjectManager($mockObjectManager);
+               $templateParser->_set('objectManager', $mockObjectManager);
 
                $this->assertEquals('theTextNode', $templateParser->_call('buildArgumentObjectTree', 'a very plain string'));
        }
@@ -590,7 +590,7 @@ class TemplateParserTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockState = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState');
 
                $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('objectAccessorHandler', 'arrayHandler', 'textHandler'));
-               $templateParser->injectObjectManager($mockObjectManager);
+               $templateParser->_set('objectManager', $mockObjectManager);
                $templateParser->expects($this->at(0))->method('objectAccessorHandler')->with($mockState, 'someThing.absolutely', '', '', '');
                $templateParser->expects($this->at(1))->method('textHandler')->with($mockState, ' "fishy" is \'going\' ');
                $templateParser->expects($this->at(2))->method('arrayHandler')->with($mockState, 'on: "here"');
@@ -613,7 +613,7 @@ class TemplateParserTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockObjectManager->expects($this->once())->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ArrayNode', 'processedArrayText')->will($this->returnValue($arrayNode));
 
                $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('recursiveArrayHandler'));
-               $templateParser->injectObjectManager($mockObjectManager);
+               $templateParser->_set('objectManager', $mockObjectManager);
                $templateParser->expects($this->once())->method('recursiveArrayHandler')->with('arrayText')->will($this->returnValue('processedArrayText'));
 
                $templateParser->_call('arrayHandler', $mockState, 'arrayText');
@@ -643,7 +643,7 @@ class TemplateParserTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockObjectManager->expects($this->any())->method('get')->will($this->returnArgument(1));
 
                $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('buildArgumentObjectTree'));
-               $templateParser->injectObjectManager($mockObjectManager);
+               $templateParser->_set('objectManager', $mockObjectManager);
                $templateParser->expects($this->any())->method('buildArgumentObjectTree')->will($this->returnArgument(0));
 
                $this->assertSame($expectedArray, $templateParser->_call('recursiveArrayHandler', $arrayText));
@@ -669,7 +669,7 @@ class TemplateParserTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockState->expects($this->once())->method('getNodeFromStack')->will($this->returnValue($mockNodeOnStack));
 
                $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('splitTemplateAtDynamicTags', 'buildObjectTree'));
-               $templateParser->injectObjectManager($mockObjectManager);
+               $templateParser->_set('objectManager', $mockObjectManager);
                $templateParser->_set('configuration', $parserConfiguration);
 
                $templateParser->_call('textHandler', $mockState, 'string');
index ac62c05..1060c3a 100644 (file)
@@ -23,7 +23,7 @@ class RenderingContextTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        protected $renderingContext;
 
        public function setUp() {
-               $this->renderingContext = new \TYPO3\CMS\Fluid\Core\Rendering\RenderingContext();
+               $this->renderingContext = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Rendering\\RenderingContext', array('dummy'));
        }
 
        /**
@@ -49,7 +49,7 @@ class RenderingContextTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
         */
        public function viewHelperVariableContainerCanBeReadCorrectly() {
                $viewHelperVariableContainer = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\ViewHelperVariableContainer');
-               $this->renderingContext->injectViewHelperVariableContainer($viewHelperVariableContainer);
+               $this->renderingContext->_set('viewHelperVariableContainer', $viewHelperVariableContainer);
                $this->assertSame($viewHelperVariableContainer, $this->renderingContext->getViewHelperVariableContainer());
        }
 }
index c93e170..648e92e 100644 (file)
@@ -26,7 +26,7 @@ class AbstractTagBasedViewHelperTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseT
        public function initializeResetsUnderlyingTagBuilder() {
                $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('reset'), array(), '', FALSE);
                $mockTagBuilder->expects($this->once())->method('reset');
-               $this->viewHelper->injectTagBuilder($mockTagBuilder);
+               $this->viewHelper->_set('tag', $mockTagBuilder);
 
                $this->viewHelper->initialize();
        }
@@ -37,7 +37,7 @@ class AbstractTagBasedViewHelperTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseT
        public function oneTagAttributeIsRenderedCorrectly() {
                $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('addAttribute'), array(), '', FALSE);
                $mockTagBuilder->expects($this->once())->method('addAttribute')->with('foo', 'bar');
-               $this->viewHelper->injectTagBuilder($mockTagBuilder);
+               $this->viewHelper->_set('tag', $mockTagBuilder);
 
                $this->viewHelper->_call('registerTagAttribute', 'foo', 'string', 'Description', FALSE);
                $arguments = array('foo' => 'bar');
@@ -51,7 +51,7 @@ class AbstractTagBasedViewHelperTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseT
        public function additionalTagAttributesAreRenderedCorrectly() {
                $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('addAttribute'), array(), '', FALSE);
                $mockTagBuilder->expects($this->once())->method('addAttribute')->with('foo', 'bar');
-               $this->viewHelper->injectTagBuilder($mockTagBuilder);
+               $this->viewHelper->_set('tag', $mockTagBuilder);
 
                $this->viewHelper->_call('registerTagAttribute', 'foo', 'string', 'Description', FALSE);
                $arguments = array('additionalAttributes' => array('foo' => 'bar'));
@@ -72,7 +72,7 @@ class AbstractTagBasedViewHelperTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseT
                $mockTagBuilder->expects($this->at(5))->method('addAttribute')->with('title', 'titleAttribute');
                $mockTagBuilder->expects($this->at(6))->method('addAttribute')->with('accesskey', 'accesskeyAttribute');
                $mockTagBuilder->expects($this->at(7))->method('addAttribute')->with('tabindex', 'tabindexAttribute');
-               $this->viewHelper->injectTagBuilder($mockTagBuilder);
+               $this->viewHelper->_set('tag', $mockTagBuilder);
 
                $arguments = array(
                        'class' => 'classAttribute',
index 2992ed2..2d76f6f 100644 (file)
@@ -270,9 +270,9 @@ class AbstractViewHelperTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
                $viewHelperVariableContainer = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\ViewHelperVariableContainer');
                $controllerContext = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ControllerContext', array(), array(), '', FALSE);
 
-               $renderingContext = new \TYPO3\CMS\Fluid\Core\Rendering\RenderingContext();
+               $renderingContext = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Rendering\\RenderingContext', array('dummy'));
                $renderingContext->injectTemplateVariableContainer($templateVariableContainer);
-               $renderingContext->injectViewHelperVariableContainer($viewHelperVariableContainer);
+               $renderingContext->_set('viewHelperVariableContainer', $viewHelperVariableContainer);
                $renderingContext->setControllerContext($controllerContext);
 
                $viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\AbstractViewHelper', array('render', 'prepareArguments'), array(), '', FALSE);
index adb43b5..8a04baa 100644 (file)
@@ -66,7 +66,7 @@ class AbstractWidgetViewHelperTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTes
        public function setUp() {
                $this->viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\AbstractWidgetViewHelper', array('validateArguments', 'initialize', 'callRenderMethod', 'getWidgetConfiguration', 'getRenderingContext'));
                $this->mockExtensionService = $this->getMock('TYPO3\\CMS\\Extbase\\Service\\ExtensionService');
-               $this->viewHelper->injectExtensionService($this->mockExtensionService);
+               $this->viewHelper->_set('extensionService', $this->mockExtensionService);
                $this->ajaxWidgetContextHolder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\AjaxWidgetContextHolder');
                $this->viewHelper->injectAjaxWidgetContextHolder($this->ajaxWidgetContextHolder);
                $this->widgetContext = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetContext');
index 7392041..3d97c57 100644 (file)
@@ -119,8 +119,8 @@ class StandaloneViewTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->mockRenderingContext = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Rendering\\RenderingContext');
                $this->mockRenderingContext->expects($this->any())->method('getControllerContext')->will($this->returnValue($this->mockControllerContext));
                $this->mockRenderingContext->expects($this->any())->method('getViewHelperVariableContainer')->will($this->returnValue($this->mockViewHelperVariableContainer));
-               $this->view->injectTemplateParser($this->mockTemplateParser);
-               $this->view->injectObjectManager($this->mockObjectManager);
+               $this->view->_set('templateParser', $this->mockTemplateParser);
+               $this->view->_set('objectManager', $this->mockObjectManager);
                $this->view->setRenderingContext($this->mockRenderingContext);
                $this->mockTemplateCompiler = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Compiler\\TemplateCompiler');
                $this->view->_set('templateCompiler', $this->mockTemplateCompiler);
index 0ce8104..daefaa2 100644 (file)
@@ -33,7 +33,7 @@ class AbstractFormFieldViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHe
 
                $formViewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormFieldViewHelper', array('dummy'), array(), '', FALSE);
                $this->injectDependenciesIntoViewHelper($formViewHelper);
-               $formViewHelper->injectPersistenceManager($mockPersistenceManager);
+               $formViewHelper->_set('persistenceManager', $mockPersistenceManager);
 
                $arguments = array('name' => 'foo', 'value' => $object, 'property' => NULL);
                $formViewHelper->_set('arguments', $arguments);
@@ -190,7 +190,7 @@ class AbstractFormFieldViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHe
                $formViewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormFieldViewHelper', array('isObjectAccessorMode'), array(), '', FALSE);
                $formViewHelper->expects($this->any())->method('isObjectAccessorMode')->will($this->returnValue(FALSE));
                $this->injectDependenciesIntoViewHelper($formViewHelper);
-               $formViewHelper->injectPersistenceManager($mockPersistenceManager);
+               $formViewHelper->_set('persistenceManager', $mockPersistenceManager);
 
                $mockArguments = array('value' => $mockObject);
                $formViewHelper->_set('arguments', $mockArguments);
@@ -210,7 +210,7 @@ class AbstractFormFieldViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHe
                $formViewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\AbstractFormFieldViewHelper', array('isObjectAccessorMode'), array(), '', FALSE);
                $formViewHelper->expects($this->any())->method('isObjectAccessorMode')->will($this->returnValue(FALSE));
                $this->injectDependenciesIntoViewHelper($formViewHelper);
-               $formViewHelper->injectPersistenceManager($mockPersistenceManager);
+               $formViewHelper->_set('persistenceManager', $mockPersistenceManager);
 
                $mockArguments = array('value' => $mockObject);
                $formViewHelper->_set('arguments', $mockArguments);
index 85ea080..09030d8 100644 (file)
@@ -42,7 +42,7 @@ class ButtonViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\
 
                $this->viewHelper->expects($this->atLeastOnce())->method('renderChildren')->will($this->returnValue('Button Content'));
 
-               $this->viewHelper->injectTagBuilder($mockTagBuilder);
+               $this->viewHelper->_set('tag', $mockTagBuilder);
 
                $this->viewHelper->initialize();
                $this->viewHelper->render();
index c2ac397..f84dc8d 100644 (file)
@@ -42,7 +42,7 @@ class CheckboxViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\For
 
                $this->viewHelper->expects($this->any())->method('getName')->will($this->returnValue('foo'));
                $this->viewHelper->expects($this->any())->method('getValue')->will($this->returnValue('bar'));
-               $this->viewHelper->injectTagBuilder($mockTagBuilder);
+               $this->viewHelper->_set('tag', $mockTagBuilder);
 
                $this->viewHelper->initialize();
                $this->viewHelper->render();
@@ -60,7 +60,7 @@ class CheckboxViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\For
 
                $this->viewHelper->expects($this->any())->method('getName')->will($this->returnValue('foo'));
                $this->viewHelper->expects($this->any())->method('getValue')->will($this->returnValue('bar'));
-               $this->viewHelper->injectTagBuilder($mockTagBuilder);
+               $this->viewHelper->_set('tag', $mockTagBuilder);
 
                $this->viewHelper->initialize();
                $this->viewHelper->render(TRUE);
@@ -79,7 +79,7 @@ class CheckboxViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\For
                $this->viewHelper->expects($this->any())->method('getValue')->will($this->returnValue('bar'));
                $this->viewHelper->expects($this->any())->method('isObjectAccessorMode')->will($this->returnValue(TRUE));
                $this->viewHelper->expects($this->any())->method('getPropertyValue')->will($this->returnValue(TRUE));
-               $this->viewHelper->injectTagBuilder($mockTagBuilder);
+               $this->viewHelper->_set('tag', $mockTagBuilder);
 
                $this->viewHelper->initialize();
                $this->viewHelper->render(TRUE);
@@ -100,7 +100,7 @@ class CheckboxViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\For
                $this->viewHelper->expects($this->any())->method('getValue')->will($this->returnValue('bar'));
                $this->viewHelper->expects($this->any())->method('isObjectAccessorMode')->will($this->returnValue(TRUE));
                $this->viewHelper->expects($this->any())->method('getPropertyValue')->will($this->returnValue(TRUE));
-               $this->viewHelper->injectTagBuilder($mockTagBuilder);
+               $this->viewHelper->_set('tag', $mockTagBuilder);
 
                $this->viewHelper->initialize();
                $this->viewHelper->render();
@@ -120,7 +120,7 @@ class CheckboxViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\For
                $this->viewHelper->expects($this->any())->method('getValue')->will($this->returnValue('bar'));
                $this->viewHelper->expects($this->any())->method('isObjectAccessorMode')->will($this->returnValue(TRUE));
                $this->viewHelper->expects($this->any())->method('getPropertyValue')->will($this->returnValue(array()));
-               $this->viewHelper->injectTagBuilder($mockTagBuilder);
+               $this->viewHelper->_set('tag', $mockTagBuilder);
 
                $this->viewHelper->initialize();
                $this->viewHelper->render();
@@ -140,7 +140,7 @@ class CheckboxViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\For
                $this->viewHelper->expects($this->any())->method('getValue')->will($this->returnValue('bar'));
                $this->viewHelper->expects($this->any())->method('isObjectAccessorMode')->will($this->returnValue(TRUE));
                $this->viewHelper->expects($this->any())->method('getPropertyValue')->will($this->returnValue(array('foo', 'bar', 'baz')));
-               $this->viewHelper->injectTagBuilder($mockTagBuilder);
+               $this->viewHelper->_set('tag', $mockTagBuilder);
 
                $this->viewHelper->initialize();
                $this->viewHelper->render();
@@ -160,7 +160,7 @@ class CheckboxViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\For
                $this->viewHelper->expects($this->any())->method('getValue')->will($this->returnValue('bar'));
                $this->viewHelper->expects($this->any())->method('isObjectAccessorMode')->will($this->returnValue(TRUE));
                $this->viewHelper->expects($this->any())->method('getPropertyValue')->will($this->returnValue(new \ArrayObject(array('foo', 'bar', 'baz'))));
-               $this->viewHelper->injectTagBuilder($mockTagBuilder);
+               $this->viewHelper->_set('tag', $mockTagBuilder);
 
                $this->viewHelper->initialize();
                $this->viewHelper->render();
@@ -180,7 +180,7 @@ class CheckboxViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\For
                $this->viewHelper->expects($this->any())->method('getValue')->will($this->returnValue('bar'));
                $this->viewHelper->expects($this->any())->method('isObjectAccessorMode')->will($this->returnValue(TRUE));
                $this->viewHelper->expects($this->any())->method('getPropertyValue')->will($this->returnValue(new \stdClass()));
-               $this->viewHelper->injectTagBuilder($mockTagBuilder);
+               $this->viewHelper->_set('tag', $mockTagBuilder);
 
                $this->viewHelper->initialize();
                $this->viewHelper->render();
index f396f76..13f2600 100644 (file)
@@ -44,7 +44,7 @@ abstract class FormFieldViewHelperBaseTestcase extends \TYPO3\CMS\Fluid\Tests\Un
         * @return void
         */
        protected function injectDependenciesIntoViewHelper(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper $viewHelper) {
-               $viewHelper->injectConfigurationManager($this->mockConfigurationManager);
+               $viewHelper->_set('configurationManager', $this->mockConfigurationManager);
                parent::injectDependenciesIntoViewHelper($viewHelper);
        }
 }
index 55deaf7..3a0897b 100644 (file)
@@ -41,7 +41,7 @@ class HiddenViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\
 
                $this->viewHelper->expects($this->once())->method('getName')->will($this->returnValue('foo'));
                $this->viewHelper->expects($this->once())->method('getValue')->will($this->returnValue('bar'));
-               $this->viewHelper->injectTagBuilder($mockTagBuilder);
+               $this->viewHelper->_set('tag', $mockTagBuilder);
 
                $this->viewHelper->initialize();
                $this->viewHelper->render();
index 7079c39..d1b2cf5 100644 (file)
@@ -35,7 +35,7 @@ class PasswordViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\For
        public function renderCorrectlySetsTagName() {
                $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('setTagName'), array(), '', FALSE);
                $mockTagBuilder->expects($this->once())->method('setTagName')->with('input');
-               $this->viewHelper->injectTagBuilder($mockTagBuilder);
+               $this->viewHelper->_set('tag', $mockTagBuilder);
 
                $this->viewHelper->initialize();
                $this->viewHelper->render();
@@ -51,7 +51,7 @@ class PasswordViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\For
                $this->viewHelper->expects($this->once())->method('registerFieldNameForFormTokenGeneration')->with('NameOfTextbox');
                $mockTagBuilder->expects($this->at(2))->method('addAttribute')->with('value', 'Current value');
                $mockTagBuilder->expects($this->once())->method('render');
-               $this->viewHelper->injectTagBuilder($mockTagBuilder);
+               $this->viewHelper->_set('tag', $mockTagBuilder);
 
                $arguments = array(
                        'name' => 'NameOfTextbox',
index 39266eb..94b044d 100644 (file)
@@ -41,7 +41,7 @@ class RadioViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\F
 
                $this->viewHelper->expects($this->any())->method('getName')->will($this->returnValue('foo'));
                $this->viewHelper->expects($this->any())->method('getValue')->will($this->returnValue('bar'));
-               $this->viewHelper->injectTagBuilder($mockTagBuilder);
+               $this->viewHelper->_set('tag', $mockTagBuilder);
 
                $this->viewHelper->initialize();
                $this->viewHelper->render();
@@ -60,7 +60,7 @@ class RadioViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\F
 
                $this->viewHelper->expects($this->any())->method('getName')->will($this->returnValue('foo'));
                $this->viewHelper->expects($this->any())->method('getValue')->will($this->returnValue('bar'));
-               $this->viewHelper->injectTagBuilder($mockTagBuilder);
+               $this->viewHelper->_set('tag', $mockTagBuilder);
 
                $this->viewHelper->initialize();
                $this->viewHelper->render(TRUE);
@@ -79,7 +79,7 @@ class RadioViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\F
                $this->viewHelper->expects($this->any())->method('getValue')->will($this->returnValue('bar'));
                $this->viewHelper->expects($this->never())->method('isObjectAccessorMode')->will($this->returnValue(TRUE));
                $this->viewHelper->expects($this->never())->method('getPropertyValue')->will($this->returnValue(TRUE));
-               $this->viewHelper->injectTagBuilder($mockTagBuilder);
+               $this->viewHelper->_set('tag', $mockTagBuilder);
 
                $this->viewHelper->initialize();
                $this->viewHelper->render(TRUE);
@@ -101,7 +101,7 @@ class RadioViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\F
                $this->viewHelper->expects($this->any())->method('getValue')->will($this->returnValue('bar'));
                $this->viewHelper->expects($this->any())->method('isObjectAccessorMode')->will($this->returnValue(TRUE));
                $this->viewHelper->expects($this->any())->method('getPropertyValue')->will($this->returnValue(TRUE));
-               $this->viewHelper->injectTagBuilder($mockTagBuilder);
+               $this->viewHelper->_set('tag', $mockTagBuilder);
 
                $this->viewHelper->initialize();
                $this->viewHelper->render();
@@ -121,7 +121,7 @@ class RadioViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\F
                $this->viewHelper->expects($this->any())->method('getValue')->will($this->returnValue('bar'));
                $this->viewHelper->expects($this->any())->method('isObjectAccessorMode')->will($this->returnValue(TRUE));
                $this->viewHelper->expects($this->any())->method('getPropertyValue')->will($this->returnValue(array()));
-               $this->viewHelper->injectTagBuilder($mockTagBuilder);
+               $this->viewHelper->_set('tag', $mockTagBuilder);
 
                $this->viewHelper->initialize();
                $this->viewHelper->render();
@@ -142,7 +142,7 @@ class RadioViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\F
                $this->viewHelper->expects($this->any())->method('getValue')->will($this->returnValue('bar'));
                $this->viewHelper->expects($this->any())->method('isObjectAccessorMode')->will($this->returnValue(TRUE));
                $this->viewHelper->expects($this->any())->method('getPropertyValue')->will($this->returnValue('bar'));
-               $this->viewHelper->injectTagBuilder($mockTagBuilder);
+               $this->viewHelper->_set('tag', $mockTagBuilder);
 
                $this->viewHelper->initialize();
                $this->viewHelper->render();
index 8dfaef2..705e100 100644 (file)
@@ -211,7 +211,7 @@ class SelectViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\
        public function selectOnDomainObjectsCreatesExpectedOptions() {
                $mockPersistenceManager = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\PersistenceManagerInterface');
                $mockPersistenceManager->expects($this->any())->method('getIdentifierByObject')->will($this->returnValue(NULL));
-               $this->viewHelper->injectPersistenceManager($mockPersistenceManager);
+               $this->viewHelper->_set('persistenceManager', $mockPersistenceManager);
 
                $this->tagBuilder->expects($this->once())->method('addAttribute')->with('name', 'myName');
                $this->viewHelper->expects($this->once())->method('registerFieldNameForFormTokenGeneration')->with('myName');
@@ -283,7 +283,7 @@ class SelectViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\
                                return $object->getId();
                        }
                ));
-               $this->viewHelper->injectPersistenceManager($mockPersistenceManager);
+               $this->viewHelper->_set('persistenceManager', $mockPersistenceManager);
 
                $this->tagBuilder = new \TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder();
                $this->viewHelper->expects($this->exactly(3))->method('registerFieldNameForFormTokenGeneration')->with('myName[]');
@@ -318,7 +318,7 @@ class SelectViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\
        public function selectWithoutFurtherConfigurationOnDomainObjectsUsesUuidForValueAndLabel() {
                $mockPersistenceManager = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\PersistenceManagerInterface');
                $mockPersistenceManager->expects($this->any())->method('getIdentifierByObject')->will($this->returnValue('fakeUID'));
-               $this->viewHelper->injectPersistenceManager($mockPersistenceManager);
+               $this->viewHelper->_set('persistenceManager', $mockPersistenceManager);
 
                $this->tagBuilder->expects($this->once())->method('addAttribute')->with('name', 'myName');
                $this->viewHelper->expects($this->once())->method('registerFieldNameForFormTokenGeneration')->with('myName');
@@ -343,7 +343,7 @@ class SelectViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\
        public function selectWithoutFurtherConfigurationOnDomainObjectsUsesToStringForLabelIfAvailable() {
                $mockPersistenceManager = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\PersistenceManagerInterface');
                $mockPersistenceManager->expects($this->any())->method('getIdentifierByObject')->will($this->returnValue('fakeUID'));
-               $this->viewHelper->injectPersistenceManager($mockPersistenceManager);
+               $this->viewHelper->_set('persistenceManager', $mockPersistenceManager);
 
                $this->tagBuilder->expects($this->once())->method('addAttribute')->with('name', 'myName');
                $this->viewHelper->expects($this->once())->method('registerFieldNameForFormTokenGeneration')->with('myName');
@@ -370,7 +370,7 @@ class SelectViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\
        public function selectOnDomainObjectsThrowsExceptionIfNoValueCanBeFound() {
                $mockPersistenceManager = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\PersistenceManagerInterface');
                $mockPersistenceManager->expects($this->any())->method('getIdentifierByObject')->will($this->returnValue(NULL));
-               $this->viewHelper->injectPersistenceManager($mockPersistenceManager);
+               $this->viewHelper->_set('persistenceManager', $mockPersistenceManager);
 
                $user = new \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\Fixtures\UserDomainClass(1, 'Ingmar', 'Schlecht');
 
index 7424110..a889d6b 100644 (file)
@@ -17,13 +17,13 @@ namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form;
 class SubmitViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\FormFieldViewHelperBaseTestcase {
 
        /**
-        * @var \TYPO3\CMS\Fluid\ViewHelpers\Form\ubmitViewHelper
+        * @var \TYPO3\CMS\Fluid\ViewHelpers\Form\SubmitViewHelper
         */
        protected $viewHelper;
 
        public function setUp() {
                parent::setUp();
-               $this->viewHelper = new \TYPO3\CMS\Fluid\ViewHelpers\Form\SubmitViewHelper();
+               $this->viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\SubmitViewHelper', array('dummy'));
                $this->arguments['name'] = '';
                $this->injectDependenciesIntoViewHelper($this->viewHelper);
                $this->viewHelper->initializeArguments();
@@ -37,7 +37,7 @@ class SubmitViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\
                $mockTagBuilder->expects($this->once())->method('setTagName')->with('input');
                $mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('type', 'submit');
 
-               $this->viewHelper->injectTagBuilder($mockTagBuilder);
+               $this->viewHelper->_set('tag', $mockTagBuilder);
 
                $this->viewHelper->initialize();
                $this->viewHelper->render();
index 537a07b..e7ef502 100644 (file)
@@ -35,7 +35,7 @@ class TextareaViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\For
        public function renderCorrectlySetsTagName() {
                $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('setTagName'), array(), '', FALSE);
                $mockTagBuilder->expects($this->once())->method('setTagName')->with('textarea');
-               $this->viewHelper->injectTagBuilder($mockTagBuilder);
+               $this->viewHelper->_set('tag', $mockTagBuilder);
 
                $this->viewHelper->initialize();
                $this->viewHelper->render();
@@ -50,7 +50,7 @@ class TextareaViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\For
                $this->viewHelper->expects($this->once())->method('registerFieldNameForFormTokenGeneration')->with('NameOfTextarea');
                $mockTagBuilder->expects($this->once())->method('setContent')->with('Current value');
                $mockTagBuilder->expects($this->once())->method('render');
-               $this->viewHelper->injectTagBuilder($mockTagBuilder);
+               $this->viewHelper->_set('tag', $mockTagBuilder);
 
                $arguments = array(
                        'name' => 'NameOfTextarea',
@@ -80,7 +80,7 @@ class TextareaViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\For
                $this->viewHelper->expects($this->once())->method('registerFieldNameForFormTokenGeneration')->with('NameOfTextarea');
                $mockTagBuilder->expects($this->once())->method('setContent')->with('some &lt;tag&gt; &amp; &quot;quotes&quot;');
                $mockTagBuilder->expects($this->once())->method('render');
-               $this->viewHelper->injectTagBuilder($mockTagBuilder);
+               $this->viewHelper->_set('tag', $mockTagBuilder);
 
                $arguments = array(
                        'name' => 'NameOfTextarea',
@@ -101,7 +101,7 @@ class TextareaViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\For
                $mockTagBuilder->expects($this->at(0))->method('addAttribute')->with('placeholder', 'SomePlaceholder');
                $mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('name', 'NameOfTextarea');
                $mockTagBuilder->expects($this->once())->method('render');
-               $this->viewHelper->injectTagBuilder($mockTagBuilder);
+               $this->viewHelper->_set('tag', $mockTagBuilder);
 
                $arguments = array(
                        'name' => 'NameOfTextarea',
index 95d1145..7f6625c 100644 (file)
@@ -35,7 +35,7 @@ class TextfieldViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Fo
        public function renderCorrectlySetsTagName() {
                $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('setTagName'), array(), '', FALSE);
                $mockTagBuilder->expects($this->once())->method('setTagName')->with('input');
-               $this->viewHelper->injectTagBuilder($mockTagBuilder);
+               $this->viewHelper->_set('tag', $mockTagBuilder);
 
                $this->viewHelper->initialize();
                $this->viewHelper->render();
@@ -51,7 +51,7 @@ class TextfieldViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Fo
                $this->viewHelper->expects($this->once())->method('registerFieldNameForFormTokenGeneration')->with('NameOfTextfield');
                $mockTagBuilder->expects($this->at(2))->method('addAttribute')->with('value', 'Current value');
                $mockTagBuilder->expects($this->once())->method('render');
-               $this->viewHelper->injectTagBuilder($mockTagBuilder);
+               $this->viewHelper->_set('tag', $mockTagBuilder);
 
                $arguments = array(
                        'name' => 'NameOfTextfield',
@@ -82,7 +82,7 @@ class TextfieldViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Fo
                $mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('type', 'text');
                $mockTagBuilder->expects($this->at(2))->method('addAttribute')->with('name', 'NameOfTextfield');
                $mockTagBuilder->expects($this->once())->method('render');
-               $this->viewHelper->injectTagBuilder($mockTagBuilder);
+               $this->viewHelper->_set('tag', $mockTagBuilder);
 
                $arguments = array(
                        'name' => 'NameOfTextfield',
index c4b03c3..41ab8ce 100644 (file)
@@ -52,7 +52,7 @@ class UploadViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\
                $this->viewHelper->expects($this->at(3))->method('registerFieldNameForFormTokenGeneration')->with('someName[error]');
                $this->viewHelper->expects($this->at(4))->method('registerFieldNameForFormTokenGeneration')->with('someName[size]');
                $mockTagBuilder->expects($this->once())->method('render');
-               $this->viewHelper->injectTagBuilder($mockTagBuilder);
+               $this->viewHelper->_set('tag', $mockTagBuilder);
                $arguments = array(
                        'name' => 'someName'
                );
index 0c20264..89407e6 100644 (file)
@@ -87,9 +87,9 @@ abstract class ViewHelperBaseTestcase extends \TYPO3\CMS\Extbase\Tests\Unit\Base
                $this->controllerContext->expects($this->any())->method('getRequest')->will($this->returnValue($this->request));
                $this->tagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder');
                $this->arguments = array();
-               $this->renderingContext = new \TYPO3\CMS\Fluid\Core\Rendering\RenderingContext();
+               $this->renderingContext = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Rendering\\RenderingContext', array('dummy'));
                $this->renderingContext->injectTemplateVariableContainer($this->templateVariableContainer);
-               $this->renderingContext->injectViewHelperVariableContainer($this->viewHelperVariableContainer);
+               $this->renderingContext->_set('viewHelperVariableContainer', $this->viewHelperVariableContainer);
                $this->renderingContext->setControllerContext($this->controllerContext);
                $this->mvcPropertyMapperConfigurationService = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService', array('dummy'));
        }
@@ -102,7 +102,7 @@ abstract class ViewHelperBaseTestcase extends \TYPO3\CMS\Extbase\Tests\Unit\Base
                $viewHelper->setRenderingContext($this->renderingContext);
                $viewHelper->setArguments($this->arguments);
                if ($viewHelper instanceof \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper) {
-                       $viewHelper->injectTagBuilder($this->tagBuilder);
+                       $viewHelper->_set('tag', $this->tagBuilder);
                }
        }
 }