[TASK] Replace ObjectManager create with get
authorMarc Bastian Heinrichs <typo3@mbh-software.de>
Sun, 10 Feb 2013 11:06:09 +0000 (12:06 +0100)
committerAndreas Wolf <andreas.wolf@typo3.org>
Sun, 10 Feb 2013 11:18:59 +0000 (12:18 +0100)
Since Extbase ObjectManager::create is deprecated replace all
usages of the create method with get.

Change-Id: Id1b3157742cd61705ba64a802953cf486269dd93
Resolves: #45324
Releases: 6.1
Reviewed-on: https://review.typo3.org/18176
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Andreas Wolf
Tested-by: Andreas Wolf
13 files changed:
typo3/sysext/fluid/Classes/Compatibility/DocbookGeneratorService.php
typo3/sysext/fluid/Classes/Core/Parser/TemplateParser.php
typo3/sysext/fluid/Classes/Core/Widget/AbstractWidgetViewHelper.php
typo3/sysext/fluid/Classes/Core/Widget/WidgetRequestBuilder.php
typo3/sysext/fluid/Classes/Core/Widget/WidgetRequestHandler.php
typo3/sysext/fluid/Classes/View/AbstractTemplateView.php
typo3/sysext/fluid/Classes/View/StandaloneView.php
typo3/sysext/fluid/Classes/View/TemplateView.php
typo3/sysext/fluid/Tests/Unit/Core/Parser/TemplateParserTest.php
typo3/sysext/fluid/Tests/Unit/Core/Widget/AbstractWidgetControllerTest.php
typo3/sysext/fluid/Tests/Unit/Core/Widget/AbstractWidgetViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/Core/Widget/WidgetRequestBuilderTest.php
typo3/sysext/fluid/Tests/Unit/View/StandaloneViewTest.php

index e89a6b6..014b13a 100644 (file)
@@ -70,7 +70,7 @@ class DocbookGeneratorService extends \TYPO3\CMS\Fluid\Service\DocbookGenerator
 
        protected function instanciateViewHelper($className) {
                $objectFactory = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
-               return $objectFactory->create($className);
+               return $objectFactory->get($className);
        }
 }
 
index 09cb06c..9ea620f 100644 (file)
@@ -367,8 +367,8 @@ class TemplateParser {
        protected function buildObjectTree($splitTemplate) {
                $regularExpression_openingViewHelperTag = $this->prepareTemplateRegularExpression(self::$SCAN_PATTERN_TEMPLATE_VIEWHELPERTAG);
                $regularExpression_closingViewHelperTag = $this->prepareTemplateRegularExpression(self::$SCAN_PATTERN_TEMPLATE_CLOSINGVIEWHELPERTAG);
-               $state = $this->objectManager->create('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState');
-               $rootNode = $this->objectManager->create('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode');
+               $state = $this->objectManager->get('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState');
+               $rootNode = $this->objectManager->get('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode');
                $state->setRootNode($rootNode);
                $state->pushNodeToStack($rootNode);
                foreach ($splitTemplate as $templateElement) {
@@ -429,7 +429,7 @@ class TemplateParser {
                $this->abortIfUnregisteredArgumentsExist($expectedViewHelperArguments, $argumentsObjectTree);
                $this->abortIfRequiredArgumentsAreMissing($expectedViewHelperArguments, $argumentsObjectTree);
                $this->rewriteBooleanNodesInArgumentsObjectTree($expectedViewHelperArguments, $argumentsObjectTree);
-               $currentViewHelperNode = $this->objectManager->create('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ViewHelperNode', $viewHelper, $argumentsObjectTree);
+               $currentViewHelperNode = $this->objectManager->get('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ViewHelperNode', $viewHelper, $argumentsObjectTree);
                $state->getNodeFromStack()->addChildNode($currentViewHelperNode);
                if ($viewHelper instanceof \TYPO3\CMS\Fluid\Core\ViewHelper\Facets\ChildNodeAccessInterface && !$viewHelper instanceof \TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface) {
                        $state->setCompilable(FALSE);
@@ -576,7 +576,7 @@ class TemplateParser {
                }
                // Object Accessor
                if (strlen($objectAccessorString) > 0) {
-                       $node = $this->objectManager->create('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ObjectAccessorNode', $objectAccessorString);
+                       $node = $this->objectManager->get('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ObjectAccessorNode', $objectAccessorString);
                        $this->callInterceptor($node, \TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface::INTERCEPT_OBJECTACCESSOR, $state);
                        $state->getNodeFromStack()->addChildNode($node);
                }
@@ -621,7 +621,7 @@ class TemplateParser {
        protected function postProcessArgumentsForObjectAccessor(array $arguments) {
                foreach ($arguments as $argumentName => $argumentValue) {
                        if (!$argumentValue instanceof \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode) {
-                               $arguments[$argumentName] = $this->objectManager->create('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\TextNode', (string) $argumentValue);
+                               $arguments[$argumentName] = $this->objectManager->get('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\TextNode', (string) $argumentValue);
                        }
                }
                return $arguments;
@@ -664,7 +664,7 @@ class TemplateParser {
         */
        protected function buildArgumentObjectTree($argumentString) {
                if (strpos($argumentString, '{') === FALSE && strpos($argumentString, '<') === FALSE) {
-                       return $this->objectManager->create('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\TextNode', $argumentString);
+                       return $this->objectManager->get('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\TextNode', $argumentString);
                }
                $splitArgument = $this->splitTemplateAtDynamicTags($argumentString);
                $rootNode = $this->buildObjectTree($splitArgument)->getRootNode();
@@ -736,7 +736,7 @@ class TemplateParser {
         * @return void
         */
        protected function arrayHandler(\TYPO3\CMS\Fluid\Core\Parser\ParsingState $state, $arrayText) {
-               $state->getNodeFromStack()->addChildNode($this->objectManager->create('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ArrayNode', $this->recursiveArrayHandler($arrayText)));
+               $state->getNodeFromStack()->addChildNode($this->objectManager->get('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ArrayNode', $this->recursiveArrayHandler($arrayText)));
        }
 
        /**
@@ -760,14 +760,14 @@ class TemplateParser {
                        foreach ($matches as $singleMatch) {
                                $arrayKey = $singleMatch['Key'];
                                if (!empty($singleMatch['VariableIdentifier'])) {
-                                       $arrayToBuild[$arrayKey] = $this->objectManager->create('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ObjectAccessorNode', $singleMatch['VariableIdentifier']);
+                                       $arrayToBuild[$arrayKey] = $this->objectManager->get('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ObjectAccessorNode', $singleMatch['VariableIdentifier']);
                                } elseif (array_key_exists('Number', $singleMatch) && (!empty($singleMatch['Number']) || $singleMatch['Number'] === '0')) {
                                        $arrayToBuild[$arrayKey] = floatval($singleMatch['Number']);
                                } elseif (array_key_exists('QuotedString', $singleMatch) && !empty($singleMatch['QuotedString'])) {
                                        $argumentString = $this->unquoteString($singleMatch['QuotedString']);
                                        $arrayToBuild[$arrayKey] = $this->buildArgumentObjectTree($argumentString);
                                } elseif (array_key_exists('Subarray', $singleMatch) && !empty($singleMatch['Subarray'])) {
-                                       $arrayToBuild[$arrayKey] = $this->objectManager->create('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ArrayNode', $this->recursiveArrayHandler($singleMatch['Subarray']));
+                                       $arrayToBuild[$arrayKey] = $this->objectManager->get('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ArrayNode', $this->recursiveArrayHandler($singleMatch['Subarray']));
                                } else {
                                        throw new \TYPO3\CMS\Fluid\Core\Parser\Exception('This exception should never be thrown, as the array value has to be of some type (Value given: "' . var_export($singleMatch, TRUE) . '"). Please post your template to the bugtracker at forge.typo3.org.', 1225136013);
                                }
@@ -786,7 +786,7 @@ class TemplateParser {
         * @return void
         */
        protected function textHandler(\TYPO3\CMS\Fluid\Core\Parser\ParsingState $state, $text) {
-               $node = $this->objectManager->create('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\TextNode', $text);
+               $node = $this->objectManager->get('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\TextNode', $text);
                $this->callInterceptor($node, \TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface::INTERCEPT_TEXT, $state);
                $state->getNodeFromStack()->addChildNode($node);
        }
index 2dec786..2531557 100644 (file)
@@ -77,7 +77,7 @@ abstract class AbstractWidgetViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper
         */
        public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
                $this->objectManager = $objectManager;
-               $this->widgetContext = $this->objectManager->create('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetContext');
+               $this->widgetContext = $this->objectManager->get('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetContext');
        }
 
        /**
@@ -129,7 +129,7 @@ abstract class AbstractWidgetViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper
         * @return void
         */
        public function setChildNodes(array $childNodes) {
-               $rootNode = $this->objectManager->create('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode');
+               $rootNode = $this->objectManager->get('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode');
                foreach ($childNodes as $childNode) {
                        $rootNode->addChildNode($childNode);
                }
@@ -160,10 +160,10 @@ abstract class AbstractWidgetViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper
                        }
                        throw new \TYPO3\CMS\Fluid\Core\Widget\Exception\MissingControllerException('initiateSubRequest() can not be called if there is no controller inside $this->controller. Make sure to add a corresponding injectController method to your WidgetViewHelper class "' . get_class($this) . '".', 1284401632);
                }
-               $subRequest = $this->objectManager->create('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequest');
+               $subRequest = $this->objectManager->get('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequest');
                $subRequest->setWidgetContext($this->widgetContext);
                $this->passArgumentsToSubRequest($subRequest);
-               $subResponse = $this->objectManager->create('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Response');
+               $subResponse = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Response');
                $this->controller->processRequest($subRequest, $subResponse);
                return $subResponse;
        }
index 08aac46..61cb071 100644 (file)
@@ -44,7 +44,7 @@ class WidgetRequestBuilder extends \TYPO3\CMS\Extbase\Mvc\Web\RequestBuilder {
         * @return \TYPO3\CMS\Fluid\Core\Widget\WidgetRequest The widget request as an object
         */
        public function build() {
-               $request = $this->objectManager->create('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequest');
+               $request = $this->objectManager->get('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequest');
                $request->setRequestURI(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'));
                $request->setBaseURI(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL'));
                $request->setMethod(isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : NULL);
index 3b183d3..091519f 100644 (file)
@@ -74,7 +74,7 @@ class WidgetRequestHandler extends \TYPO3\CMS\Extbase\Mvc\Web\AbstractRequestHan
                if (isset($this->cObj->data) && is_array($this->cObj->data)) {
                        $request->setContentObjectData($this->cObj->data);
                }
-               $response = $this->objectManager->create('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Response');
+               $response = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Response');
                $this->dispatcher->dispatch($request, $response);
                return $response;
        }
index acd2ee1..734f80c 100644 (file)
@@ -219,7 +219,7 @@ abstract class AbstractTemplateView implements \TYPO3\CMS\Extbase\Mvc\View\ViewI
                        // in case we render a layout right now, we will render a section inside a TEMPLATE.
                        $renderingTypeOnNextLevel = self::RENDERING_TEMPLATE;
                } else {
-                       $variableContainer = $this->objectManager->create('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TemplateVariableContainer', $variables);
+                       $variableContainer = $this->objectManager->get('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TemplateVariableContainer', $variables);
                        $renderingContext = clone $renderingContext;
                        $renderingContext->injectTemplateVariableContainer($variableContainer);
                        $renderingTypeOnNextLevel = $this->getCurrentRenderingType();
@@ -274,7 +274,7 @@ abstract class AbstractTemplateView implements \TYPO3\CMS\Extbase\Mvc\View\ViewI
                                $this->templateCompiler->store($partialIdentifier, $parsedPartial);
                        }
                }
-               $variableContainer = $this->objectManager->create('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TemplateVariableContainer', $variables);
+               $variableContainer = $this->objectManager->get('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TemplateVariableContainer', $variables);
                $renderingContext = clone $this->getCurrentRenderingContext();
                $renderingContext->injectTemplateVariableContainer($variableContainer);
                $this->startRendering(self::RENDERING_PARTIAL, $parsedPartial, $renderingContext);
@@ -353,7 +353,7 @@ abstract class AbstractTemplateView implements \TYPO3\CMS\Extbase\Mvc\View\ViewI
         * @return \TYPO3\CMS\Fluid\Core\Parser\Configuration
         */
        protected function buildParserConfiguration() {
-               $parserConfiguration = $this->objectManager->create('TYPO3\\CMS\\Fluid\\Core\\Parser\\Configuration');
+               $parserConfiguration = $this->objectManager->get('TYPO3\\CMS\\Fluid\\Core\\Parser\\Configuration');
                if ($this->controllerContext->getRequest()->getFormat() === 'html') {
                        $parserConfiguration->addInterceptor($this->objectManager->get('TYPO3\\CMS\\Fluid\\Core\\Parser\\Interceptor\\Escape'));
                }
index 5eccb41..dad9c16 100644 (file)
@@ -77,13 +77,13 @@ class StandaloneView extends \TYPO3\CMS\Fluid\View\AbstractTemplateView {
                }
                $configurationManager->setContentObject($contentObject);
                $this->templateParser = $this->objectManager->get('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser');
-               $this->setRenderingContext($this->objectManager->create('TYPO3\\CMS\\Fluid\\Core\\Rendering\\RenderingContext'));
-               $request = $this->objectManager->create('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request');
+               $this->setRenderingContext($this->objectManager->get('TYPO3\\CMS\\Fluid\\Core\\Rendering\\RenderingContext'));
+               $request = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request');
                $request->setRequestURI(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'));
                $request->setBaseURI(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL'));
-               $uriBuilder = $this->objectManager->create('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder');
+               $uriBuilder = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder');
                $uriBuilder->setRequest($request);
-               $controllerContext = $this->objectManager->create('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ControllerContext');
+               $controllerContext = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ControllerContext');
                $controllerContext->setRequest($request);
                $controllerContext->setUriBuilder($uriBuilder);
                $flashMessageContainer = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\FlashMessageContainer');
index 3a523e1..1433eec 100644 (file)
@@ -97,7 +97,7 @@ class TemplateView extends \TYPO3\CMS\Fluid\View\AbstractTemplateView {
        public function __construct() {
                $this->injectTemplateParser(\TYPO3\CMS\Fluid\Compatibility\TemplateParserBuilder::build());
                $this->injectObjectManager(\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager'));
-               $this->setRenderingContext($this->objectManager->create('TYPO3\\CMS\\Fluid\\Core\\Rendering\\RenderingContextInterface'));
+               $this->setRenderingContext($this->objectManager->get('TYPO3\\CMS\\Fluid\\Core\\Rendering\\RenderingContextInterface'));
        }
 
        public function initializeView() {
index 39a7d93..c69f9d8 100644 (file)
@@ -125,8 +125,8 @@ class TemplateParserTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockState->expects($this->once())->method('pushNodeToStack')->with($mockRootNode);
                $mockState->expects($this->once())->method('countNodeStack')->will($this->returnValue(1));
                $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
-               $mockObjectManager->expects($this->at(0))->method('create')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState')->will($this->returnValue($mockState));
-               $mockObjectManager->expects($this->at(1))->method('create')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode')->will($this->returnValue($mockRootNode));
+               $mockObjectManager->expects($this->at(0))->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState')->will($this->returnValue($mockState));
+               $mockObjectManager->expects($this->at(1))->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode')->will($this->returnValue($mockRootNode));
                $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('dummy'));
                $templateParser->injectObjectManager($mockObjectManager);
                $templateParser->_call('buildObjectTree', array());
@@ -141,8 +141,8 @@ class TemplateParserTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockState = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState');
                $mockState->expects($this->once())->method('countNodeStack')->will($this->returnValue(2));
                $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
-               $mockObjectManager->expects($this->at(0))->method('create')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState')->will($this->returnValue($mockState));
-               $mockObjectManager->expects($this->at(1))->method('create')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode')->will($this->returnValue($mockRootNode));
+               $mockObjectManager->expects($this->at(0))->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState')->will($this->returnValue($mockState));
+               $mockObjectManager->expects($this->at(1))->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode')->will($this->returnValue($mockRootNode));
                $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('dummy'));
                $templateParser->injectObjectManager($mockObjectManager);
                $templateParser->_call('buildObjectTree', array());
@@ -156,8 +156,8 @@ class TemplateParserTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockState = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState');
                $mockState->expects($this->once())->method('countNodeStack')->will($this->returnValue(1));
                $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
-               $mockObjectManager->expects($this->at(0))->method('create')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState')->will($this->returnValue($mockState));
-               $mockObjectManager->expects($this->at(1))->method('create')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode')->will($this->returnValue($mockRootNode));
+               $mockObjectManager->expects($this->at(0))->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState')->will($this->returnValue($mockState));
+               $mockObjectManager->expects($this->at(1))->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode')->will($this->returnValue($mockRootNode));
                $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('textHandler', 'openingViewHelperTagHandler', 'closingViewHelperTagHandler', 'textAndShorthandSyntaxHandler'));
                $templateParser->injectObjectManager($mockObjectManager);
                $templateParser->expects($this->at(0))->method('textAndShorthandSyntaxHandler')->with($mockState, 'The first part is simple');
@@ -202,7 +202,7 @@ class TemplateParserTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockNodeOnStack->expects($this->once())->method('addChildNode')->with($mockViewHelperNode);
                $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
                $mockObjectManager->expects($this->at(0))->method('get')->with('TYPO3\CMS\Fluid\ViewHelpers\MyownViewHelper')->will($this->returnValue($mockViewHelper));
-               $mockObjectManager->expects($this->at(1))->method('create')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ViewHelperNode')->will($this->returnValue($mockViewHelperNode));
+               $mockObjectManager->expects($this->at(1))->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ViewHelperNode')->will($this->returnValue($mockViewHelperNode));
                $mockState = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState');
                $mockState->expects($this->once())->method('getNodeFromStack')->will($this->returnValue($mockNodeOnStack));
                $mockState->expects($this->once())->method('pushNodeToStack')->with($mockViewHelperNode);
@@ -223,7 +223,7 @@ class TemplateParserTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockNodeOnStack = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\NodeInterface');
                $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
                $mockObjectManager->expects($this->at(0))->method('get')->with('TYPO3\CMS\Fluid\ViewHelpers\MyownViewHelper')->will($this->returnValue($mockViewHelper));
-               $mockObjectManager->expects($this->at(1))->method('create')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ViewHelperNode')->will($this->returnValue($mockViewHelperNode));
+               $mockObjectManager->expects($this->at(1))->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ViewHelperNode')->will($this->returnValue($mockViewHelperNode));
                $mockState = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState');
                $mockState->expects($this->once())->method('getNodeFromStack')->will($this->returnValue($mockNodeOnStack));
                $templateParser = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser', array('abortIfUnregisteredArgumentsExist', 'abortIfRequiredArgumentsAreMissing', 'rewriteBooleanNodesInArgumentsObjectTree'));
@@ -243,7 +243,7 @@ class TemplateParserTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockNodeOnStack->expects($this->once())->method('addChildNode')->with($mockViewHelperNode);
                $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
                $mockObjectManager->expects($this->at(0))->method('get')->with('TYPO3\CMS\Fluid\ViewHelpers\MyownViewHelper')->will($this->returnValue($mockViewHelper));
-               $mockObjectManager->expects($this->at(1))->method('create')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ViewHelperNode')->will($this->returnValue($mockViewHelperNode));
+               $mockObjectManager->expects($this->at(1))->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ViewHelperNode')->will($this->returnValue($mockViewHelperNode));
                $mockState = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState');
                $mockState->expects($this->once())->method('getNodeFromStack')->will($this->returnValue($mockNodeOnStack));
                $mockState->expects($this->once())->method('getVariableContainer')->will($this->returnValue($this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TemplateVariableContainer')));
@@ -351,7 +351,7 @@ class TemplateParserTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        public function objectAccessorHandlerCreatesObjectAccessorNodeWithExpectedValueAndAddsItToStack() {
                $objectAccessorNode = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ObjectAccessorNode', array(), array(), '', FALSE);
                $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
-               $mockObjectManager->expects($this->once())->method('create')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ObjectAccessorNode', 'objectAccessorString')->will($this->returnValue($objectAccessorNode));
+               $mockObjectManager->expects($this->once())->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ObjectAccessorNode', 'objectAccessorString')->will($this->returnValue($objectAccessorNode));
                $mockNodeOnStack = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\AbstractNode', array(), array(), '', FALSE);
                $mockNodeOnStack->expects($this->once())->method('addChildNode')->with($objectAccessorNode);
                $mockState = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState');
@@ -371,7 +371,7 @@ class TemplateParserTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $parserConfiguration = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\Configuration');
                $parserConfiguration->expects($this->once())->method('getInterceptors')->with(\TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface::INTERCEPT_OBJECTACCESSOR)->will($this->returnValue(array($objectAccessorNodeInterceptor)));
                $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
-               $mockObjectManager->expects($this->once())->method('create')->will($this->returnValue($objectAccessorNode));
+               $mockObjectManager->expects($this->once())->method('get')->will($this->returnValue($objectAccessorNode));
                $mockNodeOnStack = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\AbstractNode', array(), array(), '', FALSE);
                $mockState = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState');
                $mockState->expects($this->once())->method('getNodeFromStack')->will($this->returnValue($mockNodeOnStack));
@@ -407,7 +407,7 @@ class TemplateParserTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
         */
        public function buildArgumentObjectTreeReturnsTextNodeForSimplyString() {
                $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
-               $mockObjectManager->expects($this->once())->method('create')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\TextNode', 'a very plain string')->will($this->returnValue('theTextNode'));
+               $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);
                $this->assertEquals('theTextNode', $templateParser->_call('buildArgumentObjectTree', 'a very plain string'));
@@ -430,7 +430,7 @@ class TemplateParserTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
         */
        public function textAndShorthandSyntaxHandlerDelegatesAppropriately() {
                $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
-               $mockObjectManager->expects($this->any())->method('create')->will($this->returnArgument(1));
+               $mockObjectManager->expects($this->any())->method('get')->will($this->returnArgument(1));
                $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);
@@ -451,7 +451,7 @@ class TemplateParserTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockState = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState');
                $mockState->expects($this->once())->method('getNodeFromStack')->will($this->returnValue($mockNodeOnStack));
                $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
-               $mockObjectManager->expects($this->once())->method('create')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ArrayNode', 'processedArrayText')->will($this->returnValue($arrayNode));
+               $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->expects($this->once())->method('recursiveArrayHandler')->with('arrayText')->will($this->returnValue('processedArrayText'));
@@ -476,7 +476,7 @@ class TemplateParserTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
         */
        public function recursiveArrayHandlerReturnsExpectedArray($arrayText, $expectedArray) {
                $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
-               $mockObjectManager->expects($this->any())->method('create')->will($this->returnArgument(1));
+               $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->expects($this->any())->method('buildArgumentObjectTree')->will($this->returnArgument(0));
@@ -493,7 +493,7 @@ class TemplateParserTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $parserConfiguration = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\Configuration');
                $parserConfiguration->expects($this->once())->method('getInterceptors')->with(\TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface::INTERCEPT_TEXT)->will($this->returnValue(array($textInterceptor)));
                $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
-               $mockObjectManager->expects($this->once())->method('create')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\TextNode', 'string')->will($this->returnValue($textNode));
+               $mockObjectManager->expects($this->once())->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\TextNode', 'string')->will($this->returnValue($textNode));
                $mockNodeOnStack = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\AbstractNode', array(), array(), '', FALSE);
                $mockNodeOnStack->expects($this->once())->method('addChildNode')->with($textNode);
                $mockState = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsingState');
index c3b15e4..1b56c40 100644 (file)
@@ -46,7 +46,7 @@ class AbstractWidgetControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTes
                $abstractWidgetController = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\AbstractWidgetController', array('resolveActionMethodName', 'initializeActionMethodArguments', 'initializeActionMethodValidators', 'initializeAction', 'checkRequestHash', 'mapRequestArgumentsToControllerArguments', 'buildControllerContext', 'resolveView', 'callActionMethod'), array(), '', FALSE);
                $mockUriBuilder = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder');
                $objectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
-               $objectManager->expects($this->any())->method('create')->with('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder')->will($this->returnValue($mockUriBuilder));
+               $objectManager->expects($this->any())->method('get')->with('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder')->will($this->returnValue($mockUriBuilder));
 
                $configurationService = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\MvcPropertyMappingConfigurationService');
                $abstractWidgetController->injectMvcPropertyMappingConfigurationService($configurationService);
index 9f218e2..d5b2554 100644 (file)
@@ -71,7 +71,7 @@ class AbstractWidgetViewHelperTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTes
                $this->viewHelper->injectAjaxWidgetContextHolder($this->ajaxWidgetContextHolder);
                $this->widgetContext = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetContext');
                $this->objectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
-               $this->objectManager->expects($this->at(0))->method('create')->with('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetContext')->will($this->returnValue($this->widgetContext));
+               $this->objectManager->expects($this->at(0))->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetContext')->will($this->returnValue($this->widgetContext));
                $this->viewHelper->injectObjectManager($this->objectManager);
                $this->request = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request');
                $this->controllerContext = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ControllerContext', array(), array(), '', FALSE);
@@ -128,7 +128,7 @@ class AbstractWidgetViewHelperTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTes
                $rootNode->expects($this->at(0))->method('addChildNode')->with($node1);
                $rootNode->expects($this->at(1))->method('addChildNode')->with($node2);
                $rootNode->expects($this->at(2))->method('addChildNode')->with($node3);
-               $this->objectManager->expects($this->once())->method('create')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode')->will($this->returnValue($rootNode));
+               $this->objectManager->expects($this->once())->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode')->will($this->returnValue($rootNode));
                $renderingContext = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Rendering\\RenderingContextInterface');
                $this->viewHelper->_set('renderingContext', $renderingContext);
                $this->widgetContext->expects($this->once())->method('setViewHelperChildNodes')->with($rootNode, $renderingContext);
@@ -154,8 +154,8 @@ class AbstractWidgetViewHelperTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTes
                // Initial Setup
                $widgetRequest = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequest');
                $response = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Response');
-               $this->objectManager->expects($this->at(0))->method('create')->with('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequest')->will($this->returnValue($widgetRequest));
-               $this->objectManager->expects($this->at(1))->method('create')->with('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Response')->will($this->returnValue($response));
+               $this->objectManager->expects($this->at(0))->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequest')->will($this->returnValue($widgetRequest));
+               $this->objectManager->expects($this->at(1))->method('get')->with('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Response')->will($this->returnValue($response));
                // Widget Context is set
                $widgetRequest->expects($this->once())->method('setWidgetContext')->with($this->widgetContext);
                // The namespaced arguments are passed to the sub-request
index 0cecde5..a132a94 100644 (file)
@@ -72,7 +72,7 @@ class WidgetRequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCas
                $this->widgetRequestBuilder = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequestBuilder', array('setArgumentsFromRawRequestData'));
                $this->mockWidgetRequest = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequest');
                $this->mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
-               $this->mockObjectManager->expects($this->once())->method('create')->with('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequest')->will($this->returnValue($this->mockWidgetRequest));
+               $this->mockObjectManager->expects($this->once())->method('get')->with('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequest')->will($this->returnValue($this->mockWidgetRequest));
                $this->widgetRequestBuilder->_set('objectManager', $this->mockObjectManager);
                $this->mockWidgetContext = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetContext');
                $this->mockAjaxWidgetContextHolder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\AjaxWidgetContextHolder');
index 2a9aec9..147bcfb 100644 (file)
@@ -108,7 +108,6 @@ class StandaloneViewTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
                $this->mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
                $this->mockObjectManager->expects($this->any())->method('get')->will($this->returnCallback(array($this, 'objectManagerCallback')));
-               $this->mockObjectManager->expects($this->any())->method('create')->will($this->returnCallback(array($this, 'objectManagerCallback')));
                $this->mockRequest = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request');
                $this->mockUriBuilder = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder');
                $this->mockFlashMessageContainer = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\FlashMessageContainer');