Revert "[TASK] Replace inject methods with @inject; allow @Flow\Inject" 04/22004/2
authorMarc Bastian Heinrichs <typo3@mbh-software.de>
Sat, 6 Jul 2013 11:22:16 +0000 (13:22 +0200)
committerMarc Bastian Heinrichs <typo3@mbh-software.de>
Sat, 6 Jul 2013 11:24:15 +0000 (13:24 +0200)
This reverts commit ad7219c2818455edd65918b9a5f8d1b70c0afed7

See https://review.typo3.org/#/c/21997/

More notes on this:
A regex to replace @inject with @Flow\Inject when porting
Extbase extensions to Flow is very simple and fast.

Additionally @Flow\Inject makes only sense with using "use
TYPO3\Flow\Annotations as Flow". But with a backported
annotation parser I expect that we would have annotations
in "TYPO3\CMS\Extbase\Annotations". Using them as alias
"Flow" is a bad style as the alias should be "Extbase" then.

Change-Id: I2113b5320f2a6f5dd56cfa7b06469fa1628d2645
Reviewed-on: https://review.typo3.org/22004
Reviewed-by: Marc Bastian Heinrichs
Tested-by: Marc Bastian Heinrichs
84 files changed:
typo3/sysext/extbase/Classes/Command/HelpCommandController.php
typo3/sysext/extbase/Classes/Configuration/AbstractConfigurationManager.php
typo3/sysext/extbase/Classes/Configuration/BackendConfigurationManager.php
typo3/sysext/extbase/Classes/Configuration/ConfigurationManager.php
typo3/sysext/extbase/Classes/Configuration/FrontendConfigurationManager.php
typo3/sysext/extbase/Classes/Mvc/Cli/Command.php
typo3/sysext/extbase/Classes/Mvc/Cli/CommandManager.php
typo3/sysext/extbase/Classes/Mvc/Cli/Request.php
typo3/sysext/extbase/Classes/Mvc/Cli/RequestBuilder.php
typo3/sysext/extbase/Classes/Mvc/Cli/RequestHandler.php
typo3/sysext/extbase/Classes/Mvc/Controller/AbstractController.php
typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php
typo3/sysext/extbase/Classes/Mvc/Controller/Argument.php
typo3/sysext/extbase/Classes/Mvc/Controller/Arguments.php
typo3/sysext/extbase/Classes/Mvc/Controller/CommandController.php
typo3/sysext/extbase/Classes/Mvc/Controller/ControllerContext.php
typo3/sysext/extbase/Classes/Mvc/Controller/MvcPropertyMappingConfigurationService.php
typo3/sysext/extbase/Classes/Mvc/Dispatcher.php
typo3/sysext/extbase/Classes/Mvc/RequestHandlerResolver.php
typo3/sysext/extbase/Classes/Mvc/Web/AbstractRequestHandler.php
typo3/sysext/extbase/Classes/Mvc/Web/FrontendRequestHandler.php
typo3/sysext/extbase/Classes/Mvc/Web/Request.php
typo3/sysext/extbase/Classes/Mvc/Web/RequestBuilder.php
typo3/sysext/extbase/Classes/Mvc/Web/Response.php
typo3/sysext/extbase/Classes/Mvc/Web/Routing/UriBuilder.php
typo3/sysext/extbase/Classes/Object/Container/ClassInfoFactory.php
typo3/sysext/extbase/Classes/Object/Container/Container.php
typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php
typo3/sysext/extbase/Classes/Persistence/Generic/IdentityMap.php
typo3/sysext/extbase/Classes/Persistence/Generic/LazyLoadingProxy.php
typo3/sysext/extbase/Classes/Persistence/Generic/LazyObjectStorage.php
typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapFactory.php
typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapper.php
typo3/sysext/extbase/Classes/Persistence/Generic/PersistenceManager.php
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/QueryObjectModelFactory.php
typo3/sysext/extbase/Classes/Persistence/Generic/Query.php
typo3/sysext/extbase/Classes/Persistence/Generic/QueryFactory.php
typo3/sysext/extbase/Classes/Persistence/Generic/QueryResult.php
typo3/sysext/extbase/Classes/Persistence/Generic/Session.php
typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbBackend.php
typo3/sysext/extbase/Classes/Persistence/Repository.php
typo3/sysext/extbase/Classes/Property/Mapper.php
typo3/sysext/extbase/Classes/Property/PropertyMapper.php
typo3/sysext/extbase/Classes/Property/TypeConverter/AbstractFileCollectionConverter.php
typo3/sysext/extbase/Classes/Property/TypeConverter/AbstractFileFolderConverter.php
typo3/sysext/extbase/Classes/Property/TypeConverter/AbstractTypeConverter.php
typo3/sysext/extbase/Classes/Reflection/ClassSchema.php
typo3/sysext/extbase/Classes/Reflection/ReflectionService.php
typo3/sysext/extbase/Classes/Scheduler/TaskExecutor.php
typo3/sysext/extbase/Classes/Security/Channel/RequestHashService.php
typo3/sysext/extbase/Classes/Service/ExtensionService.php
typo3/sysext/extbase/Classes/Validation/ValidatorResolver.php
typo3/sysext/extbase/Tests/Unit/Configuration/AbstractConfigurationManagerTest.php
typo3/sysext/extbase/Tests/Unit/Configuration/BackendConfigurationManagerTest.php
typo3/sysext/extbase/Tests/Unit/Configuration/FrontendConfigurationManagerTest.php
typo3/sysext/extbase/Tests/Unit/Core/BootstrapTest.php
typo3/sysext/extbase/Tests/Unit/Mvc/Cli/CommandManagerTest.php
typo3/sysext/extbase/Tests/Unit/Mvc/Cli/CommandTest.php
typo3/sysext/extbase/Tests/Unit/Mvc/Cli/RequestBuilderTest.php
typo3/sysext/extbase/Tests/Unit/Mvc/Cli/RequestTest.php
typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ActionControllerTest.php
typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ArgumentBehaviorBeforeExtbase14Test.php
typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ArgumentTest.php
typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ArgumentsTest.php
typo3/sysext/extbase/Tests/Unit/Mvc/Controller/MvcPropertyMappingConfigurationServiceTest.php
typo3/sysext/extbase/Tests/Unit/Mvc/Web/RequestBuilderTest.php
typo3/sysext/extbase/Tests/Unit/Mvc/Web/Routing/UriBuilderTest.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Mapper/DataMapFactoryTest.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Mapper/DataMapperTest.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/PersistenceManagerTest.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/QueryFactoryTest.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/QueryResultTest.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/QueryTest.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Storage/Typo3DbBackendTest.php
typo3/sysext/extbase/Tests/Unit/Persistence/RepositoryTest.php
typo3/sysext/extbase/Tests/Unit/Property/MapperTest.php
typo3/sysext/extbase/Tests/Unit/Reflection/ReflectionServiceTest.php
typo3/sysext/extbase/Tests/Unit/Scheduler/FieldProviderTest.php
typo3/sysext/extbase/Tests/Unit/Scheduler/TaskExecuterTest.php
typo3/sysext/extbase/Tests/Unit/Service/ExtensionServiceTest.php
typo3/sysext/extbase/Tests/Unit/Validation/ValidatorResolverTest.php
typo3/sysext/fluid/Tests/Unit/Core/Widget/AbstractWidgetControllerTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/FormViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/ViewHelperBaseTestcase.php

index 5702a89..1d6c1bf 100644 (file)
@@ -36,7 +36,6 @@ class HelpCommandController extends \TYPO3\CMS\Extbase\Mvc\Controller\CommandCon
 
        /**
         * @var \TYPO3\CMS\Extbase\Mvc\Cli\CommandManager
-        * @inject
         */
        protected $commandManager;
 
@@ -46,6 +45,14 @@ class HelpCommandController extends \TYPO3\CMS\Extbase\Mvc\Controller\CommandCon
        protected $commandsByExtensionsAndControllers = array();
 
        /**
+        * @param \TYPO3\CMS\Extbase\Mvc\Cli\CommandManager $commandManager
+        * @return void
+        */
+       public function injectCommandManager(\TYPO3\CMS\Extbase\Mvc\Cli\CommandManager $commandManager) {
+               $this->commandManager = $commandManager;
+       }
+
+       /**
         * Displays a short, general help message
         *
         * This only outputs the Extbase version number, context and some hint about how to
index b50c523..606f410 100755 (executable)
@@ -51,13 +51,11 @@ abstract class AbstractConfigurationManager implements \TYPO3\CMS\Core\Singleton
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-        * @inject
         */
        protected $objectManager;
 
        /**
         * @var \TYPO3\CMS\Extbase\Service\TypoScriptService
-        * @inject
         */
        protected $typoScriptService;
 
@@ -84,11 +82,34 @@ abstract class AbstractConfigurationManager implements \TYPO3\CMS\Core\Singleton
 
        /**
         * @var \TYPO3\CMS\Extbase\Service\EnvironmentService
-        * @inject
         */
        protected $environmentService;
 
        /**
+        * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
+        * @return void
+        */
+       public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
+               $this->objectManager = $objectManager;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Extbase\Service\TypoScriptService $typoScriptService
+        * @return void
+        */
+       public function injectTypoScriptService(\TYPO3\CMS\Extbase\Service\TypoScriptService $typoScriptService) {
+               $this->typoScriptService = $typoScriptService;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Extbase\Service\EnvironmentService $environmentService
+        * @return void
+        */
+       public function injectEnvironmentService(\TYPO3\CMS\Extbase\Service\EnvironmentService $environmentService) {
+               $this->environmentService = $environmentService;
+       }
+
+       /**
         * @param \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $contentObject
         * @return void
         */
index bf8f926..1876812 100644 (file)
@@ -33,14 +33,20 @@ namespace TYPO3\CMS\Extbase\Configuration;
 class BackendConfigurationManager extends \TYPO3\CMS\Extbase\Configuration\AbstractConfigurationManager {
 
        /**
-        * Needed to recursively fetch a page tree
-        *
-        * @var \TYPO3\CMS\Core\Database\QueryGenerator
-        * @inject
+        * @var \TYPO3\CMS\Core\Database\QueryGenerator Needed to recursively fetch a page tree
         */
        protected $queryGenerator;
 
        /**
+        * Inject query generator
+        *
+        * @param \TYPO3\CMS\Core\Database\QueryGenerator $queryGenerator
+        */
+       public function injectQueryGenerator(\TYPO3\CMS\Core\Database\QueryGenerator $queryGenerator) {
+               $this->queryGenerator = $queryGenerator;
+       }
+
+       /**
         * @var array
         */
        protected $typoScriptSetupCache = array();
index 1325b55..bb9e913 100644 (file)
@@ -37,7 +37,6 @@ class ConfigurationManager implements \TYPO3\CMS\Extbase\Configuration\Configura
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-        * @inject
         */
        protected $objectManager;
 
@@ -48,11 +47,26 @@ class ConfigurationManager implements \TYPO3\CMS\Extbase\Configuration\Configura
 
        /**
         * @var \TYPO3\CMS\Extbase\Service\EnvironmentService
-        * @inject
         */
        protected $environmentService;
 
        /**
+        * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
+        * @return void
+        */
+       public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
+               $this->objectManager = $objectManager;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Extbase\Service\EnvironmentService $environmentService
+        * @return void
+        */
+       public function injectEnvironmentService(\TYPO3\CMS\Extbase\Service\EnvironmentService $environmentService) {
+               $this->environmentService = $environmentService;
+       }
+
+       /**
         * Initializes the object
         *
         * @return void
index debded9..30f471b 100644 (file)
@@ -36,11 +36,18 @@ class FrontendConfigurationManager extends \TYPO3\CMS\Extbase\Configuration\Abst
 
        /**
         * @var \TYPO3\CMS\Extbase\Service\FlexFormService
-        * @inject
         */
        protected $flexFormService;
 
        /**
+        * @param \TYPO3\CMS\Extbase\Service\FlexFormService $flexFormService
+        * @return void
+        */
+       public function injectFlexFormService(\TYPO3\CMS\Extbase\Service\FlexFormService $flexFormService) {
+               $this->flexFormService = $flexFormService;
+       }
+
+       /**
         * Returns TypoScript Setup array from current Environment.
         *
         * @return array the raw TypoScript setup
index 52867be..882db52 100644 (file)
@@ -36,7 +36,6 @@ class Command {
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-        * @inject
         */
        protected $objectManager;
 
@@ -64,9 +63,8 @@ class Command {
         * Reflection service
         *
         * @var \TYPO3\CMS\Extbase\Reflection\ReflectionService
-        * @inject
         */
-       protected $reflectionService;
+       private $reflectionService;
 
        /**
         * Constructor
@@ -93,6 +91,21 @@ class Command {
        }
 
        /**
+        * @param \TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService Reflection service
+        */
+       public function injectReflectionService(\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService) {
+               $this->reflectionService = $reflectionService;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager A reference to the object manager
+        * @return void
+        */
+       public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
+               $this->objectManager = $objectManager;
+       }
+
+       /**
         * @return string
         */
        public function getControllerClassName() {
index ca0ec8d..4af59e0 100644 (file)
@@ -33,7 +33,6 @@ class CommandManager implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-        * @inject
         */
        protected $objectManager;
 
@@ -48,6 +47,14 @@ class CommandManager implements \TYPO3\CMS\Core\SingletonInterface {
        protected $shortCommandIdentifiers = NULL;
 
        /**
+        * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager A reference to the object manager
+        * @return void
+        */
+       public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
+               $this->objectManager = $objectManager;
+       }
+
+       /**
         * Returns an array of all commands
         *
         * @return array<\TYPO3\CMS\Extbase\Mvc\Cli\Command>
index 06ae906..a31bbce 100644 (file)
@@ -34,7 +34,6 @@ class Request implements \TYPO3\CMS\Extbase\Mvc\RequestInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-        * @inject
         */
        protected $objectManager;
 
@@ -83,6 +82,14 @@ class Request implements \TYPO3\CMS\Extbase\Mvc\RequestInterface {
        protected $command = NULL;
 
        /**
+        * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager A reference to the object manager
+        * @return void
+        */
+       public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
+               $this->objectManager = $objectManager;
+       }
+
+       /**
         * Sets the dispatched flag
         *
         * @param boolean $flag If this request has been dispatched
index b3528bf..31631fc 100644 (file)
@@ -33,23 +33,44 @@ class RequestBuilder {
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-        * @inject
         */
        protected $objectManager;
 
        /**
         * @var \TYPO3\CMS\Extbase\Reflection\ReflectionService
-        * @inject
         */
        protected $reflectionService;
 
        /**
         * @var \TYPO3\CMS\Extbase\Mvc\Cli\CommandManager
-        * @inject
         */
        protected $commandManager;
 
        /**
+        * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
+        * @return void
+        */
+       public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
+               $this->objectManager = $objectManager;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService
+        * @return void
+        */
+       public function injectReflectionService(\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService) {
+               $this->reflectionService = $reflectionService;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Extbase\Mvc\Cli\CommandManager $commandManager
+        * @return void
+        */
+       public function injectCommandManager(\TYPO3\CMS\Extbase\Mvc\Cli\CommandManager $commandManager) {
+               $this->commandManager = $commandManager;
+       }
+
+       /**
         * Builds a CLI request object from a command line.
         *
         * The given command line may be a string (e.g. "myextension:foo do-that-thing --force") or
index 96011a3..b023c6b 100644 (file)
@@ -33,29 +33,57 @@ class RequestHandler implements \TYPO3\CMS\Extbase\Mvc\RequestHandlerInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-        * @inject
         */
        protected $objectManager;
 
        /**
         * @var \TYPO3\CMS\Extbase\Mvc\Dispatcher
-        * @inject
         */
        protected $dispatcher;
 
        /**
         * @var \TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder
-        * @inject
         */
        protected $requestBuilder;
 
        /**
         * @var \TYPO3\CMS\Extbase\Service\EnvironmentService
-        * @inject
         */
        protected $environmentService;
 
        /**
+        * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
+        * @return void
+        */
+       public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
+               $this->objectManager = $objectManager;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Extbase\Mvc\Dispatcher $dispatcher
+        * @return void
+        */
+       public function injectDispatcher(\TYPO3\CMS\Extbase\Mvc\Dispatcher $dispatcher) {
+               $this->dispatcher = $dispatcher;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder $requestBuilder
+        * @return void
+        */
+       public function injectRequestBuilder(\TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder $requestBuilder) {
+               $this->requestBuilder = $requestBuilder;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Extbase\Service\EnvironmentService $environmentService
+        * @return void
+        */
+       public function injectEnvironmentService(\TYPO3\CMS\Extbase\Service\EnvironmentService $environmentService) {
+               $this->environmentService = $environmentService;
+       }
+
+       /**
         * Handles the request
         *
         * @return void
index 20d2789..87f75ab 100644 (file)
@@ -36,7 +36,6 @@ abstract class AbstractController implements \TYPO3\CMS\Extbase\Mvc\Controller\C
 
        /**
         * @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher
-        * @inject
         */
        protected $signalSlotDispatcher;
 
@@ -82,13 +81,11 @@ abstract class AbstractController implements \TYPO3\CMS\Extbase\Mvc\Controller\C
        /**
         * @var \TYPO3\CMS\Extbase\Property\Mapper
         * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
-        * @inject
         */
        protected $deprecatedPropertyMapper;
 
        /**
         * @var \TYPO3\CMS\Extbase\Validation\ValidatorResolver
-        * @inject
         */
        protected $validatorResolver;
 
@@ -168,6 +165,17 @@ abstract class AbstractController implements \TYPO3\CMS\Extbase\Mvc\Controller\C
        }
 
        /**
+        * Injects the property mapper
+        *
+        * @param \TYPO3\CMS\Extbase\Property\Mapper $deprecatedPropertyMapper The property mapper
+        * @return void
+        * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
+        */
+       public function injectDeprecatedPropertyMapper(\TYPO3\CMS\Extbase\Property\Mapper $deprecatedPropertyMapper) {
+               $this->deprecatedPropertyMapper = $deprecatedPropertyMapper;
+       }
+
+       /**
         * Injects the object manager
         *
         * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
@@ -179,6 +187,16 @@ abstract class AbstractController implements \TYPO3\CMS\Extbase\Mvc\Controller\C
        }
 
        /**
+        * Injects the validator resolver
+        *
+        * @param \TYPO3\CMS\Extbase\Validation\ValidatorResolver $validatorResolver
+        * @return void
+        */
+       public function injectValidatorResolver(\TYPO3\CMS\Extbase\Validation\ValidatorResolver $validatorResolver) {
+               $this->validatorResolver = $validatorResolver;
+       }
+
+       /**
         * This method is deprecated! For further information have a look at
         * the PhpDoc of class \TYPO3\CMS\Extbase\Mvc\Controller\FlashMessageContainer
         *
@@ -192,6 +210,15 @@ abstract class AbstractController implements \TYPO3\CMS\Extbase\Mvc\Controller\C
        }
 
        /**
+        * Injects the signal slot dispatcher
+        *
+        * @param \TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher
+        */
+       public function injectSignalSlotDispatcher(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher) {
+               $this->signalSlotDispatcher = $signalSlotDispatcher;
+       }
+
+       /**
         * Checks if the current request type is supported by the controller.
         *
         * If your controller only supports certain request types, either
index fc8b8a8..b2382b2 100644 (file)
@@ -36,13 +36,11 @@ class ActionController extends \TYPO3\CMS\Extbase\Mvc\Controller\AbstractControl
 
        /**
         * @var \TYPO3\CMS\Extbase\Reflection\ReflectionService
-        * @inject
         */
        protected $reflectionService;
 
        /**
         * @var \TYPO3\CMS\Extbase\Service\CacheService
-        * @inject
         */
        protected $cacheService;
 
@@ -108,12 +106,34 @@ class ActionController extends \TYPO3\CMS\Extbase\Mvc\Controller\AbstractControl
 
        /**
         * @var \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService
-        * @inject
         * @api
         */
        protected $mvcPropertyMappingConfigurationService;
 
        /**
+        * @param \TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService
+        * @return void
+        */
+       public function injectReflectionService(\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService) {
+               $this->reflectionService = $reflectionService;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Extbase\Service\CacheService $cacheService
+        * @return void
+        */
+       public function injectCacheService(\TYPO3\CMS\Extbase\Service\CacheService $cacheService) {
+               $this->cacheService = $cacheService;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService $mvcPropertyMappingConfigurationService
+        */
+       public function injectMvcPropertyMappingConfigurationService(\TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService $mvcPropertyMappingConfigurationService) {
+               $this->mvcPropertyMappingConfigurationService = $mvcPropertyMappingConfigurationService;
+       }
+
+       /**
         * Checks if the current request type is supported by the controller.
         *
         * If your controller only supports certain request types, either
index 3d67bdb..be49f8e 100644 (file)
@@ -36,25 +36,21 @@ class Argument {
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-        * @inject
         */
        protected $objectManager;
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\Generic\QueryFactory
-        * @inject
         */
        protected $queryFactory;
 
        /**
         * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
-        * @inject
         */
        protected $configurationManager;
 
        /**
         * This is the old property mapper, which has been completely rewritten for 1.4.
-        * @inject
         *
         * @var \TYPO3\CMS\Extbase\Property\Mapper
         */
@@ -64,13 +60,11 @@ class Argument {
         * The new, completely rewritten property mapper since Extbase 1.4.
         *
         * @var \TYPO3\CMS\Extbase\Property\PropertyMapper
-        * @inject
         */
        protected $propertyMapper;
 
        /**
         * @var \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfiguration
-        * @inject
         */
        protected $propertyMappingConfiguration;
 
@@ -170,7 +164,6 @@ class Argument {
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface
-        * @inject
         */
        protected $persistenceManager;
 
@@ -194,6 +187,32 @@ class Argument {
        }
 
        /**
+        * 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;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Extbase\Property\Mapper $deprecatedPropertyMapper
+        * @return void
+        */
+       public function injectDeprecatedPropertyMapper(\TYPO3\CMS\Extbase\Property\Mapper $deprecatedPropertyMapper) {
+               $this->deprecatedPropertyMapper = $deprecatedPropertyMapper;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Extbase\Property\PropertyMapper $propertyMapper
+        * @return void
+        */
+       public function injectPropertyMapper(\TYPO3\CMS\Extbase\Property\PropertyMapper $propertyMapper) {
+               $this->propertyMapper = $propertyMapper;
+       }
+
+       /**
         * @param \TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService
         * @return void
         */
@@ -204,6 +223,34 @@ class Argument {
        }
 
        /**
+        * 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;
+       }
+
+       /**
+        * Injects a QueryFactory instance
+        *
+        * @param \TYPO3\CMS\Extbase\Persistence\Generic\QueryFactoryInterface $queryFactory
+        * @return void
+        */
+       public function injectQueryFactory(\TYPO3\CMS\Extbase\Persistence\Generic\QueryFactoryInterface $queryFactory) {
+               $this->queryFactory = $queryFactory;
+       }
+
+       /**
+        * @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\Service\TypeHandlingService $typeHandlingService
         * @return void
         */
@@ -213,6 +260,14 @@ class Argument {
        }
 
        /**
+        * @param \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfiguration $mvcPropertyMappingConfiguration
+        * @return void
+        */
+       public function injectPropertyMappingConfiguration(\TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfiguration $mvcPropertyMappingConfiguration) {
+               $this->propertyMappingConfiguration = $mvcPropertyMappingConfiguration;
+       }
+
+       /**
         * Returns the name of this argument
         *
         * @return string This argument's name
index 2ebd233..ca5a4de 100644 (file)
@@ -34,7 +34,6 @@ class Arguments extends \ArrayObject {
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-        * @inject
         */
        protected $objectManager;
 
@@ -56,6 +55,16 @@ class Arguments extends \ArrayObject {
        }
 
        /**
+        * 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;
+       }
+
+       /**
         * Adds or replaces the argument specified by $value. The argument's name is taken from the
         * argument object itself, therefore the $offset does not have any meaning in this context.
         *
index daab2b3..b553d58 100644 (file)
@@ -57,7 +57,6 @@ class CommandController implements \TYPO3\CMS\Extbase\Mvc\Controller\CommandCont
 
        /**
         * @var \TYPO3\CMS\Extbase\Reflection\ReflectionService
-        * @inject
         */
        protected $reflectionService;
 
@@ -67,6 +66,14 @@ class CommandController implements \TYPO3\CMS\Extbase\Mvc\Controller\CommandCont
        protected $objectManager;
 
        /**
+        * @param \TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService
+        * @return void
+        */
+       public function injectReflectionService(\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService) {
+               $this->reflectionService = $reflectionService;
+       }
+
+       /**
         * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
         * @return void
         */
index af54621..643bb46 100644 (file)
@@ -73,23 +73,41 @@ class ControllerContext {
 
        /**
         * @var \TYPO3\CMS\Core\Messaging\FlashMessageService
-        * @inject
         */
        protected $flashMessageService;
 
        /**
+        * @param \TYPO3\CMS\Core\Messaging\FlashMessageService $flashMessageService
+        */
+       public function injectFlashMessageService(\TYPO3\CMS\Core\Messaging\FlashMessageService $flashMessageService) {
+               $this->flashMessageService = $flashMessageService;
+       }
+
+       /**
         * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
-        * @inject
         */
        protected $configurationManager;
 
        /**
+        * @param \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager
+        */
+       public function injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager) {
+               $this->configurationManager = $configurationManager;
+       }
+
+       /**
         * @var \TYPO3\CMS\Extbase\Service\ExtensionService
-        * @inject
         */
        protected $extensionService;
 
        /**
+        * @param \TYPO3\CMS\Extbase\Service\ExtensionService $extensionService
+        */
+       public function injectExtensionService(\TYPO3\CMS\Extbase\Service\ExtensionService $extensionService) {
+               $this->extensionService = $extensionService;
+       }
+
+       /**
         * Set the request of the controller
         *
         * @param \TYPO3\CMS\Extbase\Mvc\Request $request
index 487d79b..0c2186b 100644 (file)
@@ -50,11 +50,19 @@ class MvcPropertyMappingConfigurationService implements \TYPO3\CMS\Core\Singleto
         * The hash service class to use
         *
         * @var \TYPO3\CMS\Extbase\Security\Cryptography\HashService
-        * @inject
         */
        protected $hashService;
 
        /**
+        * Inject the hash service
+        *
+        * @param \TYPO3\CMS\Extbase\Security\Cryptography\HashService $hashService
+        */
+       public function injectHashService(\TYPO3\CMS\Extbase\Security\Cryptography\HashService $hashService) {
+               $this->hashService = $hashService;
+       }
+
+       /**
         * Generate a request hash for a list of form fields
         *
         * @param array $formFieldNames Array of form fields
index 35dcc62..99de910 100644 (file)
@@ -40,13 +40,11 @@ class Dispatcher implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Reflection\ReflectionService
-        * @inject
         */
        protected $reflectionService;
 
        /**
         * @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher
-        * @inject
         */
        protected $signalSlotDispatcher;
 
@@ -65,6 +63,25 @@ class Dispatcher implements \TYPO3\CMS\Core\SingletonInterface {
        }
 
        /**
+        * Injects the Reflection Service
+        *
+        * @param \TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService
+        * @return void
+        */
+       public function injectReflectionService(\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService) {
+               $this->reflectionService = $reflectionService;
+       }
+
+       /**
+        * Injects the SignalSlotDispatcher Service
+        *
+        * @param \TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher
+        */
+       public function injectSignalSlotDispatcher(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher) {
+               $this->signalSlotDispatcher = $signalSlotDispatcher;
+       }
+
+       /**
         * Dispatches a request to a controller and initializes the security framework.
         *
         * @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request The request to dispatch
index 98a8d68..fdaeaf1 100644 (file)
@@ -34,23 +34,50 @@ class RequestHandlerResolver {
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-        * @inject
         */
        protected $objectManager;
 
        /**
         * @var \TYPO3\CMS\Extbase\Reflection\ReflectionService
-        * @inject
         */
        protected $reflectionService;
 
        /**
         * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
-        * @inject
         */
        protected $configurationManager;
 
        /**
+        * Injects the object manager
+        *
+        * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager A reference to the object manager
+        * @return void
+        */
+       public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
+               $this->objectManager = $objectManager;
+       }
+
+       /**
+        * Injects the reflection service
+        *
+        * @param \TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService
+        * @return void
+        */
+       public function injectReflectionService(\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService) {
+               $this->reflectionService = $reflectionService;
+       }
+
+       /**
+        * Injects the configuration manager
+        *
+        * @param \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager
+        * @return void
+        */
+       public function injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager) {
+               $this->configurationManager = $configurationManager;
+       }
+
+       /**
         * Analyzes the raw request and tries to find a request handler which can handle
         * it. If none is found, an exception is thrown.
         *
index 517967d..b353a19 100644 (file)
@@ -34,29 +34,57 @@ abstract class AbstractRequestHandler implements \TYPO3\CMS\Extbase\Mvc\RequestH
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-        * @inject
         */
        protected $objectManager;
 
        /**
         * @var \TYPO3\CMS\Extbase\Mvc\Dispatcher
-        * @inject
         */
        protected $dispatcher;
 
        /**
         * @var \TYPO3\CMS\Extbase\Mvc\Web\RequestBuilder
-        * @inject
         */
        protected $requestBuilder;
 
        /**
         * @var \TYPO3\CMS\Extbase\Service\EnvironmentService
-        * @inject
         */
        protected $environmentService;
 
        /**
+        * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
+        * @return void
+        */
+       public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
+               $this->objectManager = $objectManager;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Extbase\Mvc\Dispatcher $dispatcher
+        * @return void
+        */
+       public function injectDispatcher(\TYPO3\CMS\Extbase\Mvc\Dispatcher $dispatcher) {
+               $this->dispatcher = $dispatcher;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Extbase\Mvc\Web\RequestBuilder $requestBuilder
+        * @return void
+        */
+       public function injectRequestBuilder(\TYPO3\CMS\Extbase\Mvc\Web\RequestBuilder $requestBuilder) {
+               $this->requestBuilder = $requestBuilder;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Extbase\Service\EnvironmentService $environmentService
+        * @return void
+        */
+       public function injectEnvironmentService(\TYPO3\CMS\Extbase\Service\EnvironmentService $environmentService) {
+               $this->environmentService = $environmentService;
+       }
+
+       /**
         * This request handler can handle any web request.
         *
         * @return boolean If the request is a web request, TRUE otherwise FALSE
index 50f4a2f..116c3ed 100644 (file)
@@ -34,17 +34,31 @@ class FrontendRequestHandler extends \TYPO3\CMS\Extbase\Mvc\Web\AbstractRequestH
 
        /**
         * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
-        * @inject
         */
        protected $configurationManager;
 
        /**
         * @var \TYPO3\CMS\Extbase\Service\ExtensionService
-        * @inject
         */
        protected $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\Service\ExtensionService $extensionService
+        * @return void
+        */
+       public function injectExtensionService(\TYPO3\CMS\Extbase\Service\ExtensionService $extensionService) {
+               $this->extensionService = $extensionService;
+       }
+
+       /**
         * Handles the web request. The response will automatically be sent to the client.
         *
         * @return \TYPO3\CMS\Extbase\Mvc\ResponseInterface|NULL
index 35cadb9..73a1ae1 100644 (file)
@@ -36,7 +36,6 @@ class Request extends \TYPO3\CMS\Extbase\Mvc\Request {
 
        /**
         * @var \TYPO3\CMS\Extbase\Security\Cryptography\HashService
-        * @inject
         */
        protected $hashService;
 
@@ -73,17 +72,39 @@ class Request extends \TYPO3\CMS\Extbase\Mvc\Request {
 
        /**
         * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
-        * @inject
         */
        protected $configurationManager;
 
        /**
         * @var \TYPO3\CMS\Extbase\Service\EnvironmentService
-        * @inject
         */
        protected $environmentService;
 
        /**
+        * @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\Configuration\ConfigurationManagerInterface $configurationManager
+        * @return void
+        */
+       public function injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager) {
+               $this->configurationManager = $configurationManager;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Extbase\Service\EnvironmentService $environmentService
+        *
+        * @return void
+        */
+       public function injectEnvironmentService(\TYPO3\CMS\Extbase\Service\EnvironmentService $environmentService) {
+               $this->environmentService = $environmentService;
+       }
+
+       /**
         * Sets the request method
         *
         * @param string $method Name of the request method
index 62e78fd..00e6caf 100644 (file)
@@ -34,7 +34,6 @@ class RequestBuilder implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-        * @inject
         */
        protected $objectManager;
 
@@ -82,23 +81,53 @@ class RequestBuilder implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
-        * @inject
         */
        protected $configurationManager;
 
        /**
         * @var \TYPO3\CMS\Extbase\Service\ExtensionService
-        * @inject
         */
        protected $extensionService;
 
        /**
         * @var \TYPO3\CMS\Extbase\Service\EnvironmentService
-        * @inject
         */
        protected $environmentService;
 
        /**
+        * @param \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager
+        */
+       public function injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager) {
+               $this->configurationManager = $configurationManager;
+       }
+
+       /**
+        * 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;
+       }
+
+       /**
+        * @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\Service\EnvironmentService $environmentService
+        * @return void
+        */
+       public function injectEnvironmentService(\TYPO3\CMS\Extbase\Service\EnvironmentService $environmentService) {
+               $this->environmentService = $environmentService;
+       }
+
+       /**
         * @throws \TYPO3\CMS\Extbase\Mvc\Exception
         * @return void
         */
index ad8943a..67c9de6 100644 (file)
@@ -124,11 +124,19 @@ class Response extends \TYPO3\CMS\Extbase\Mvc\Response {
 
        /**
         * @var \TYPO3\CMS\Extbase\Service\EnvironmentService
-        * @inject
         */
        protected $environmentService;
 
        /**
+        * @param \TYPO3\CMS\Extbase\Service\EnvironmentService $environmentService
+        *
+        * @return void
+        */
+       public function injectEnvironmentService(\TYPO3\CMS\Extbase\Service\EnvironmentService $environmentService) {
+               $this->environmentService = $environmentService;
+       }
+
+       /**
         * Sets the HTTP status code and (optionally) a customized message.
         *
         * @param integer $code The status code
index aab6128..a5efd98 100644 (file)
@@ -22,13 +22,11 @@ class UriBuilder {
 
        /**
         * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
-        * @inject
         */
        protected $configurationManager;
 
        /**
         * @var \TYPO3\CMS\Extbase\Service\ExtensionService
-        * @inject
         */
        protected $extensionService;
 
@@ -118,11 +116,34 @@ class UriBuilder {
 
        /**
         * @var \TYPO3\CMS\Extbase\Service\EnvironmentService
-        * @inject
         */
        protected $environmentService;
 
        /**
+        * @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\Service\ExtensionService $extensionService
+        * @return void
+        */
+       public function injectExtensionService(\TYPO3\CMS\Extbase\Service\ExtensionService $extensionService) {
+               $this->extensionService = $extensionService;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Extbase\Service\EnvironmentService $environmentService
+        * @return void
+        */
+       public function injectEnvironmentService(\TYPO3\CMS\Extbase\Service\EnvironmentService $environmentService) {
+               $this->environmentService = $environmentService;
+       }
+
+       /**
         * Life-cycle method that is called by the DI container as soon as this object is completely built
         *
         * @return void
index bf86393..69f51f9 100644 (file)
@@ -123,7 +123,7 @@ class ClassInfoFactory {
                if (is_array($reflectionProperties)) {
                        foreach ($reflectionProperties as $reflectionProperty) {
                                $reflectedProperty = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Reflection\\PropertyReflection', $reflectedClass->getName(), $reflectionProperty->getName());
-                               if (($reflectedProperty->isTaggedWith('inject') || $reflectedProperty->isTaggedWith('Flow\\Inject')) && $reflectedProperty->getName() !== 'settings') {
+                               if (($reflectedProperty->isTaggedWith('inject') || $reflectedProperty->isTaggedWith('Flow\Inject')) && $reflectedProperty->getName() !== 'settings') {
                                        $varValues = $reflectedProperty->getTagValues('var');
                                        if (count($varValues) == 1) {
                                                $result[$reflectedProperty->getName()] = ltrim($varValues[0], '\\');
index b74fb0b..e30a8e7 100644 (file)
@@ -230,7 +230,6 @@ class Container implements \TYPO3\CMS\Core\SingletonInterface {
                                $this->log('The singleton "' . $classInfo->getClassName() . '" needs a prototype in "' . $injectPropertyName . '". This is often a bad code smell; often you rather want to inject a singleton.', 1320177676);
                        }
                        $propertyReflection = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Reflection\\PropertyReflection', $instance, $injectPropertyName);
-
                        $propertyReflection->setAccessible(TRUE);
                        $propertyReflection->setValue($instance, $instanceToInject);
                }
index 04c1163..41f907d 100644 (file)
@@ -35,7 +35,6 @@ class Backend implements \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\Generic\Session
-        * @inject
         */
        protected $session;
 
@@ -66,25 +65,21 @@ class Backend implements \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface
 
        /**
         * @var \TYPO3\CMS\Extbase\Reflection\ReflectionService
-        * @inject
         */
        protected $reflectionService;
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelFactory
-        * @inject
         */
        protected $qomFactory;
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\Generic\Storage\BackendInterface
-        * @inject
         */
        protected $storageBackend;
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper
-        * @inject
         */
        protected $dataMapper;
 
@@ -102,7 +97,6 @@ class Backend implements \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface
 
        /**
         * @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher
-        * @inject
         */
        protected $signalSlotDispatcher;
 
@@ -121,6 +115,59 @@ class Backend implements \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface
        }
 
        /**
+        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Session $session
+        * @return void
+        */
+       public function injectSession(\TYPO3\CMS\Extbase\Persistence\Generic\Session $session) {
+               $this->session = $session;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Storage\BackendInterface $storageBackend
+        * @return void
+        */
+       public function injectStorageBackend(\TYPO3\CMS\Extbase\Persistence\Generic\Storage\BackendInterface $storageBackend) {
+               $this->storageBackend = $storageBackend;
+       }
+
+       /**
+        * Injects the DataMapper to map nodes to objects
+        *
+        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper $dataMapper
+        * @return void
+        */
+       public function injectDataMapper(\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper $dataMapper) {
+               $this->dataMapper = $dataMapper;
+       }
+
+       /**
+        * Injects the Reflection Service
+        *
+        * @param \TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService
+        * @return void
+        */
+       public function injectReflectionService(\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService) {
+               $this->reflectionService = $reflectionService;
+       }
+
+       /**
+        * Injects the QueryObjectModelFactory
+        *
+        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelFactory $qomFactory
+        * @return void
+        */
+       public function injectQomFactory(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelFactory $qomFactory) {
+               $this->qomFactory = $qomFactory;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher
+        */
+       public function injectSignalSlotDispatcher(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher) {
+               $this->signalSlotDispatcher = $signalSlotDispatcher;
+       }
+
+       /**
         * @param \TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface $persistenceManager
         */
        public function setPersistenceManager(\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface $persistenceManager) {
index f29a6fe..8de6cd8 100644 (file)
@@ -39,11 +39,17 @@ class IdentityMap implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\Generic\Session
-        * @inject
         */
        protected $persistenceSession;
 
        /**
+        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Session
+        */
+       public function injectPersistenceSession(\TYPO3\CMS\Extbase\Persistence\Generic\Session $persistenceSession) {
+               $this->persistenceSession = $persistenceSession;
+       }
+
+       /**
         * Checks whether the given object is known to the identity map
         *
         * @param object $object
index 66646e2..7a496d6 100644 (file)
@@ -35,7 +35,6 @@ class LazyLoadingProxy implements \Iterator, \TYPO3\CMS\Extbase\Persistence\Gene
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper
-        * @inject
         */
        protected $dataMapper;
 
@@ -74,6 +73,16 @@ class LazyLoadingProxy implements \Iterator, \TYPO3\CMS\Extbase\Persistence\Gene
        }
 
        /**
+        * Injects the DataMapper to map nodes to objects
+        *
+        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper $dataMapper
+        * @return void
+        */
+       public function injectDataMapper(\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper $dataMapper) {
+               $this->dataMapper = $dataMapper;
+       }
+
+       /**
         * Populate this proxy by asking the $population closure.
         *
         * @return object The instance (hopefully) returned
index 8270c3a..3661ddb 100644 (file)
@@ -45,7 +45,6 @@ class LazyObjectStorage extends \TYPO3\CMS\Extbase\Persistence\ObjectStorage imp
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper
-        * @inject
         */
        protected $dataMapper;
 
@@ -99,6 +98,16 @@ class LazyObjectStorage extends \TYPO3\CMS\Extbase\Persistence\ObjectStorage imp
        }
 
        /**
+        * Injects the DataMapper to map nodes to objects
+        *
+        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper $dataMapper
+        * @return void
+        */
+       public function injectDataMapper(\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper $dataMapper) {
+               $this->dataMapper = $dataMapper;
+       }
+
+       /**
         * This is a function lazy load implementation.
         *
         * @return void
index 5ad5c31..d052ae8 100644 (file)
@@ -34,25 +34,21 @@ class DataMapFactory implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Reflection\ReflectionService
-        * @inject
         */
        protected $reflectionService;
 
        /**
         * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
-        * @inject
         */
        protected $configurationManager;
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-        * @inject
         */
        protected $objectManager;
 
        /**
         * @var \TYPO3\CMS\Core\Cache\CacheManager
-        * @inject
         */
        protected $cacheManager;
 
@@ -62,6 +58,39 @@ class DataMapFactory implements \TYPO3\CMS\Core\SingletonInterface {
        protected $dataMapCache;
 
        /**
+        * Injects the reflection service
+        *
+        * @param \TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService
+        * @return void
+        */
+       public function injectReflectionService(\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService) {
+               $this->reflectionService = $reflectionService;
+       }
+
+       /**
+        * @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\Object\ObjectManagerInterface $objectManager
+        * @return void
+        */
+       public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
+               $this->objectManager = $objectManager;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Core\Cache\CacheManager $cacheManager
+        */
+       public function injectCacheManager(\TYPO3\CMS\Core\Cache\CacheManager $cacheManager) {
+               $this->cacheManager = $cacheManager;
+       }
+
+       /**
         * Lifecycle method
         *
         * @return void
index 461911c..a354429 100644 (file)
@@ -34,25 +34,21 @@ class DataMapper implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\Generic\IdentityMap
-        * @inject
         */
        protected $identityMap;
 
        /**
         * @var \TYPO3\CMS\Extbase\Reflection\ReflectionService
-        * @inject
         */
        protected $reflectionService;
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelFactory
-        * @inject
         */
        protected $qomFactory;
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\Generic\Session
-        * @inject
         */
        protected $persistenceSession;
 
@@ -72,13 +68,11 @@ class DataMapper implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory
-        * @inject
         */
        protected $dataMapFactory;
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\Generic\QueryFactoryInterface
-        * @inject
         */
        protected $queryFactory;
 
@@ -91,11 +85,77 @@ class DataMapper implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-        * @inject
         */
        protected $objectManager;
 
        /**
+        * Injects the identity map
+        *
+        * @param \TYPO3\CMS\Extbase\Persistence\Generic\IdentityMap $identityMap
+        * @return void
+        */
+       public function injectIdentityMap(\TYPO3\CMS\Extbase\Persistence\Generic\IdentityMap $identityMap) {
+               $this->identityMap = $identityMap;
+       }
+
+       /**
+        * Injects the persistence session
+        *
+        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Session $persistenceSession
+        * @return void
+        */
+       public function injectSession(\TYPO3\CMS\Extbase\Persistence\Generic\Session $persistenceSession) {
+               $this->persistenceSession = $persistenceSession;
+       }
+
+       /**
+        * Injects the Reflection Service
+        *
+        * @param \TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService
+        * @return void
+        */
+       public function injectReflectionService(\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService) {
+               $this->reflectionService = $reflectionService;
+       }
+
+       /**
+        * Injects the DataMap Factory
+        *
+        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory $dataMapFactory
+        * @return void
+        */
+       public function injectDataMapFactory(\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory $dataMapFactory) {
+               $this->dataMapFactory = $dataMapFactory;
+       }
+
+       /**
+        * Injects the Query Factory
+        *
+        * @param \TYPO3\CMS\Extbase\Persistence\Generic\QueryFactoryInterface $queryFactory
+        */
+       public function injectQueryFactory(\TYPO3\CMS\Extbase\Persistence\Generic\QueryFactoryInterface $queryFactory) {
+               $this->queryFactory = $queryFactory;
+       }
+
+       /**
+        * Sets the query object model factory
+        *
+        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelFactory $qomFactory
+        * @return void
+        */
+       public function injectQomFactory(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelFactory $qomFactory) {
+               $this->qomFactory = $qomFactory;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
+        * @return void
+        */
+       public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
+               $this->objectManager = $objectManager;
+       }
+
+       /**
         * Maps the given rows on objects
         *
         * @param string $className The name of the class
index 0e80a71..30617a9 100644 (file)
@@ -56,19 +56,16 @@ class PersistenceManager implements \TYPO3\CMS\Extbase\Persistence\PersistenceMa
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\Generic\QueryFactoryInterface
-        * @inject
         */
        protected $queryFactory;
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\Generic\Backend
-        * @inject
         */
        protected $backend;
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\Generic\Session
-        * @inject
         */
        protected $persistenceSession;
 
@@ -82,6 +79,36 @@ class PersistenceManager implements \TYPO3\CMS\Extbase\Persistence\PersistenceMa
        }
 
        /**
+        * Injects the Persistence Backend
+        *
+        * @param \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface $backend The persistence backend
+        * @return void
+        */
+       public function injectBackend(\TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface $backend) {
+               $this->backend = $backend;
+       }
+
+       /**
+        * Injects a QueryFactory instance
+        *
+        * @param \TYPO3\CMS\Extbase\Persistence\Generic\QueryFactoryInterface $queryFactory
+        * @return void
+        */
+       public function injectQueryFactory(\TYPO3\CMS\Extbase\Persistence\Generic\QueryFactoryInterface $queryFactory) {
+               $this->queryFactory = $queryFactory;
+       }
+
+       /**
+        * Injects the Persistence Session
+        *
+        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Session $session The persistence session
+        * @return void
+        */
+       public function injectPersistenceSession(\TYPO3\CMS\Extbase\Persistence\Generic\Session $session) {
+               $this->persistenceSession = $session;
+       }
+
+       /**
         * Registers a repository
         *
         * @param string $className The class name of the repository to be reigistered
index 08f1f9d..25cefb9 100644 (file)
@@ -34,11 +34,18 @@ class QueryObjectModelFactory implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-        * @inject
         */
        protected $objectManager;
 
        /**
+        * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
+        * @return void
+        */
+       public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
+               $this->objectManager = $objectManager;
+       }
+
+       /**
         * Selects a subset of the nodes in the repository based on node type.
         *
         * @param string $nodeTypeName the name of the required node type; non-null
index 53ccea5..45bb74c 100644 (file)
@@ -61,25 +61,21 @@ class Query implements \TYPO3\CMS\Extbase\Persistence\QueryInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-        * @inject
         */
        protected $objectManager;
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper
-        * @inject
         */
        protected $dataMapper;
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface
-        * @inject
         */
        protected $persistenceManager;
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelFactory
-        * @inject
         */
        protected $qomFactory;
 
@@ -130,6 +126,44 @@ class Query implements \TYPO3\CMS\Extbase\Persistence\QueryInterface {
        }
 
        /**
+        * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
+        * @return void
+        */
+       public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
+               $this->objectManager = $objectManager;
+       }
+
+       /**
+        * Injects the persistence manager, used to fetch the CR session
+        *
+        * @param \TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface $persistenceManager
+        * @return void
+        */
+       public function injectPersistenceManager(\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface $persistenceManager) {
+               $this->persistenceManager = $persistenceManager;
+       }
+
+       /**
+        * Injects the DataMapper to map nodes to objects
+        *
+        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper $dataMapper
+        * @return void
+        */
+       public function injectDataMapper(\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper $dataMapper) {
+               $this->dataMapper = $dataMapper;
+       }
+
+       /**
+        * Injects the Query Object Model Factory
+        *
+        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelFactory $qomFactory
+        * @return void
+        */
+       public function injectQomFactory(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelFactory $qomFactory) {
+               $this->qomFactory = $qomFactory;
+       }
+
+       /**
         * Sets the Query Settings. These Query settings must match the settings expected by
         * the specific Storage Backend.
         *
index d8222ea..5c7637b 100644 (file)
@@ -34,23 +34,43 @@ class QueryFactory implements \TYPO3\CMS\Extbase\Persistence\Generic\QueryFactor
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-        * @inject
         */
        protected $objectManager;
 
        /**
         * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
-        * @inject
         */
        protected $configurationManager;
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper
-        * @inject
         */
        protected $dataMapper;
 
        /**
+        * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
+        * @return void
+        */
+       public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
+               $this->objectManager = $objectManager;
+       }
+
+       /**
+        * @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\Persistence\Generic\Mapper\DataMapper $dataMapper
+        */
+       public function injectDataMapper(\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper $dataMapper) {
+               $this->dataMapper = $dataMapper;
+       }
+
+       /**
         * Creates a query object working on the given class name
         *
         * @param string $className The class name
index 80ed5c9..be32ee3 100644 (file)
@@ -47,13 +47,11 @@ class QueryResult implements \TYPO3\CMS\Extbase\Persistence\QueryResultInterface
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper
-        * @inject
         */
        protected $dataMapper;
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface
-        * @inject
         */
        protected $persistenceManager;
 
@@ -78,6 +76,26 @@ class QueryResult implements \TYPO3\CMS\Extbase\Persistence\QueryResultInterface
        }
 
        /**
+        * Injects the DataMapper to map records to objects
+        *
+        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper $dataMapper
+        * @return void
+        */
+       public function injectDataMapper(\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper $dataMapper) {
+               $this->dataMapper = $dataMapper;
+       }
+
+       /**
+        * 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;
+       }
+
+       /**
         * Loads the objects this QueryResult is supposed to hold
         *
         * @return void
index ef189d1..43e4467 100644 (file)
@@ -60,7 +60,6 @@ class Session implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Reflection\ReflectionService
-        * @inject
         */
        protected $reflectionService;
 
@@ -73,6 +72,16 @@ class Session implements \TYPO3\CMS\Core\SingletonInterface {
        }
 
        /**
+        * Injects a Reflection Service instance
+        *
+        * @param \TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService
+        * @return void
+        */
+       public function injectReflectionService(\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService) {
+               $this->reflectionService = $reflectionService;
+       }
+
+       /**
         * Registers data for a reconstituted object.
         *
         * $entityData format is described in
index 1d1d0e0..bdca5e0 100644 (file)
@@ -44,7 +44,6 @@ class Typo3DbBackend implements \TYPO3\CMS\Extbase\Persistence\Generic\Storage\B
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper
-        * @inject
         */
        protected $dataMapper;
 
@@ -64,19 +63,16 @@ class Typo3DbBackend implements \TYPO3\CMS\Extbase\Persistence\Generic\Storage\B
 
        /**
         * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
-        * @inject
         */
        protected $configurationManager;
 
        /**
         * @var \TYPO3\CMS\Extbase\Service\CacheService
-        * @inject
         */
        protected $cacheService;
 
        /**
         * @var \TYPO3\CMS\Core\Cache\CacheManager
-        * @inject
         */
        protected $cacheManager;
 
@@ -87,7 +83,6 @@ class Typo3DbBackend implements \TYPO3\CMS\Extbase\Persistence\Generic\Storage\B
 
        /**
         * @var \TYPO3\CMS\Extbase\Service\EnvironmentService
-        * @inject
         */
        protected $environmentService;
 
@@ -99,6 +94,21 @@ class Typo3DbBackend implements \TYPO3\CMS\Extbase\Persistence\Generic\Storage\B
        }
 
        /**
+        * @param \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager
+        * @return void
+        */
+       public function injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager) {
+               $this->configurationManager = $configurationManager;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Core\Cache\CacheManager $cacheManager
+        */
+       public function injectCacheManager(\TYPO3\CMS\Core\Cache\CacheManager $cacheManager) {
+               $this->cacheManager = $cacheManager;
+       }
+
+       /**
         * Lifecycle method
         *
         * @return void
@@ -108,6 +118,32 @@ class Typo3DbBackend implements \TYPO3\CMS\Extbase\Persistence\Generic\Storage\B
        }
 
        /**
+        * Injects the DataMapper to map nodes to objects
+        *
+        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper $dataMapper
+        * @return void
+        */
+       public function injectDataMapper(\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper $dataMapper) {
+               $this->dataMapper = $dataMapper;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Extbase\Service\CacheService $cacheService
+        * @return void
+        */
+       public function injectCacheService(\TYPO3\CMS\Extbase\Service\CacheService $cacheService) {
+               $this->cacheService = $cacheService;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Extbase\Service\EnvironmentService $environmentService
+        * @return void
+        */
+       public function injectEnvironmentService(\TYPO3\CMS\Extbase\Service\EnvironmentService $environmentService) {
+               $this->environmentService = $environmentService;
+       }
+
+       /**
         * Adds a row to the storage
         *
         * @param string $tableName The database table name
index 3cef6a4..b3bbfc5 100644 (file)
@@ -37,27 +37,23 @@ class Repository implements \TYPO3\CMS\Extbase\Persistence\RepositoryInterface,
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\Generic\IdentityMap
         * @deprecated since 6.1 will be removed two versions later, use the persistence session instead
-        * @inject
         */
        protected $identityMap;
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface
         * @deprecated since 6.1, will be removed two versions later, use the persistence manager instead
-        * @inject
         */
        protected $backend;
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\Generic\Session
         * @deprecated since 6.1 will be removed two versions later, use the persistence manager instead
-        * @inject
         */
        protected $session;
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface
-        * @inject
         */
        protected $persistenceManager;
 
@@ -97,16 +93,55 @@ class Repository implements \TYPO3\CMS\Extbase\Persistence\RepositoryInterface,
                        \TYPO3\CMS\Core\Utility\GeneralUtility::logDeprecatedFunction();
 
                        $this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
-                       $this->identityMap = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\IdentityMap');
-                       $this->persistenceManager = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\PersistenceManager');
-                       $this->backend = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\BackendInterface');
-                       $this->session = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Session');
+                       $this->injectIdentityMap($this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\IdentityMap'));
+                       $this->injectPersistenceManager($this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\PersistenceManager'));
+                       $this->injectBackend($this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\BackendInterface'));
+                       $this->injectSession($this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Session'));
                } else {
                        $this->objectManager = $objectManager;
                }
        }
 
        /**
+        * @param \TYPO3\CMS\Extbase\Persistence\Generic\IdentityMap $identityMap
+        * @return void
+        * @deprecated since 6.1, will be removed two versions later
+        */
+       public function injectIdentityMap(\TYPO3\CMS\Extbase\Persistence\Generic\IdentityMap $identityMap) {
+               $this->identityMap = $identityMap;
+       }
+
+       /**
+        * Injects the Persistence Backend
+        *
+        * @param \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface $backend The persistence backend
+        * @return void
+        * @deprecated since 6.1, will be removed two versions later
+        */
+       public function injectBackend(\TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface $backend) {
+               $this->backend = $backend;
+       }
+
+       /**
+        * Injects the Persistence Session
+        *
+        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Session $session The persistence session
+        * @return void
+        * @deprecated since 6.1, will be removed two versions later
+        */
+       public function injectSession(\TYPO3\CMS\Extbase\Persistence\Generic\Session $session) {
+               $this->session = $session;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface $persistenceManager
+        * @return void
+        */
+       public function injectPersistenceManager(\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface $persistenceManager) {
+               $this->persistenceManager = $persistenceManager;
+       }
+
+       /**
         * Adds an object to this repository
         *
         * @param object $object The object to add
index 0346a0a..ee11083 100644 (file)
@@ -61,35 +61,70 @@ class Mapper implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Validation\ValidatorResolver
-        * @inject
         */
        protected $validatorResolver;
 
        /**
         * @var \TYPO3\CMS\Extbase\Reflection\ReflectionService
-        * @inject
         */
        protected $reflectionService;
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface
-        * @inject
         */
        protected $persistenceManager;
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-        * @inject
         */
        protected $objectManager;
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\Generic\QueryFactoryInterface
-        * @inject
         */
        protected $queryFactory;
 
        /**
+        * @param \TYPO3\CMS\Extbase\Validation\ValidatorResolver $validatorResolver
+        * @return void
+        */
+       public function injectValidatorResolver(\TYPO3\CMS\Extbase\Validation\ValidatorResolver $validatorResolver) {
+               $this->validatorResolver = $validatorResolver;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Extbase\Persistence\Generic\QueryFactoryInterface $queryFactory
+        * @return void
+        */
+       public function injectQueryFactory(\TYPO3\CMS\Extbase\Persistence\Generic\QueryFactoryInterface $queryFactory) {
+               $this->queryFactory = $queryFactory;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager $persistenceManager
+        * @return void
+        */
+       public function injectPersistenceManager(\TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager $persistenceManager) {
+               $this->persistenceManager = $persistenceManager;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService
+        * @return void
+        */
+       public function injectReflectionService(\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService) {
+               $this->reflectionService = $reflectionService;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
+        * @return void
+        */
+       public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
+               $this->objectManager = $objectManager;
+       }
+
+       /**
         * Maps the given properties to the target object and validates the properties according to the defined
         * validators. If the result object is not valid, the operation will be undone (the target object remains
         * unchanged) and this method returns FALSE.
index bd37fc3..64d514e 100644 (file)
@@ -31,13 +31,11 @@ class PropertyMapper implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-        * @inject
         */
        protected $objectManager;
 
        /**
         * @var \TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationBuilder
-        * @inject
         */
        protected $configurationBuilder;
 
@@ -61,6 +59,22 @@ class PropertyMapper implements \TYPO3\CMS\Core\SingletonInterface {
        protected $messages;
 
        /**
+        * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
+        * @return void
+        */
+       public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
+               $this->objectManager = $objectManager;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationBuilder $propertyMappingConfigurationBuilder
+        * @return void
+        */
+       public function injectPropertyMappingConfigurationBuilder(\TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationBuilder $propertyMappingConfigurationBuilder) {
+               $this->configurationBuilder = $propertyMappingConfigurationBuilder;
+       }
+
+       /**
         * Lifecycle method, called after all dependencies have been injected.
         * Here, the typeConverter array gets initialized.
         *
index 9bab34f..8b3cf36 100644 (file)
@@ -46,11 +46,17 @@ abstract class AbstractFileCollectionConverter extends \TYPO3\CMS\Extbase\Proper
 
        /**
         * @var \TYPO3\CMS\Core\Resource\ResourceFactory
-        * @inject
         */
        protected $fileFactory;
 
        /**
+        * @param \TYPO3\CMS\Core\Resource\ResourceFactory $fileFactory
+        */
+       public function injectFileFactory(\TYPO3\CMS\Core\Resource\ResourceFactory $fileFactory) {
+               $this->fileFactory = $fileFactory;
+       }
+
+       /**
         * Actually convert from $source to $targetType, taking into account the fully
         * built $convertedChildProperties and $configuration.
         *
index f382ed2..bd73bfa 100644 (file)
@@ -46,11 +46,17 @@ abstract class AbstractFileFolderConverter extends \TYPO3\CMS\Extbase\Property\T
 
        /**
         * @var \TYPO3\CMS\Core\Resource\ResourceFactory
-        * @inject
         */
        protected $fileFactory;
 
        /**
+        * @param \TYPO3\CMS\Core\Resource\ResourceFactory $fileFactory
+        */
+       public function injectFileFactory(\TYPO3\CMS\Core\Resource\ResourceFactory $fileFactory) {
+               $this->fileFactory = $fileFactory;
+       }
+
+       /**
         * Actually convert from $source to $targetType, taking into account the fully
         * built $convertedChildProperties and $configuration.
         *
index 9a21906..4ca8bd9 100644 (file)
@@ -58,11 +58,19 @@ abstract class AbstractTypeConverter implements \TYPO3\CMS\Extbase\Property\Type
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManager
-        * @inject
         */
        protected $objectManager;
 
        /**
+        * Injects the object manager.
+        *
+        * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
+        */
+       public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
+               $this->objectManager = $objectManager;
+       }
+
+       /**
         * Returns the list of source types the TypeConverter can handle.
         * Must be PHP simple types, classes or object is not allowed.
         *
index e16b7b3..24c8aea 100644 (file)
@@ -84,7 +84,6 @@ class ClassSchema {
 
        /**
         * @var \TYPO3\CMS\Extbase\Service\TypeHandlingService
-        * @inject
         */
        protected $typeHandlingService;
 
@@ -98,6 +97,14 @@ class ClassSchema {
        }
 
        /**
+        * @param \TYPO3\CMS\Extbase\Service\TypeHandlingService $typeHandlingService
+        * @return void
+        */
+       public function injectTypeHandlingService(\TYPO3\CMS\Extbase\Service\TypeHandlingService $typeHandlingService) {
+               $this->typeHandlingService = $typeHandlingService;
+       }
+
+       /**
         * Returns the class name this schema is referring to
         *
         * @return string The class name
index 395626c..f302e35 100644 (file)
@@ -40,7 +40,6 @@ class ReflectionService implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-        * @inject
         */
        protected $objectManager;
 
@@ -142,7 +141,6 @@ class ReflectionService implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
-        * @inject
         */
        protected $configurationManager;
 
@@ -157,6 +155,22 @@ class ReflectionService implements \TYPO3\CMS\Core\SingletonInterface {
        protected $methodReflections = array();
 
        /**
+        * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
+        * @return void
+        */
+       public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
+               $this->objectManager = $objectManager;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager
+        * @return void
+        */
+       public function injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager) {
+               $this->configurationManager = $configurationManager;
+       }
+
+       /**
         * Sets the data cache.
         *
         * The cache must be set before initializing the Reflection Service.
index d8fa9e9..782a897 100644 (file)
@@ -52,23 +52,41 @@ class TaskExecutor implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-        * @inject
         */
        protected $objectManager;
 
        /**
         * @var \TYPO3\CMS\Extbase\Mvc\Cli\CommandManager
-        * @inject
         */
        protected $commandManager;
 
        /**
         * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
-        * @inject
         */
        protected $configurationManager;
 
        /**
+        * @param \TYPO3\CMS\Extbase\Object\ObjectManager $objectManager
+        */
+       public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManager $objectManager) {
+               $this->objectManager = $objectManager;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Extbase\Mvc\Cli\CommandManager $commandManager
+        */
+       public function injectCommandManager(\TYPO3\CMS\Extbase\Mvc\Cli\CommandManager $commandManager) {
+               $this->commandManager = $commandManager;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager
+        */
+       public function injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager) {
+               $this->configurationManager = $configurationManager;
+       }
+
+       /**
         * Initializes Request, Response and Dispatcher
         */
        public function initializeObject() {
index 87ad9a6..b075dc0 100644 (file)
@@ -49,11 +49,18 @@ class RequestHashService implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Security\Cryptography\HashService
-        * @inject
         */
        protected $hashService;
 
        /**
+        * @param \TYPO3\CMS\Extbase\Security\Cryptography\HashService $hashService
+        * @return void
+        */
+       public function injectHashService(\TYPO3\CMS\Extbase\Security\Cryptography\HashService $hashService) {
+               $this->hashService = $hashService;
+       }
+
+       /**
         * Generate a request hash for a list of form fields
         *
         * @param array $formFieldNames Array of form fields
index 13d6356..4837adf 100644 (file)
@@ -37,13 +37,11 @@ class ExtensionService implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-        * @inject
         */
        protected $objectManager;
 
        /**
         * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
-        * @inject
         */
        protected $configurationManager;
 
@@ -54,6 +52,22 @@ class ExtensionService implements \TYPO3\CMS\Core\SingletonInterface {
        protected $targetPidPluginCache = array();
 
        /**
+        * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
+        * @return void
+        */
+       public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
+               $this->objectManager = $objectManager;
+       }
+
+       /**
+        * @param \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager
+        * @return void
+        */
+       public function injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager) {
+               $this->configurationManager = $configurationManager;
+       }
+
+       /**
         * Determines the plugin namespace of the specified plugin (defaults to "tx_[extensionname]_[pluginname]")
         * If plugin.tx_$pluginSignature.view.pluginNamespace is set, this value is returned
         * If pluginNamespace is not specified "tx_[extensionname]_[pluginname]" is returned.
index a2ba692..383bc3f 100644 (file)
@@ -74,13 +74,11 @@ class ValidatorResolver implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-        * @inject
         */
        protected $objectManager;
 
        /**
         * @var \TYPO3\CMS\Extbase\Reflection\ReflectionService
-        * @inject
         */
        protected $reflectionService;
 
@@ -90,6 +88,26 @@ class ValidatorResolver implements \TYPO3\CMS\Core\SingletonInterface {
        protected $baseValidatorConjunctions = array();
 
        /**
+        * Injects the object manager
+        *
+        * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager A reference to the object manager
+        * @return void
+        */
+       public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
+               $this->objectManager = $objectManager;
+       }
+
+       /**
+        * Injects the reflection service
+        *
+        * @param \TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService
+        * @return void
+        */
+       public function injectReflectionService(\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService) {
+               $this->reflectionService = $reflectionService;
+       }
+
+       /**
         * Get a validator for a given data type. Returns a validator implementing
         * the \TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface or NULL if no validator
         * could be resolved.
index f504141..c6572d8 100644 (file)
@@ -121,7 +121,7 @@ class AbstractConfigurationManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\Bas
        public function setUp() {
                $this->abstractConfigurationManager = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Configuration\\AbstractConfigurationManager', array('getContextSpecificFrameworkConfiguration', 'getTypoScriptSetup', 'getPluginConfiguration', 'getSwitchableControllerActions', 'getRecursiveStoragePids'));
                $this->mockTypoScriptService = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Service\\TypoScriptService');
-               $this->abstractConfigurationManager->_set('typoScriptService', $this->mockTypoScriptService);
+               $this->abstractConfigurationManager->injectTypoScriptService($this->mockTypoScriptService);
        }
 
        /**
@@ -316,7 +316,7 @@ class AbstractConfigurationManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\Bas
        public function switchableControllerActionsAreNotOverriddenIfPluginNameIsSpecified() {
                /** @var \TYPO3\CMS\Extbase\Configuration\AbstractConfigurationManager|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
                $abstractConfigurationManager = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Configuration\\AbstractConfigurationManager', array('overrideSwitchableControllerActions', 'getContextSpecificFrameworkConfiguration', 'getTypoScriptSetup', 'getPluginConfiguration', 'getSwitchableControllerActions', 'getRecursiveStoragePids'));
-               $abstractConfigurationManager->_set('typoScriptService', $this->mockTypoScriptService);
+               $abstractConfigurationManager->injectTypoScriptService($this->mockTypoScriptService);
                $abstractConfigurationManager->setConfiguration(array('switchableControllerActions' => array('overriddenSwitchableControllerActions')));
                $abstractConfigurationManager->expects($this->any())->method('getPluginConfiguration')->will($this->returnValue(array()));
                $abstractConfigurationManager->expects($this->never())->method('overrideSwitchableControllerActions');
@@ -331,7 +331,7 @@ class AbstractConfigurationManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\Bas
                $configuration = array('extensionName' => 'CurrentExtensionName', 'pluginName' => 'CurrentPluginName', 'switchableControllerActions' => array('overriddenSwitchableControllerActions'));
                $abstractConfigurationManager = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Configuration\\AbstractConfigurationManager', array('overrideSwitchableControllerActions', 'getContextSpecificFrameworkConfiguration', 'getTypoScriptSetup', 'getPluginConfiguration', 'getSwitchableControllerActions', 'getRecursiveStoragePids'));
                $this->mockTypoScriptService->expects($this->any())->method('convertTypoScriptArrayToPlainArray')->with($configuration)->will($this->returnValue($configuration));
-               $abstractConfigurationManager->_set('typoScriptService', $this->mockTypoScriptService);
+               $abstractConfigurationManager->injectTypoScriptService($this->mockTypoScriptService);
                $abstractConfigurationManager->setConfiguration($configuration);
                $abstractConfigurationManager->expects($this->any())->method('getPluginConfiguration')->will($this->returnValue(array()));
                $abstractConfigurationManager->expects($this->once())->method('overrideSwitchableControllerActions');
@@ -346,7 +346,7 @@ class AbstractConfigurationManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\Bas
                $configuration = array('switchableControllerActions' => array('overriddenSwitchableControllerActions'));
                $abstractConfigurationManager = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Configuration\\AbstractConfigurationManager', array('overrideSwitchableControllerActions', 'getContextSpecificFrameworkConfiguration', 'getTypoScriptSetup', 'getPluginConfiguration', 'getSwitchableControllerActions', 'getRecursiveStoragePids'));
                $this->mockTypoScriptService->expects($this->any())->method('convertTypoScriptArrayToPlainArray')->with($configuration)->will($this->returnValue($configuration));
-               $abstractConfigurationManager->_set('typoScriptService', $this->mockTypoScriptService);
+               $abstractConfigurationManager->injectTypoScriptService($this->mockTypoScriptService);
                $abstractConfigurationManager->setConfiguration($configuration);
                $abstractConfigurationManager->expects($this->any())->method('getPluginConfiguration')->will($this->returnValue(array()));
                $abstractConfigurationManager->expects($this->once())->method('overrideSwitchableControllerActions');
index ea7a38e..428763d 100644 (file)
@@ -52,7 +52,7 @@ class BackendConfigurationManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\Base
                $GLOBALS['TYPO3_DB'] = $this->getMock('TYPO3\\CMS\\Core\\Database\\DatabaseConnection', array());
                $this->backendConfigurationManager = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Configuration\\BackendConfigurationManager', array('getTypoScriptSetup'));
                $this->mockTypoScriptService = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Service\\TypoScriptService');
-               $this->backendConfigurationManager->_set('typoScriptService', $this->mockTypoScriptService);
+               $this->backendConfigurationManager->injectTypoScriptService($this->mockTypoScriptService);
        }
 
        /**
@@ -351,7 +351,7 @@ class BackendConfigurationManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\Base
                $queryGenerator->expects($this->any())
                        ->method('getTreeList')
                        ->will($this->onConsecutiveCalls('1,4', '2', '3,5,6'));
-               $abstractConfigurationManager->_set('queryGenerator', $queryGenerator);
+               $abstractConfigurationManager->injectQueryGenerator($queryGenerator);
 
                $expectedResult = '1,4,2,3,5,6';
                $actualResult = $abstractConfigurationManager->_call('getRecursiveStoragePids', $storagePid, $recursive);
@@ -368,7 +368,7 @@ class BackendConfigurationManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\Base
 
                $queryGenerator = $this->getMock('TYPO3\\CMS\\Core\\Database\\QueryGenerator');
                $queryGenerator->expects($this->never())->method('getTreeList');
-               $abstractConfigurationManager->_set('queryGenerator', $queryGenerator);
+               $abstractConfigurationManager->injectQueryGenerator($queryGenerator);
 
                $expectedResult = '1,2,3';
                $actualResult = $abstractConfigurationManager->_call('getRecursiveStoragePids', $storagePid);
@@ -386,7 +386,7 @@ class BackendConfigurationManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\Base
 
                $queryGenerator = $this->getMock('TYPO3\\CMS\\Core\\Database\\QueryGenerator');
                $queryGenerator->expects($this->never())->method('getTreeList');
-               $abstractConfigurationManager->_set('queryGenerator', $queryGenerator);
+               $abstractConfigurationManager->injectQueryGenerator($queryGenerator);
 
                $expectedResult = '1,2,3';
                $actualResult = $abstractConfigurationManager->_call('getRecursiveStoragePids', $storagePid, $recursive);
index 1b04a1f..0ad4c35 100644 (file)
@@ -54,7 +54,7 @@ class FrontendConfigurationManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\Bas
                $this->frontendConfigurationManager = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Configuration\\FrontendConfigurationManager', array('dummy'));
                $this->frontendConfigurationManager->_set('contentObject', $this->mockContentObject);
                $this->mockTypoScriptService = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Service\\TypoScriptService');
-               $this->frontendConfigurationManager->_set('typoScriptService', $this->mockTypoScriptService);
+               $this->frontendConfigurationManager->injectTypoScriptService($this->mockTypoScriptService);
        }
 
        /**
@@ -455,7 +455,7 @@ class FrontendConfigurationManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\Bas
                /** @var $frontendConfigurationManager \TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager */
                $frontendConfigurationManager = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Configuration\\FrontendConfigurationManager', array('getTypoScriptSetup'));
                $frontendConfigurationManager->_set('contentObject', $this->mockContentObject);
-               $frontendConfigurationManager->_set('typoScriptService', $this->mockTypoScriptService);
+               $frontendConfigurationManager->injectTypoScriptService($this->mockTypoScriptService);
 
                $this->mockTypoScriptService->expects($this->once())->method('convertTypoScriptArrayToPlainArray')->will($this->returnValue(array(
                        'persistence' => array(
index edbf4d1..a32556e 100644 (file)
@@ -85,11 +85,12 @@ class BootstrapTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $requestHandlerResolver = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\RequestHandlerResolver', array('resolveRequestHandler'));
 
                /** @var $cliRequestHandler \TYPO3\CMS\Extbase\Mvc\Cli\RequestHandler|\PHPUnit_Framework_MockObject_MockObject */
-               $cliRequestHandler = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Cli\RequestHandler', array('canHandleRequest'));
+               $cliRequestHandler = $this->getMock('TYPO3\CMS\Extbase\Mvc\Cli\RequestHandler', array('canHandleRequest'));
                $cliRequestHandler->expects($this->any())->method('canHandleRequest')->will($this->returnValue(TRUE));
-               $cliRequestHandler->_set('objectManager', $this->objectManager);
-               $cliRequestHandler->_set('requestBuilder', $this->objectManager->get('TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder'));
-               $cliRequestHandler->_set('dispatcher', $this->objectManager->get('TYPO3\CMS\Extbase\Mvc\Dispatcher'));
+               $cliRequestHandler->injectObjectManager($this->objectManager);
+               $cliRequestHandler->injectRequestBuilder($this->objectManager->get('TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder'));
+               $cliRequestHandler->injectDispatcher($this->objectManager->get('TYPO3\CMS\Extbase\Mvc\Dispatcher'));
+
                /** @var $cliResponse \TYPO3\CMS\Extbase\Mvc\Cli\Response */
                $cliResponse = $this->getMock('TYPO3\CMS\Extbase\Mvc\Cli\Response', array('send'));
 
index a6b7239..32aab95 100644 (file)
@@ -42,9 +42,9 @@ class CommandManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
 
        public function setUp() {
                $this->commandControllerBackup = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers'];
-               $this->commandManager = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Cli\\CommandManager', array('getAvailableCommands'));
+               $this->commandManager = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Cli\\CommandManager', array('getAvailableCommands'));
                $this->mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
-               $this->commandManager->_set('objectManager', $this->mockObjectManager);
+               $this->commandManager->injectObjectManager($this->mockObjectManager);
        }
 
        public function tearDown() {
@@ -56,9 +56,8 @@ class CommandManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
         * @author Bastian Waidelich <bastian@typo3.org>
         */
        public function getAvailableCommandsReturnsAllAvailableCommands() {
-               /** @var \TYPO3\CMS\Core\Tests\AccessibleObjectInterface $commandManager */
-               $commandManager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Cli\CommandManager', array('dummy'));
-               $commandManager->_set('objectManager', $this->mockObjectManager);
+               $commandManager = new \TYPO3\CMS\Extbase\Mvc\Cli\CommandManager();
+               $commandManager->injectObjectManager($this->mockObjectManager);
                $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers'] = array(
                        'TYPO3\\CMS\\Extbase\\Tests\\Unit\\Mvc\\Cli\\Fixture\\Command\\MockACommandController',
                        'TYPO3\\CMS\\Extbase\\Tests\\Unit\\Mvc\\Cli\\Fixture\\Command\\MockBCommandController'
index 57940fa..afc4de6 100644 (file)
@@ -48,7 +48,7 @@ class CommandTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->mockMethodReflection = $this->getMock('TYPO3\\CMS\\Extbase\\Reflection\\MethodReflection', array(), array(), '', FALSE);
                $this->command->expects($this->any())->method('getCommandMethodReflection')->will($this->returnValue($this->mockMethodReflection));
                $this->mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
-               $this->command->_set('objectManager', $this->mockObjectManager);
+               $this->command->injectObjectManager($this->mockObjectManager);
        }
 
        /**
@@ -135,7 +135,7 @@ class CommandTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockReflectionService = $this->getMock('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService');
                $mockMethodParameters = array('argument1' => array('optional' => FALSE), 'argument2' => array('optional' => TRUE));
                $mockReflectionService->expects($this->atLeastOnce())->method('getMethodParameters')->will($this->returnValue($mockMethodParameters));
-               $this->command->_set('reflectionService', $mockReflectionService);
+               $this->command->injectReflectionService($mockReflectionService);
                $this->mockMethodReflection->expects($this->atLeastOnce())->method('getParameters')->will($this->returnValue(array($mockParameterReflection)));
                $this->mockMethodReflection->expects($this->atLeastOnce())->method('getTagsValues')->will($this->returnValue(array('param' => array('@param $argument1 argument1 description', '@param $argument2 argument2 description'))));
                $mockCommandArgumentDefinition1 = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Cli\\CommandArgumentDefinition', array(), array(), '', FALSE);
index bb17a1b..f17dcdd 100644 (file)
@@ -26,7 +26,7 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Mvc\Cli;
 class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
 
        /**
-        * @var \TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_Comparator_MockObject
+        * @var \TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder
         */
        protected $requestBuilder;
 
@@ -70,10 +70,10 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->mockCommandManager = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Cli\\CommandManager');
                $this->mockCommandManager->expects($this->any())->method('getCommandByIdentifier')->with('some_extension_name:default:list')->will($this->returnValue($this->mockCommand));
                $this->mockReflectionService = $this->getMock('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService');
-               $this->requestBuilder = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder', array('dummy'));
-               $this->requestBuilder->_set('objectManager', $this->mockObjectManager);
-               $this->requestBuilder->_set('reflectionService', $this->mockReflectionService);
-               $this->requestBuilder->_set('commandManager', $this->mockCommandManager);
+               $this->requestBuilder = new \TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder();
+               $this->requestBuilder->injectObjectManager($this->mockObjectManager);
+               $this->requestBuilder->injectReflectionService($this->mockReflectionService);
+               $this->requestBuilder->injectCommandManager($this->mockCommandManager);
        }
 
        /**
@@ -100,7 +100,7 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->mockCommandManager->getCommandByIdentifier('some_extension_name:default:list');
                $mockCommandManager = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Cli\\CommandManager');
                $mockCommandManager->expects($this->any())->method('getCommandByIdentifier')->with('test:default:list')->will($this->throwException(new \TYPO3\CMS\Extbase\Mvc\Exception\NoSuchCommandException()));
-               $this->requestBuilder->_set('commandManager', $mockCommandManager);
+               $this->requestBuilder->injectCommandManager($mockCommandManager);
                $request = $this->requestBuilder->build('test:default:list');
                $this->assertSame('TYPO3\\CMS\\Extbase\\Command\\HelpCommandController', $request->getControllerObjectName());
        }
index 3f5a88a..8a2a959 100644 (file)
@@ -26,7 +26,7 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Mvc\Cli;
 class RequestTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
 
        /**
-        * @var \TYPO3\CMS\Extbase\Mvc\Cli\Request|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface
+        * @var \TYPO3\CMS\Extbase\Mvc\Cli\Request
         */
        protected $request;
 
@@ -39,9 +39,9 @@ class RequestTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
         * Sets up this test case
         */
        public function setUp() {
-               $this->request = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Cli\Request', array('dummy'));
+               $this->request = new \TYPO3\CMS\Extbase\Mvc\Cli\Request();
                $this->mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
-               $this->request->_set('objectManager', $this->mockObjectManager);
+               $this->request->injectObjectManager($this->mockObjectManager);
        }
 
        /**
index 56a389a..92ff596 100644 (file)
@@ -91,7 +91,7 @@ class ActionControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockController->expects($this->at(7))->method('buildControllerContext');
                $mockController->expects($this->at(8))->method('resolveView');
 
-               $mockController->_set('mvcPropertyMappingConfigurationService', $configurationService);
+               $mockController->injectMvcPropertyMappingConfigurationService($configurationService);
                $mockController->_set('arguments', new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments());
 
                $mockController->processRequest($mockRequest, $mockResponse);
@@ -112,7 +112,7 @@ class ActionControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockArgumentMappingResults->expects($this->once())->method('hasErrors')->will($this->returnValue(FALSE));
                $mockController = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ActionController', array('fooAction', 'initializeAction'), array(), '', FALSE);
                $mockSignalSlotDispatcher = $this->getMock('TYPO3\\CMS\Extbase\\SignalSlot\\Dispatcher', array(), array(), '', FALSE);
-               $mockController->_set('signalSlotDispatcher', $mockSignalSlotDispatcher);
+               $mockController->injectSignalSlotDispatcher($mockSignalSlotDispatcher);
                $this->enableDeprecatedPropertyMapperInController($mockController);
                $mockController->expects($this->once())->method('fooAction')->will($this->returnValue('the returned string'));
                $mockController->_set('request', $mockRequest);
@@ -138,7 +138,7 @@ class ActionControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockArgumentMappingResults->expects($this->once())->method('hasErrors')->will($this->returnValue(FALSE));
                $mockController = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ActionController', array('fooAction', 'initializeAction'), array(), '', FALSE);
                $mockSignalSlotDispatcher = $this->getMock('TYPO3\\CMS\Extbase\\SignalSlot\\Dispatcher', array(), array(), '', FALSE);
-               $mockController->_set('signalSlotDispatcher', $mockSignalSlotDispatcher);
+               $mockController->injectSignalSlotDispatcher($mockSignalSlotDispatcher);
                $this->enableDeprecatedPropertyMapperInController($mockController);
                $mockController->expects($this->once())->method('fooAction');
                $mockController->_set('request', $mockRequest);
@@ -188,7 +188,7 @@ class ActionControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockArgumentMappingResults->expects($this->once())->method('hasErrors')->will($this->returnValue(FALSE));
                $mockController = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ActionController', array('fooAction', 'initializeAction'), array(), '', FALSE);
                $mockSignalSlotDispatcher = $this->getMock('TYPO3\\CMS\Extbase\\SignalSlot\\Dispatcher', array(), array(), '', FALSE);
-               $mockController->_set('signalSlotDispatcher', $mockSignalSlotDispatcher);
+               $mockController->injectSignalSlotDispatcher($mockSignalSlotDispatcher);
                $this->enableDeprecatedPropertyMapperInController($mockController);
                $mockController->expects($this->once())->method('fooAction')->with('Default value');
                $mockController->_set('request', $mockRequest);
@@ -349,7 +349,7 @@ class ActionControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                );
                $mockReflectionService = $this->getMock('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService', array(), array(), '', FALSE);
                $mockReflectionService->expects($this->once())->method('getMethodParameters')->with(get_class($mockController), 'fooAction')->will($this->returnValue($methodParameters));
-               $mockController->_set('reflectionService', $mockReflectionService);
+               $mockController->injectReflectionService($mockReflectionService);
                $mockController->_set('request', $mockRequest);
                $mockController->_set('arguments', $mockArguments);
                $mockController->_set('actionMethodName', 'fooAction');
@@ -396,7 +396,7 @@ class ActionControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                );
                $mockReflectionService = $this->getMock('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService', array(), array(), '', FALSE);
                $mockReflectionService->expects($this->once())->method('getMethodParameters')->with(get_class($mockController), 'fooAction')->will($this->returnValue($methodParameters));
-               $mockController->_set('reflectionService', $mockReflectionService);
+               $mockController->injectReflectionService($mockReflectionService);
                $mockController->_set('request', $mockRequest);
                $mockController->_set('arguments', $mockArguments);
                $mockController->_set('actionMethodName', 'fooAction');
@@ -423,7 +423,7 @@ class ActionControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                );
                $mockReflectionService = $this->getMock('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService', array(), array(), '', FALSE);
                $mockReflectionService->expects($this->once())->method('getMethodParameters')->with(get_class($mockController), 'fooAction')->will($this->returnValue($methodParameters));
-               $mockController->_set('reflectionService', $mockReflectionService);
+               $mockController->injectReflectionService($mockReflectionService);
                $mockController->_set('request', $mockRequest);
                $mockController->_set('arguments', $mockArguments);
                $mockController->_set('actionMethodName', 'fooAction');
@@ -448,8 +448,8 @@ class ActionControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockReflectionService->expects($this->once())->method('getMethodTagsValues')->with(get_class($mockController), 'fooAction')->will($this->returnValue($methodTagsValues));
                $mockValidatorResolver = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array(), array(), '', FALSE);
                $mockValidatorResolver->expects($this->once())->method('buildMethodArgumentsValidatorConjunctions')->with(get_class($mockController), 'fooAction')->will($this->returnValue($methodArgumentsValidatorConjunctions));
-               $mockController->_set('reflectionService', $mockReflectionService);
-               $mockController->_set('validatorResolver', $mockValidatorResolver);
+               $mockController->injectReflectionService($mockReflectionService);
+               $mockController->injectValidatorResolver($mockValidatorResolver);
                $mockController->_set('arguments', $arguments);
                $mockController->_set('actionMethodName', 'fooAction');
                $mockController->_call('initializeActionMethodValidators');
@@ -478,8 +478,8 @@ class ActionControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockValidatorResolver = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array(), array(), '', FALSE);
                $mockValidatorResolver->expects($this->once())->method('buildMethodArgumentsValidatorConjunctions')->with(get_class($mockController), 'fooAction')->will($this->returnValue($methodArgumentsValidatorConjunctions));
                $mockValidatorResolver->expects($this->once())->method('getBaseValidatorConjunction')->with('F3_Foo_Quux')->will($this->returnValue($quuxBaseValidatorConjunction));
-               $mockController->_set('reflectionService', $mockReflectionService);
-               $mockController->_set('validatorResolver', $mockValidatorResolver);
+               $mockController->injectReflectionService($mockReflectionService);
+               $mockController->injectValidatorResolver($mockValidatorResolver);
                $mockController->_set('arguments', $arguments);
                $mockController->_set('actionMethodName', 'fooAction');
                $mockController->_call('initializeActionMethodValidators');
@@ -510,8 +510,8 @@ class ActionControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockValidatorResolver = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array(), array(), '', FALSE);
                $mockValidatorResolver->expects($this->once())->method('buildMethodArgumentsValidatorConjunctions')->with(get_class($mockController), 'fooAction')->will($this->returnValue($methodArgumentsValidatorConjunctions));
                $mockValidatorResolver->expects($this->any())->method('getBaseValidatorConjunction')->will($this->throwException(new \Exception('This should not be called because the dontvalidate annotation is set.')));
-               $mockController->_set('reflectionService', $mockReflectionService);
-               $mockController->_set('validatorResolver', $mockValidatorResolver);
+               $mockController->injectReflectionService($mockReflectionService);
+               $mockController->injectValidatorResolver($mockValidatorResolver);
                $mockController->_set('arguments', $arguments);
                $mockController->_set('actionMethodName', 'fooAction');
                $mockController->_call('initializeActionMethodValidators');
@@ -583,7 +583,7 @@ class ActionControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockController->_set('arguments', array($argument1, $argument2));
                $mockController->_set('request', $mockRequest);
                $mockController->_set('actionMethodName', 'fooAction');
-               $mockController->_set('reflectionService', $mockReflectionService);
+               $mockController->injectReflectionService($mockReflectionService);
                $mockController->_call('checkRequestHash');
        }
 
@@ -610,7 +610,7 @@ class ActionControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockController->_set('arguments', array($argument1, $argument2));
                $mockController->_set('request', $mockRequest);
                $mockController->_set('actionMethodName', 'fooAction');
-               $mockController->_set('reflectionService', $mockReflectionService);
+               $mockController->injectReflectionService($mockReflectionService);
                $mockController->_call('checkRequestHash');
        }
 
index 9f5578f..1e40e35 100644 (file)
@@ -71,7 +71,7 @@ class ArgumentBehaviorBeforeExtbase14Test extends \TYPO3\CMS\Extbase\Tests\Unit\
         * @test
         */
        public function setValueProvidesFluentInterface() {
-               $argument = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Argument', array('dummy'), array('dummy', 'Text'));
+               $argument = new \TYPO3\CMS\Extbase\Mvc\Controller\Argument('dummy', 'Text');
                $this->enableDeprecatedPropertyMapperInArgument($argument);
                $returnedArgument = $argument->setValue('x');
                $this->assertSame($argument, $returnedArgument, 'The returned argument is not the original argument.');
@@ -82,7 +82,7 @@ class ArgumentBehaviorBeforeExtbase14Test extends \TYPO3\CMS\Extbase\Tests\Unit\
         * @author Karsten Dambekalns <karsten@typo3.org>
         */
        public function setValueUsesNullAsIs() {
-               $argument = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array('transformValue'), array('dummy', 'ArrayObject'));
+               $argument = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array('transformValue'), array('dummy', 'ArrayObject'));
                $this->enableDeprecatedPropertyMapperInArgument($argument);
                $argument->expects($this->never())->method('transformValue');
                $argument->setValue(NULL);
@@ -93,7 +93,7 @@ class ArgumentBehaviorBeforeExtbase14Test extends \TYPO3\CMS\Extbase\Tests\Unit\
         * @author Karsten Dambekalns <karsten@typo3.org>
         */
        public function setValueUsesMatchingInstanceAsIs() {
-               $argument = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array('transformValue'), array('dummy', 'ArrayObject'));
+               $argument = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array('transformValue'), array('dummy', 'ArrayObject'));
                $this->enableDeprecatedPropertyMapperInArgument($argument);
                $argument->expects($this->never())->method('transformValue');
                $argument->setValue(new \ArrayObject());
@@ -119,7 +119,7 @@ class ArgumentBehaviorBeforeExtbase14Test extends \TYPO3\CMS\Extbase\Tests\Unit\
         * @test
         */
        public function toStringReturnsTheStringVersionOfTheArgumentsValue() {
-               $argument = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Argument', array('dummy'), array('dummy', 'Text'));
+               $argument = new \TYPO3\CMS\Extbase\Mvc\Controller\Argument('dummy', 'Text');
                $this->enableDeprecatedPropertyMapperInArgument($argument);
                $argument->setValue(123);
                $this->assertSame((string) $argument, '123', 'The returned argument is not a string.');
@@ -130,11 +130,11 @@ class ArgumentBehaviorBeforeExtbase14Test extends \TYPO3\CMS\Extbase\Tests\Unit\
         * @test
         */
        public function setNewValidatorConjunctionCreatesANewValidatorConjunctionObject() {
-               $argument = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Argument', array('dummy'), array('dummy', 'Text'));
+               $argument = new \TYPO3\CMS\Extbase\Mvc\Controller\Argument('dummy', 'Text');
                $mockConjunctionValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ConjunctionValidator');
                $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
                $mockObjectManager->expects($this->once())->method('get')->with('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ConjunctionValidator')->will($this->returnValue($mockConjunctionValidator));
-               $argument->_set('objectManager', $mockObjectManager);
+               $argument->injectObjectManager($mockObjectManager);
                $argument->setNewValidatorConjunction(array());
                $this->assertSame($mockConjunctionValidator, $argument->getValidator());
        }
@@ -163,7 +163,7 @@ class ArgumentBehaviorBeforeExtbase14Test extends \TYPO3\CMS\Extbase\Tests\Unit\
                $mockObjectManager->expects($this->never())->method('create');
                $mockObjectManager->expects($this->at(0))->method('get')->with('Validator1')->will($this->returnValue($validator1));
                $mockObjectManager->expects($this->at(1))->method('get')->with('Validator2')->will($this->returnValue($validator2));
-               $argument->_set('objectManager', $mockObjectManager);
+               $argument->injectObjectManager($mockObjectManager);
                $argument->_set('validator', $mockValidatorConjunction);
                $argument->setNewValidatorConjunction(array('Validator1', 'Validator2'));
        }
@@ -185,7 +185,7 @@ class ArgumentBehaviorBeforeExtbase14Test extends \TYPO3\CMS\Extbase\Tests\Unit\
        protected function enableDeprecatedPropertyMapperInArgument(\TYPO3\CMS\Extbase\Mvc\Controller\Argument $argument) {
                $mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
                $mockConfigurationManager->expects($this->any())->method('isFeatureEnabled')->with('rewrittenPropertyMapper')->will($this->returnValue(FALSE));
-               $argument->_set('configurationManager', $mockConfigurationManager);
+               $argument->injectConfigurationManager($mockConfigurationManager);
        }
 }
 
index 2a10d55..7ca4c20 100644 (file)
@@ -48,15 +48,15 @@ class ArgumentTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
         * @author Sebastian Kurf├╝rst <sebastian@typo3.org>
         */
        public function setUp() {
-               $this->simpleValueArgument = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Argument', array('dummy'), array('someName', 'string'));
-               $this->objectArgument = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Argument', array('dummy'), array('someName', 'DateTime'));
+               $this->simpleValueArgument = new \TYPO3\CMS\Extbase\Mvc\Controller\Argument('someName', 'string');
+               $this->objectArgument = new \TYPO3\CMS\Extbase\Mvc\Controller\Argument('someName', 'DateTime');
                $this->mockPropertyMapper = $this->getMock('TYPO3\\CMS\\Extbase\\Property\\PropertyMapper');
-               $this->simpleValueArgument->_set('propertyMapper', $this->mockPropertyMapper);
-               $this->objectArgument->_set('propertyMapper', $this->mockPropertyMapper);
+               $this->simpleValueArgument->injectPropertyMapper($this->mockPropertyMapper);
+               $this->objectArgument->injectPropertyMapper($this->mockPropertyMapper);
                $this->mockConfiguration = new \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfiguration();
                $propertyMappingConfiguranion = new \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfiguration();
-               $this->simpleValueArgument->_set('propertyMappingConfiguration', $propertyMappingConfiguranion);
-               $this->objectArgument->_set('propertyMappingConfiguration', $propertyMappingConfiguranion);
+               $this->simpleValueArgument->injectPropertyMappingConfiguration($propertyMappingConfiguranion);
+               $this->objectArgument->injectPropertyMappingConfiguration($propertyMappingConfiguranion);
        }
 
        /**
@@ -173,7 +173,6 @@ class ArgumentTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
         */
        public function setValueUsesNullAsIs() {
                $this->simpleValueArgument = new \TYPO3\CMS\Extbase\Mvc\Controller\Argument('dummy', 'string');
-               $this->simpleValueArgument = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Argument', array('dummy'), array('dummy', 'string'));
                $this->enableRewrittenPropertyMapperInArgument($this->simpleValueArgument);
                $this->simpleValueArgument->setValue(NULL);
                $this->assertNull($this->simpleValueArgument->getValue());
@@ -299,7 +298,7 @@ class ArgumentTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        protected function enableRewrittenPropertyMapperInArgument(\TYPO3\CMS\Extbase\Mvc\Controller\Argument $argument) {
                $mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
                $mockConfigurationManager->expects($this->any())->method('isFeatureEnabled')->with('rewrittenPropertyMapper')->will($this->returnValue(TRUE));
-               $argument->_set('configurationManager', $mockConfigurationManager);
+               $argument->injectConfigurationManager($mockConfigurationManager);
        }
 }
 
index b9233be..a72e6f6 100644 (file)
@@ -69,8 +69,8 @@ class ArgumentsTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockArgument = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array(), array(), '', FALSE);
                $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
                $mockObjectManager->expects($this->once())->method('get')->with('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument')->will($this->returnValue($mockArgument));
-               $arguments = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Arguments', array('dummy'));
-               $arguments->_set('objectManager', $mockObjectManager);
+               $arguments = new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments();
+               $arguments->injectObjectManager($mockObjectManager);
                $newArgument = $arguments->addNewArgument('someArgument');
                $this->assertSame($newArgument, $mockArgument);
        }
@@ -169,8 +169,8 @@ class ArgumentsTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockArgument->expects($this->any())->method('getName')->will($this->returnValue('dummyName'));
                $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
                $mockObjectManager->expects($this->once())->method('get')->with('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument')->will($this->returnValue($mockArgument));
-               $arguments = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Arguments', array('dummy'));
-               $arguments->_set('objectManager', $mockObjectManager);
+               $arguments = new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments();
+               $arguments->injectObjectManager($mockObjectManager);
                $addedArgument = $arguments->addNewArgument('dummyName');
                $this->assertInstanceOf('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', $addedArgument, 'addNewArgument() either did not add a new argument or did not return it.');
                $retrievedArgument = $arguments['dummyName'];
@@ -185,8 +185,8 @@ class ArgumentsTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockArgument->expects($this->any())->method('getName')->will($this->returnValue('dummyName'));
                $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
                $mockObjectManager->expects($this->once())->method('get')->with('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', 'dummyName', 'Text')->will($this->returnValue($mockArgument));
-               $arguments = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Arguments', array('dummy'));
-               $arguments->_set('objectManager', $mockObjectManager);
+               $arguments = new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments();
+               $arguments->injectObjectManager($mockObjectManager);
                $arguments->addNewArgument('dummyName');
        }
 
@@ -199,8 +199,8 @@ class ArgumentsTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockArgument->expects($this->once())->method('setRequired')->with(TRUE);
                $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
                $mockObjectManager->expects($this->once())->method('get')->with('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', 'dummyName', 'Text')->will($this->returnValue($mockArgument));
-               $arguments = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Arguments', array('dummy'));
-               $arguments->_set('objectManager', $mockObjectManager);
+               $arguments = new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments();
+               $arguments->injectObjectManager($mockObjectManager);
                $arguments->addNewArgument('dummyName', 'Text', TRUE);
        }
 
@@ -214,8 +214,8 @@ class ArgumentsTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockArgument->expects($this->once())->method('setDefaultValue')->with('someDefaultValue');
                $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
                $mockObjectManager->expects($this->once())->method('get')->with('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', 'dummyName', 'Text')->will($this->returnValue($mockArgument));
-               $arguments = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Arguments', array('dummy'));
-               $arguments->_set('objectManager', $mockObjectManager);
+               $arguments = new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments();
+               $arguments->injectObjectManager($mockObjectManager);
                $arguments->addNewArgument('dummyName', 'Text', FALSE, 'someDefaultValue');
        }
 
index 3a91a17..55fc185 100644 (file)
@@ -281,20 +281,20 @@ class MvcPropertyMappingConfigurationServiceTest extends \TYPO3\CMS\Extbase\Test
                $mockHashService = $this->getMock('TYPO3\CMS\Extbase\Security\Cryptography\HashService', array('validateAndStripHmac'));
                $mockHashService->expects($this->once())->method('validateAndStripHmac')->with('fooTrustedProperties')->will($this->returnValue(serialize($trustedProperties)));
 
-               $requestHashService = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService', array('dummy'));
-               $requestHashService->_set('hashService', $mockHashService);
+               $requestHashService = new \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService();
+               $requestHashService->injectHashService($mockHashService);
 
                $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
-               $mockArgument = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array('getName'), array(), '', FALSE);
+               $mockArgument = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array('getName'), array(), '', FALSE);
 
                $propertyMappingConfiguration = new \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfiguration();
 
-               $mockArgument->_set('propertyMappingConfiguration', $propertyMappingConfiguration);
+               $mockArgument->injectPropertyMappingConfiguration($propertyMappingConfiguration);
                $mockArgument->expects($this->any())->method('getName')->will($this->returnValue('foo'));
                $mockObjectManager->expects($this->once())->method('get')->with('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument')->will($this->returnValue($mockArgument));
 
-               $arguments = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Arguments', array('dummy'));
-               $arguments->_set('objectManager', $mockObjectManager);
+               $arguments = new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments();
+               $arguments->injectObjectManager($mockObjectManager);
                $arguments->addNewArgument('foo');
 
                $requestHashService->initializePropertyMappingConfigurationFromRequest($request, $arguments);
index cae9e9b..e2ae629 100644 (file)
@@ -96,14 +96,14 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
         */
        protected function injectDependencies() {
                $this->mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration));
-               $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
+               $this->requestBuilder->injectConfigurationManager($this->mockConfigurationManager);
                $this->mockObjectManager->expects($this->any())->method('get')->with('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request')->will($this->returnValue($this->mockRequest));
-               $this->requestBuilder->_set('objectManager', $this->mockObjectManager);
+               $this->requestBuilder->injectObjectManager($this->mockObjectManager);
                $pluginNamespace = 'tx_' . strtolower(($this->configuration['extensionName'] . '_' . $this->configuration['pluginName']));
                $this->mockExtensionService->expects($this->any())->method('getPluginNamespace')->will($this->returnValue($pluginNamespace));
-               $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
+               $this->requestBuilder->injectExtensionService($this->mockExtensionService);
                $this->mockEnvironmentService->expects($this->any())->method('getServerRequestMethod')->will($this->returnValue('GET'));
-               $this->requestBuilder->_set('environmentService', $this->mockEnvironmentService);
+               $this->requestBuilder->injectEnvironmentService($this->mockEnvironmentService);
        }
 
        /**
@@ -179,7 +179,7 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $expectedMethod = 'SomeRequestMethod';
                $mockEnvironmentService = $this->getMock('TYPO3\\CMS\\Extbase\\Service\\EnvironmentService', array('getServerRequestMethod'));
                $mockEnvironmentService->expects($this->once())->method('getServerRequestMethod')->will($this->returnValue($expectedMethod));
-               $this->requestBuilder->_set('environmentService', $mockEnvironmentService);
+               $this->requestBuilder->injectEnvironmentService($mockEnvironmentService);
                $this->mockRequest->expects($this->once())->method('setMethod')->with($expectedMethod);
                $this->requestBuilder->build();
        }
@@ -193,8 +193,8 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->configuration['vendorName'] = $expectedVendor;
                $mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
                $mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration));
-               $this->requestBuilder->_set('configurationManager', $mockConfigurationManager);
-               $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
+               $this->requestBuilder->injectConfigurationManager($mockConfigurationManager);
+               $this->requestBuilder->injectExtensionService($this->mockExtensionService);
                $this->mockRequest->expects($this->once())->method('setControllerVendorName')->with($expectedVendor);
                $this->requestBuilder->build();
        }
@@ -209,7 +209,7 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
 
                $mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
                $mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration));
-               $this->requestBuilder->_set('configurationManager', $mockConfigurationManager);
+               $this->requestBuilder->injectConfigurationManager($mockConfigurationManager);
                $this->mockRequest->expects($this->once())->method('setControllerVendorName')->with($expectedVendor);
 
                $this->requestBuilder->build();
@@ -217,7 +217,7 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                unset($this->configuration['vendorName']);
                $mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
                $mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration));
-               $this->requestBuilder->_set('configurationManager', $mockConfigurationManager);
+               $this->requestBuilder->injectConfigurationManager($mockConfigurationManager);
 
                $this->mockRequest->expects($this->never())->method('setControllerVendorName');
                $this->requestBuilder->build();
@@ -231,7 +231,7 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                unset($this->configuration['extensionName']);
                $mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
                $mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration));
-               $this->requestBuilder->_set('configurationManager', $mockConfigurationManager);
+               $this->requestBuilder->injectConfigurationManager($mockConfigurationManager);
                $this->requestBuilder->build();
        }
 
@@ -243,8 +243,8 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                unset($this->configuration['pluginName']);
                $mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
                $mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration));
-               $this->requestBuilder->_set('configurationManager', $mockConfigurationManager);
-               $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
+               $this->requestBuilder->injectConfigurationManager($mockConfigurationManager);
+               $this->requestBuilder->injectExtensionService($this->mockExtensionService);
                $this->requestBuilder->build();
        }
 
@@ -255,8 +255,8 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        public function buildThrowsExceptionIfControllerConfigurationIsEmptyOrNotSet() {
                $this->configuration['controllerConfiguration'] = array();
                $this->mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration));
-               $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
-               $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
+               $this->requestBuilder->injectConfigurationManager($this->mockConfigurationManager);
+               $this->requestBuilder->injectExtensionService($this->mockExtensionService);
                $this->requestBuilder->build();
        }
 
@@ -267,8 +267,8 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        public function buildThrowsExceptionIfControllerConfigurationHasNoDefaultActionDefined() {
                $this->configuration['controllerConfiguration']['TheFirstController'] = array();
                $this->mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration));
-               $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
-               $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
+               $this->requestBuilder->injectConfigurationManager($this->mockConfigurationManager);
+               $this->requestBuilder->injectExtensionService($this->mockExtensionService);
                $this->requestBuilder->build();
        }
 
@@ -283,8 +283,8 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                        )
                );
                $this->mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration));
-               $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
-               $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
+               $this->requestBuilder->injectConfigurationManager($this->mockConfigurationManager);
+               $this->requestBuilder->injectExtensionService($this->mockExtensionService);
                $this->requestBuilder->build();
        }
 
@@ -382,9 +382,9 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        public function buildThrowsExceptionIfDefaultControllerCantBeDetermined() {
                $this->configuration['controllerConfiguration'] = array();
                $this->mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration));
-               $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
+               $this->requestBuilder->injectConfigurationManager($this->mockConfigurationManager);
                $this->mockExtensionService->expects($this->any())->method('getPluginNamespace')->will($this->returnValue('tx_myextension_pi1'));
-               $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
+               $this->requestBuilder->injectExtensionService($this->mockExtensionService);
                $this->requestBuilder->build();
        }
 
@@ -422,9 +422,9 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
         */
        public function buildThrowsInvalidControllerNameExceptionIfSpecifiedControllerIsNotAllowed() {
                $this->mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration));
-               $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
+               $this->requestBuilder->injectConfigurationManager($this->mockConfigurationManager);
                $this->mockExtensionService->expects($this->any())->method('getPluginNamespace')->will($this->returnValue('tx_myextension_pi1'));
-               $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
+               $this->requestBuilder->injectExtensionService($this->mockExtensionService);
                $_GET = array(
                        'tx_myextension_pi1' => array(
                                'controller' => 'SomeInvalidController'
@@ -440,9 +440,9 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        public function buildThrowsPageNotFoundExceptionIfEnabledAndSpecifiedControllerIsNotAllowed() {
                $this->configuration['mvc']['throwPageNotFoundExceptionIfActionCantBeResolved'] = 1;
                $this->mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration));
-               $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
+               $this->requestBuilder->injectConfigurationManager($this->mockConfigurationManager);
                $this->mockExtensionService->expects($this->any())->method('getPluginNamespace')->will($this->returnValue('tx_myextension_pi1'));
-               $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
+               $this->requestBuilder->injectExtensionService($this->mockExtensionService);
                $_GET = array(
                        'tx_myextension_pi1' => array(
                                'controller' => 'SomeInvalidController'
@@ -457,7 +457,7 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        public function buildSetsDefaultControllerNameIfSpecifiedControllerIsNotAllowedAndCallDefaultActionIfActionCantBeResolvedIsSet() {
                $this->configuration['mvc']['callDefaultActionIfActionCantBeResolved'] = 1;
                $this->injectDependencies();
-               $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
+               $this->requestBuilder->injectExtensionService($this->mockExtensionService);
                $_GET = array(
                        'tx_myextension_pi1' => array(
                                'controller' => 'SomeInvalidController'
@@ -474,9 +474,9 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        public function buildThrowsExceptionIfDefaultActionCantBeDetermined() {
                $this->configuration['controllerConfiguration'] = array();
                $this->mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration));
-               $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
+               $this->requestBuilder->injectConfigurationManager($this->mockConfigurationManager);
                $this->mockExtensionService->expects($this->any())->method('getPluginNamespace')->will($this->returnValue('tx_myextension_pi1'));
-               $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
+               $this->requestBuilder->injectExtensionService($this->mockExtensionService);
                $this->requestBuilder->build();
        }
 
@@ -529,9 +529,9 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
         */
        public function buildThrowsInvalidActionNameExceptionIfSpecifiedActionIsNotAllowed() {
                $this->mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration));
-               $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
+               $this->requestBuilder->injectConfigurationManager($this->mockConfigurationManager);
                $this->mockExtensionService->expects($this->any())->method('getPluginNamespace')->will($this->returnValue('tx_myextension_pi1'));
-               $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
+               $this->requestBuilder->injectExtensionService($this->mockExtensionService);
                $_GET = array(
                        'tx_myextension_pi1' => array(
                                'action' => 'someInvalidAction'
@@ -547,9 +547,9 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        public function buildThrowsPageNotFoundExceptionIfEnabledAndSpecifiedActionIsNotAllowed() {
                $this->configuration['mvc']['throwPageNotFoundExceptionIfActionCantBeResolved'] = 1;
                $this->mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration));
-               $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
+               $this->requestBuilder->injectConfigurationManager($this->mockConfigurationManager);
                $this->mockExtensionService->expects($this->any())->method('getPluginNamespace')->will($this->returnValue('tx_myextension_pi1'));
-               $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
+               $this->requestBuilder->injectExtensionService($this->mockExtensionService);
                $_GET = array(
                        'tx_myextension_pi1' => array(
                                'action' => 'someInvalidAction'
@@ -564,7 +564,7 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        public function buildSetsDefaultActionNameIfSpecifiedActionIsNotAllowedAndCallDefaultActionIfActionCantBeResolvedIsSet() {
                $this->configuration['mvc']['callDefaultActionIfActionCantBeResolved'] = 1;
                $this->injectDependencies();
-               $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
+               $this->requestBuilder->injectExtensionService($this->mockExtensionService);
                $_GET = array(
                        'tx_myextension_pi1' => array(
                                'controller' => 'TheThirdController',
index 994c1bc..3cafd26 100644 (file)
@@ -78,9 +78,9 @@ class UriBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->uriBuilder = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder', array('build'));
                $this->uriBuilder->setRequest($this->mockRequest);
                $this->uriBuilder->_set('contentObject', $this->mockContentObject);
-               $this->uriBuilder->_set('configurationManager', $this->mockConfigurationManager);
-               $this->uriBuilder->_set('extensionService', $this->mockExtensionService);
-               $this->uriBuilder->_set('environmentService', $this->objectManager->get('TYPO3\\CMS\\Extbase\\Service\\EnvironmentService'));
+               $this->uriBuilder->injectConfigurationManager($this->mockConfigurationManager);
+               $this->uriBuilder->injectExtensionService($this->mockExtensionService);
+               $this->uriBuilder->injectEnvironmentService($this->objectManager->get('TYPO3\\CMS\\Extbase\\Service\\EnvironmentService'));
        }
 
        public function tearDown() {
@@ -482,7 +482,7 @@ class UriBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager');
                $mockConfigurationManager->expects($this->any())->method('getConfiguration')
                        ->will($this->returnValue(array('view' => array('formatToPageTypeMapping' => array('txt' => 2)))));
-               $this->uriBuilder->_set('configurationManager', $mockConfigurationManager);
+               $this->uriBuilder->injectConfigurationManager($mockConfigurationManager);
 
                $this->mockExtensionService->expects($this->any())->method('getTargetPageTypeByFormat')
                        ->with(NULL, 'txt')
@@ -502,7 +502,7 @@ class UriBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
 
                $mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager');
                $mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue(array()));
-               $this->uriBuilder->_set('configurationManager', $mockConfigurationManager);
+               $this->uriBuilder->injectConfigurationManager($mockConfigurationManager);
 
                $this->mockExtensionService->expects($this->any())->method('getTargetPageTypeByFormat')
                        ->with(NULL, 'txt')
@@ -524,7 +524,7 @@ class UriBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager');
                $mockConfigurationManager->expects($this->any())->method('getConfiguration')
                        ->will($this->returnValue(array(array('view' => array('formatToPageTypeMapping' => array('pdf' => 2))))));
-               $this->uriBuilder->_set('configurationManager', $mockConfigurationManager);
+               $this->uriBuilder->injectConfigurationManager($mockConfigurationManager);
 
                $this->mockExtensionService->expects($this->any())->method('getTargetPageTypeByFormat')
                        ->with(NULL, 'txt')
index 26bfb58..bfdfeb2 100644 (file)
@@ -397,9 +397,9 @@ class DataMapFactoryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $configurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager');
                $configurationManager->expects($this->once())->method('getConfiguration')->with('Framework')->will($this->returnValue($configuration));
                $dataMapFactory = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Mapper\\DataMapFactory', array('test'));
-               $dataMapFactory->_set('reflectionService', new \TYPO3\CMS\Extbase\Reflection\ReflectionService());
-               $dataMapFactory->_set('objectManager', new \TYPO3\CMS\Extbase\Object\ObjectManager());
-               $dataMapFactory->_set('configurationManager', $configurationManager);
+               $dataMapFactory->injectReflectionService(new \TYPO3\CMS\Extbase\Reflection\ReflectionService());
+               $dataMapFactory->injectObjectManager(new \TYPO3\CMS\Extbase\Object\ObjectManager());
+               $dataMapFactory->injectConfigurationManager($configurationManager);
                $cacheMock = $this->getMock('TYPO3\\CMS\\Core\\Cache\\Frontend\\VariableFrontend', array(), array(), '', FALSE);
                $cacheMock->expects($this->any())->method('get')->will($this->returnValue(FALSE));
                $dataMapFactory->_set('dataMapCache', $cacheMock);
@@ -433,7 +433,7 @@ class DataMapFactoryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        public function createColumnMapReturnsAValidColumnMap() {
                /** @var $dataMapFactory \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory */
                $dataMapFactory = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Mapper\\DataMapFactory', array('dummy'));
-               $dataMapFactory->_set('objectManager', $this->objectManager);
+               $dataMapFactory->injectObjectManager($this->objectManager);
 
                $this->assertEquals(
                        new \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap('column', 'property'),
index 1e73d6b..d2a0fa8 100644 (file)
@@ -37,10 +37,10 @@ class DataMapperTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        public function mapMapsArrayToObjectByCallingmapToObject() {
                $rows = array(array('uid' => '1234'));
                $object = new \stdClass();
-               $dataMapper = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Mapper\\DataMapper', array('mapSingleRow', 'getTargetType'));
+               $dataMapper = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Mapper\\DataMapper', array('mapSingleRow', 'getTargetType'));
                $dataMapper->expects($this->any())->method('getTargetType')->will($this->returnArgument(1));
                $dataMapFactory = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Mapper\\DataMapFactory');
-               $dataMapper->_set('dataMapFactory', $dataMapFactory);
+               $dataMapper->injectDataMapFactory($dataMapFactory);
                $dataMapper->expects($this->once())->method('mapSingleRow')->with($rows[0])->will($this->returnValue($object));
                $dataMapper->map(get_class($object), $rows);
        }
@@ -55,7 +55,7 @@ class DataMapperTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $identityMap->expects($this->once())->method('hasIdentifier')->with('1234')->will($this->returnValue(TRUE));
                $identityMap->expects($this->once())->method('getObjectByIdentifier')->with('1234')->will($this->returnValue($object));
                $dataMapper = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Mapper\\DataMapper', array('dummy'));
-               $dataMapper->_set('identityMap', $identityMap);
+               $dataMapper->injectIdentityMap($identityMap);
                $dataMapper->_call('mapSingleRow', get_class($object), $row);
        }
 
@@ -85,9 +85,8 @@ class DataMapperTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $dataMaps = array(
                        $className => $dataMap
                );
-               /** @var \TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\TYPO3\CMS\Extbase\Reflection\ClassSchema $classSchema */
-               $classSchema = $this->getAccessibleMock('TYPO3\CMS\Extbase\Reflection\ClassSchema', array('dummy'), array($className));
-               $classSchema->_set('typeHandlingService', new \TYPO3\CMS\Extbase\Service\TypeHandlingService());
+               $classSchema = new \TYPO3\CMS\Extbase\Reflection\ClassSchema($className);
+               $classSchema->injectTypeHandlingService(new \TYPO3\CMS\Extbase\Service\TypeHandlingService());
                $classSchema->addProperty('pid', 'integer');
                $classSchema->addProperty('uid', 'integer');
                $classSchema->addProperty('firstProperty', 'string');
@@ -98,7 +97,7 @@ class DataMapperTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockReflectionService->expects($this->any())->method('getClassSchema')->will($this->returnValue($classSchema));
                $dataMapper = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Mapper\\DataMapper', array('dummy'));
                $dataMapper->_set('dataMaps', $dataMaps);
-               $dataMapper->_set('reflectionService', $mockReflectionService);
+               $dataMapper->injectReflectionService($mockReflectionService);
                $dataMapper->_call('thawProperties', $object, $row);
                $this->assertAttributeEquals('firstValue', 'firstProperty', $object);
                $this->assertAttributeEquals(1234, 'secondProperty', $object);
index 7af6bb0..b55e1e7 100644 (file)
@@ -45,8 +45,8 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
                $mockBackend = $this->getMock('TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface');
                $mockBackend->expects($this->once())->method('setAggregateRootObjects')->with($objectStorage);
 
-               $manager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy'));
-               $manager->_set('backend', $mockBackend);
+               $manager = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager();
+               $manager->injectBackend($mockBackend);
                $manager->add($entity2);
 
                $manager->persistAll();
@@ -62,8 +62,8 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
                $mockBackend = $this->getMock('TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface');
                $mockBackend->expects($this->once())->method('setDeletedEntities')->with($objectStorage);
 
-               $manager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy'));
-               $manager->_set('backend', $mockBackend);
+               $manager = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager();
+               $manager->injectBackend($mockBackend);
                $manager->remove($entity2);
 
                $manager->persistAll();
@@ -79,9 +79,8 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
                $mockSession = $this->getMock('TYPO3\CMS\Extbase\Persistence\Generic\Session');
                $mockSession->expects($this->once())->method('getIdentifierByObject')->with($object)->will($this->returnValue($fakeUuid));
 
-               /** @var \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface $manager */
-               $manager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy'));
-               $manager->_set('persistenceSession', $mockSession);
+               $manager = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager();
+               $manager->injectPersistenceSession($mockSession);
 
                $this->assertEquals($manager->getIdentifierByObject($object), $fakeUuid);
        }
@@ -97,8 +96,8 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
                $mockSession->expects($this->once())->method('hasIdentifier')->with($fakeUuid)->will($this->returnValue(TRUE));
                $mockSession->expects($this->once())->method('getObjectByIdentifier')->with($fakeUuid)->will($this->returnValue($object));
 
-               $manager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy'));
-               $manager->_set('persistenceSession', $mockSession);
+               $manager = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager();
+               $manager->injectPersistenceSession($mockSession);
 
                $this->assertEquals($manager->getObjectByIdentifier($fakeUuid), $object);
        }
@@ -117,9 +116,9 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
                $mockBackend = $this->getMock('TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface');
                $mockBackend->expects($this->once())->method('getObjectByIdentifier')->with($fakeUuid, $fakeEntityType)->will($this->returnValue($object));
 
-               $manager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy'));
-               $manager->_set('persistenceSession', $mockSession);
-               $manager->_set('backend', $mockBackend);
+               $manager = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager();
+               $manager->injectPersistenceSession($mockSession);
+               $manager->injectBackend($mockBackend);
 
                $this->assertEquals($manager->getObjectByIdentifier($fakeUuid, $fakeEntityType), $object);
        }
@@ -137,9 +136,9 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
                $mockBackend = $this->getMock('TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface');
                $mockBackend->expects($this->once())->method('getObjectByIdentifier')->with($fakeUuid, $fakeEntityType)->will($this->returnValue(NULL));
 
-               $manager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy'));
-               $manager->_set('persistenceSession', $mockSession);
-               $manager->_set('backend', $mockBackend);
+               $manager = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager();
+               $manager->injectPersistenceSession($mockSession);
+               $manager->injectBackend($mockBackend);
 
                $this->assertNull($manager->getObjectByIdentifier($fakeUuid, $fakeEntityType));
        }
@@ -230,21 +229,20 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
                $classNameWithNamespace = 'Foo\\Bar\\Domain\\Model\\' . $className;
                $repositorClassNameWithNamespace = 'Foo\\Bar\\Domain\\Repository\\' . $className . 'Repository';
 
-               $persistenceManager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy'));
+               $persistenceManager = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager();
                $session = new \TYPO3\CMS\Extbase\Persistence\Generic\Session();
                $changedEntities = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
                $entity1 = new $classNameWithNamespace();
-               $repository = $this->getAccessibleMock($repositorClassNameWithNamespace, array('dummy'));
-               $repository->_set('objectType', get_class($entity1));
+               $repository = new $repositorClassNameWithNamespace;
                $mockBackend = $this->getMock($this->buildAccessibleProxy('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Backend'), array('commit', 'setChangedEntities'), array(), '', FALSE);
                $mockBackend->expects($this->once())
                        ->method('setChangedEntities')
                        ->with($this->equalTo($changedEntities));
 
-               $persistenceManager->_set('backend', $mockBackend);
-               $persistenceManager->_set('persistenceSession', $session);
+               $persistenceManager->injectBackend($mockBackend);
+               $persistenceManager->injectPersistenceSession($session);
+               $repository->injectPersistenceManager($persistenceManager);
 
-               $repository->_set('persistenceManager', $persistenceManager);
                $session->registerObject($entity1, 42);
                $changedEntities->attach($entity1);
                $repository->update($entity1);
@@ -264,9 +262,9 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
                $mockBackend = $this->getMock('TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface');
                $mockBackend->expects($this->any())->method('getObjectDataByIdentifier')->will($this->returnValue(FALSE));
 
-               $persistenceManager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy'));
-               $persistenceManager->_set('persistenceSession', $mockSession);
-               $persistenceManager->_set('backend', $mockBackend);
+               $persistenceManager = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager();
+               $persistenceManager->injectPersistenceSession($mockSession);
+               $persistenceManager->injectBackend($mockBackend);
 
                $persistenceManager->registerNewObject($mockObject);
                $persistenceManager->clearState();
@@ -282,8 +280,8 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
                $mockBackend = $this->getMock('TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface');
                $mockBackend->expects($this->never())->method('tearDown');
 
-               $persistenceManager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy'));
-               $persistenceManager->_set('backend', $mockBackend);
+               $persistenceManager = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager();
+               $persistenceManager->injectBackend($mockBackend);
 
                $persistenceManager->tearDown();
        }
@@ -296,8 +294,8 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
                $mockBackend = $this->getMock('TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface', $methods);
                $mockBackend->expects($this->once())->method('tearDown');
 
-               $persistenceManager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy'));
-               $persistenceManager->_set('backend', $mockBackend);
+               $persistenceManager = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager();
+               $persistenceManager->injectBackend($mockBackend);
 
                $persistenceManager->tearDown();
        }
@@ -317,7 +315,7 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
                eval ('
                        class Foo_Bar_Domain_Repository_' . $className . 'Repository {}
                ');
-               $persistenceManager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy'));
+               $persistenceManager = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager();
                $aggregateRootObjects = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
                $fullClassName = 'Foo_Bar_Domain_Model_' . $className;
                $entity1 = new $fullClassName();
@@ -326,7 +324,7 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
                $mockBackend->expects($this->once())
                        ->method('setAggregateRootObjects')
                        ->with($this->equalTo($aggregateRootObjects));
-               $persistenceManager->_set('backend', $mockBackend);
+               $persistenceManager->injectBackend($mockBackend);
                $persistenceManager->add($entity1);
                $persistenceManager->persistAll();
        }
@@ -344,7 +342,7 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
                        namespace Foo\\Bar\\Domain\\Repository;
                        class  ' . $className . 'Repository {}
                ');
-               $persistenceManager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy'));
+               $persistenceManager = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager();
                $aggregateRootObjects = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
                $classNameWithNamespace = 'Foo\\Bar\\Domain\\Model\\' . $className;
                $entity1 = new $classNameWithNamespace();
@@ -353,7 +351,7 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
                $mockBackend->expects($this->once())
                        ->method('setAggregateRootObjects')
                        ->with($this->equalTo($aggregateRootObjects));
-               $persistenceManager->_set('backend', $mockBackend);
+               $persistenceManager->injectBackend($mockBackend);
                $persistenceManager->add($entity1);
                $persistenceManager->persistAll();
        }
index 559b725..5060ded 100644 (file)
@@ -60,17 +60,17 @@ class QueryFactoryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        protected function setUp() {
                $this->dataMap = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Mapper\\DataMap', array('getIsStatic', 'getRootLevel'), array('Vendor\\Ext\\Domain\\Model\\ClubMate', 'tx_ext_domain_model_clubmate'));
 
-               $this->queryFactory = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\QueryFactory', array('dummy'));
-               $this->queryFactory->_set('configurationManager',
+               $this->queryFactory = new \TYPO3\CMS\Extbase\Persistence\Generic\QueryFactory();
+               $this->queryFactory->injectConfigurationManager(
                        $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface')
                );
 
                $this->objectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
-               $this->queryFactory->_set('objectManager', $this->objectManager);
+               $this->queryFactory->injectObjectManager($this->objectManager);
 
                $this->dataMapper = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Mapper\\DataMapper', array('getDataMap', 'convertClassNameToTableName'));
                $this->dataMapper->expects($this->any())->method('getDataMap')->will($this->returnValue($this->dataMap));
-               $this->queryFactory->_set('dataMapper', $this->dataMapper);
+               $this->queryFactory->injectDataMapper($this->dataMapper);
        }
 
        protected function tearDown() {
index 55cd9f7..a54ddf1 100644 (file)
@@ -61,9 +61,9 @@ class QueryResultTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->mockPersistenceManager->expects($this->any())->method('getObjectCountByQuery')->will($this->returnValue(2));
                $this->mockDataMapper = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Mapper\\DataMapper');
                $this->mockQuery = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\QueryInterface');
-               $this->queryResult = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\QueryResult', array('dummy'), array($this->mockQuery));
-               $this->queryResult->_set('persistenceManager', $this->mockPersistenceManager);
-               $this->queryResult->_set('dataMapper', $this->mockDataMapper);
+               $this->queryResult = new \TYPO3\CMS\Extbase\Persistence\Generic\QueryResult($this->mockQuery);
+               $this->queryResult->injectPersistenceManager($this->mockPersistenceManager);
+               $this->queryResult->injectDataMapper($this->mockDataMapper);
                $this->sampleResult = array(array('foo' => 'Foo1', 'bar' => 'Bar1'), array('foo' => 'Foo2', 'bar' => 'Bar2'));
                $this->mockDataMapper->expects($this->any())->method('map')->will($this->returnValue($this->sampleResult));
        }
@@ -120,8 +120,8 @@ class QueryResultTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
         * @test
         */
        public function countDoesNotInitializeProxy() {
-               $queryResult = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QueryResult', array('initialize'), array($this->mockQuery));
-               $queryResult->_set('persistenceManager', $this->mockPersistenceManager);
+               $queryResult = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QueryResult', array('initialize'), array($this->mockQuery));
+               $queryResult->injectPersistenceManager($this->mockPersistenceManager);
                $queryResult->expects($this->never())->method('initialize');
                $queryResult->count();
        }
@@ -130,8 +130,8 @@ class QueryResultTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
         * @test
         */
        public function countCallsGetObjectCountByQueryOnPersistenceManager() {
-               $queryResult = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QueryResult', array('initialize'), array($this->mockQuery));
-               $queryResult->_set('persistenceManager', $this->mockPersistenceManager);
+               $queryResult = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QueryResult', array('initialize'), array($this->mockQuery));
+               $queryResult->injectPersistenceManager($this->mockPersistenceManager);
                $this->assertEquals(2, $queryResult->count());
        }
 
@@ -162,8 +162,8 @@ class QueryResultTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        public function initializeExecutesQueryWithArrayFetchMode() {
                /** @var \TYPO3\CMS\Extbase\Persistence\Generic\QueryResult|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
                $queryResult = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QueryResult', array('dummy'), array($this->mockQuery));
-               $queryResult->_set('persistenceManager', $this->mockPersistenceManager);
-               $queryResult->_set('dataMapper', $this->mockDataMapper);
+               $queryResult->injectPersistenceManager($this->mockPersistenceManager);
+               $queryResult->injectDataMapper($this->mockDataMapper);
                $this->mockPersistenceManager->expects($this->once())->method('getObjectDataByQuery')->with($this->mockQuery)->will($this->returnValue(array('FAKERESULT')));
                $queryResult->_call('initialize');
        }
index ffe06e7..85f0174 100644 (file)
@@ -63,18 +63,17 @@ class QueryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
         */
        public function setUp() {
                $this->objectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
-
-               $this->query = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\Query', array('dummy'), array('someType'));
-               $this->query->_set('objectManager', $this->objectManager);
+               $this->query = new \TYPO3\CMS\Extbase\Persistence\Generic\Query('someType');
+               $this->query->injectObjectManager($this->objectManager);
                $this->querySettings = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QuerySettingsInterface');
-               $this->query->_set('querySettings', $this->querySettings);
+               $this->query->setQuerySettings($this->querySettings);
                $this->persistenceManager = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\PersistenceManagerInterface');
                $this->backend = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\BackendInterface');
                $this->backend->expects($this->any())->method('getQomFactory')->will($this->returnValue(NULL));
                $this->persistenceManager->expects($this->any())->method('getBackend')->will($this->returnValue($this->backend));
-               $this->query->_set('persistenceManager', $this->persistenceManager);
+               $this->query->injectPersistenceManager($this->persistenceManager);
                $this->dataMapper = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Mapper\\DataMapper');
-               $this->query->_set('dataMapper', $this->dataMapper);
+               $this->query->injectDataMapper($this->dataMapper);
        }
 
        /**
@@ -153,10 +152,10 @@ class QueryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
         */
        public function equalsForCaseSensitiveFalseLowercasesOperand($propertyName, $operand, $expectedOperand) {
                /** @var $qomFactory \TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelFactory */
-               $qomFactory = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Qom\\QueryObjectModelFactory', array('comparison'));
-               $qomFactory->_set('objectManager', \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager'));
+               $qomFactory = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Qom\\QueryObjectModelFactory', array('comparison'));
+               $qomFactory->injectObjectManager(\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager'));
                $qomFactory->expects($this->once())->method('comparison')->with($this->anything(), $this->anything(), $expectedOperand);
-               $this->query->_set('qomFactory', $qomFactory);
+               $this->query->injectQomFactory($qomFactory);
                $this->query->equals($propertyName, $operand, FALSE);
        }
 }
index 29c365d..2437317 100644 (file)
@@ -336,7 +336,7 @@ class Typo3DbBackendTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
 
                /** @var $mockTypo3DbBackend \TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend | \PHPUnit_Framework_MockObject_MockObject */
                $mockTypo3DbBackend = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Storage\\Typo3DbBackend', array('dummy'), array(), '', FALSE);
-               $mockTypo3DbBackend->_set('environmentService', $mockEnvironmentService);
+               $mockTypo3DbBackend->injectEnvironmentService($mockEnvironmentService);
                $mockTypo3DbBackend->_callRef('addVisibilityConstraintStatement', $mockQuerySettings, $tableName, $sql);
                $this->assertSame($expectedSql, $sql['additionalWhereClause']);
                unset($GLOBALS['TCA'][$tableName]);
@@ -377,7 +377,7 @@ class Typo3DbBackendTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
 
                /** @var $mockTypo3DbBackend \TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend | \PHPUnit_Framework_MockObject_MockObject */
                $mockTypo3DbBackend = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Storage\\Typo3DbBackend', array('dummy'), array(), '', FALSE);
-               $mockTypo3DbBackend->_set('environmentService', $mockEnvironmentService);
+               $mockTypo3DbBackend->injectEnvironmentService($mockEnvironmentService);
                $mockTypo3DbBackend->_callRef('addVisibilityConstraintStatement', $mockQuerySettings, $tableName, $sql);
                $this->assertSame($expectedSql, $sql['additionalWhereClause']);
                unset($GLOBALS['TCA'][$tableName]);
@@ -407,7 +407,7 @@ class Typo3DbBackendTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
 
                /** @var $mockTypo3DbBackend \TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend | \PHPUnit_Framework_MockObject_MockObject */
                $mockTypo3DbBackend = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Storage\\Typo3DbBackend', array('dummy'), array(), '', FALSE);
-               $mockTypo3DbBackend->_set('environmentService', $mockEnvironmentService);
+               $mockTypo3DbBackend->injectEnvironmentService($mockEnvironmentService);
                $mockTypo3DbBackend->_callRef('addVisibilityConstraintStatement', $mockQuerySettings, $tableName, $sql);
                unset($GLOBALS['TCA'][$tableName]);
        }
index 722f8b8..f616076 100644 (file)
@@ -88,7 +88,7 @@ class RepositoryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->mockPersistenceManager->expects($this->any())->method('createQueryForType')->will($this->returnValue($this->mockQuery));
                $this->mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
                $this->repository = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Persistence\\Repository', array('dummy'), array($this->mockObjectManager));
-               $this->repository->_set('persistenceManager', $this->mockPersistenceManager);
+               $this->repository->injectPersistenceManager($this->mockPersistenceManager);
        }
 
        /**
index 4d577ca..425dd66 100644 (file)
@@ -53,18 +53,18 @@ class MapperTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $queryFactory = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QueryFactory');
 
                /** @var \TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService */
-               $reflectionService = $this-> getAccessibleMock('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService');
-               $reflectionService->_set('objectManager', $objectManager);
+               $reflectionService = $this->getMock('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService');
+               $reflectionService->injectObjectManager($objectManager);
 
                /** @var \TYPO3\CMS\Extbase\Validation\ValidatorResolver $validatorResolver */
                $validatorResolver = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver');
 
-               $this->fixture = $this->getAccessibleMock('TYPO3\CMS\Extbase\Property\Mapper', array('dummy'));
-               $this->fixture->_set('objectManager', $objectManager);
-               $this->fixture->_set('persistenceManager', $persistenceManager);
-               $this->fixture->_set('queryFactory', $queryFactory);
-               $this->fixture->_set('reflectionService', $reflectionService);
-               $this->fixture->_set('validatorResolver', $validatorResolver);
+               $this->fixture = new \TYPO3\CMS\Extbase\Property\Mapper();
+               $this->fixture->injectObjectManager($objectManager);
+               $this->fixture->injectPersistenceManager($persistenceManager);
+               $this->fixture->injectQueryFactory($queryFactory);
+               $this->fixture->injectReflectionService($reflectionService);
+               $this->fixture->injectValidatorResolver($validatorResolver);
        }
 
        public function tearDown() {
index 7539daa..d3cd6d1 100644 (file)
@@ -89,8 +89,8 @@ class ReflectionServiceTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                        class ' . $className . 'Repository {}
                ');
 
-               $service = $this->getAccessibleMock('TYPO3\CMS\Extbase\Reflection\ReflectionService', array('dummy'));
-               $service->_set('objectManager', $this->objectManager);
+               $service = new \TYPO3\CMS\Extbase\Reflection\ReflectionService();
+               $service->injectObjectManager($this->objectManager);
                $classSchema = $service->getClassSchema('Foo\\Bar\\Domain\\Model\\' . $className);
                $this->assertTrue($classSchema->isAggregateRoot());
        }
@@ -107,8 +107,8 @@ class ReflectionServiceTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                        class Foo_Bar_Domain_Repository_' . $className . 'Repository {}
                ');
 
-               $service = $this->getAccessibleMock('TYPO3\CMS\Extbase\Reflection\ReflectionService', array('dummy'));
-               $service->_set('objectManager', $this->objectManager);
+               $service = new \TYPO3\CMS\Extbase\Reflection\ReflectionService();
+               $service->injectObjectManager($this->objectManager);
                $classSchema = $service->getClassSchema('Foo_Bar_Domain_Model_' . $className);
                $this->assertTrue($classSchema->isAggregateRoot());
        }
index a023bc1..ee15006 100644 (file)
@@ -78,19 +78,19 @@ class FieldProviderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                        FALSE
                );
 
-               $this->command1 = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Cli\Command', array('isInternal'), array('TYPO3\\CMS\\Extbase\\Tests\\MockACommandController', 'FuncA'));
-               $this->command1->_set('objectManager', $this->objectManager);
-               $this->command1->_set('reflectionService', $this->objectManager->get('TYPO3\CMS\Extbase\Reflection\ReflectionService'));
+               $this->command1 = $this->getMock('TYPO3\CMS\Extbase\Mvc\Cli\Command', array('isInternal'), array('TYPO3\\CMS\\Extbase\\Tests\\MockACommandController', 'FuncA'));
+               $this->command1->injectObjectManager($this->objectManager);
+               $this->command1->injectReflectionService($this->objectManager->get('TYPO3\CMS\Extbase\Reflection\ReflectionService'));
                $this->command1->expects($this->any())->method('isInternal')->will($this->returnValue(FALSE));
 
-               $this->command2 = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Cli\Command', array('isInternal'), array('Acme\\Mypkg\\Command\\MockBCommandController', 'FuncB'));
-               $this->command2->_set('objectManager', $this->objectManager);
-               $this->command2->_set('reflectionService', $this->objectManager->get('TYPO3\CMS\Extbase\Reflection\ReflectionService'));
+               $this->command2 = $this->getMock('TYPO3\CMS\Extbase\Mvc\Cli\Command', array('isInternal'), array('Acme\\Mypkg\\Command\\MockBCommandController', 'FuncB'));
+               $this->command2->injectObjectManager($this->objectManager);
+               $this->command2->injectReflectionService($this->objectManager->get('TYPO3\CMS\Extbase\Reflection\ReflectionService'));
                $this->command2->expects($this->any())->method('isInternal')->will($this->returnValue(FALSE));
 
-               $this->command3 = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Cli\Command', array('isInternal'), array('Tx_Extbase_Command_MockCCommandController', 'FuncC'));
-               $this->command3->_set('objectManager', $this->objectManager);
-               $this->command3->_set('reflectionService', $this->objectManager->get('TYPO3\CMS\Extbase\Reflection\ReflectionService'));
+               $this->command3 = $this->getMock('TYPO3\CMS\Extbase\Mvc\Cli\Command', array('isInternal'), array('Tx_Extbase_Command_MockCCommandController', 'FuncC'));
+               $this->command3->injectObjectManager($this->objectManager);
+               $this->command3->injectReflectionService($this->objectManager->get('TYPO3\CMS\Extbase\Reflection\ReflectionService'));
                $this->command3->expects($this->any())->method('isInternal')->will($this->returnValue(FALSE));
 
                $this->commandManager->expects($this->any())->method('getAvailableCommands')->will($this->returnValue(array($this->command1, $this->command2, $this->command3)));
index 38bf6ba..b0febc1 100644 (file)
@@ -66,8 +66,8 @@ class TaskExecutorTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
 
        public function setUp() {
                $this->controller = $this->getAccessibleMock('TYPO3\CMS\Extbase\Tests\MockACommandController', array('dummy'));
-               $this->controller->_set('reflectionService', $this->objectManager->get('TYPO3\CMS\Extbase\Reflection\ReflectionService'));
-               $this->controller->_set('objectManager', $this->objectManager);
+               $this->controller->injectReflectionService($this->objectManager->get('TYPO3\CMS\Extbase\Reflection\ReflectionService'));
+               $this->controller->injectObjectManager($this->objectManager);
 
                $command = new \TYPO3\CMS\Extbase\Mvc\Cli\Command('TYPO3\CMS\Extbase\Tests\MockACommandController', 'funcA');
                $nullBackend = new \TYPO3\CMS\Core\Cache\Backend\NullBackend('production');
@@ -98,15 +98,15 @@ class TaskExecutorTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
         * @author Alexander Schnitzler <alex.schnitzler@typovision.de>
         */
        public function executeDispatchesTheRightCommandControllerAndCommandAction() {
-               $dispatcher = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Dispatcher', array('resolveController'), array($this->objectManager));
+               $dispatcher = $this->getMock('TYPO3\CMS\Extbase\Mvc\Dispatcher', array('resolveController'), array($this->objectManager));
                $dispatcher->expects($this->any())->method('resolveController')->will($this->returnValue($this->controller));
-               $dispatcher->_set('signalSlotDispatcher', $this->objectManager->get('TYPO3\CMS\Extbase\SignalSlot\Dispatcher'));
+               $dispatcher->injectSignalSlotDispatcher($this->objectManager->get('TYPO3\CMS\Extbase\SignalSlot\Dispatcher'));
 
                $this->taskExecuter = $this->getAccessibleMock('TYPO3\CMS\Extbase\Scheduler\TaskExecutor', array('dummy', 'shutdown', 'getDispatcher'));
                $this->taskExecuter->expects($this->any())->method('getDispatcher')->will($this->returnValue($dispatcher));
-               $this->taskExecuter->_set('objectManager', $this->objectManager);
-               $this->taskExecuter->_set('commandManager', $this->commandManager);
-               $this->taskExecuter->_set('configurationManager', $this->configurationManager);
+               $this->taskExecuter->injectObjectManager($this->objectManager);
+               $this->taskExecuter->injectCommandManager($this->commandManager);
+               $this->taskExecuter->injectConfigurationManager($this->configurationManager);
                $this->taskExecuter->initializeObject();
 
                /** @var $task \TYPO3\CMS\Extbase\Scheduler\Task|\PHPUnit_Framework_MockObject_MockObject */
index 4121235..564d337 100644 (file)
@@ -47,9 +47,9 @@ class ExtensionServiceTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->typo3DbBackup = $GLOBALS['TYPO3_DB'];
                $GLOBALS['TYPO3_DB'] = $this->getMock('TYPO3\\CMS\\Core\\Database\\DatabaseConnection', array('fullQuoteStr', 'exec_SELECTgetRows'));
                $GLOBALS['TSFE'] = new \stdClass();
-               $this->extensionService = $this->getAccessibleMock('TYPO3\CMS\Extbase\Service\ExtensionService', array('dummy'));
+               $this->extensionService = new \TYPO3\CMS\Extbase\Service\ExtensionService();
                $this->mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
-               $this->extensionService->_set('configurationManager', $this->mockConfigurationManager);
+               $this->extensionService->injectConfigurationManager($this->mockConfigurationManager);
                $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions'] = array(
                        'ExtensionName' => array(
                                'plugins' => array(
index 182df9c..f3cc41b 100644 (file)
@@ -45,7 +45,7 @@ class ValidatorResolverTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        public function setUp() {
                $this->validatorResolver = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array('dummy'));
                $this->mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
-               $this->validatorResolver->_set('objectManager', $this->mockObjectManager);
+               $this->validatorResolver->injectObjectManager($this->mockObjectManager);
        }
 
        /****************/
@@ -162,7 +162,7 @@ class ValidatorResolverTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockValidator->expects($this->once())->method('setOptions')->with(array('foo' => 'bar'));
                $this->mockObjectManager->expects($this->any())->method('get')->with($className)->will($this->returnValue($mockValidator));
                $validatorResolver = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array('resolveValidatorObjectName'));
-               $validatorResolver->_set('objectManager', $this->mockObjectManager);
+               $validatorResolver->injectObjectManager($this->mockObjectManager);
                $validatorResolver->expects($this->once())->method('resolveValidatorObjectName')->with($className)->will($this->returnValue($className));
                $validator = $validatorResolver->createValidator($className, array('foo' => 'bar'));
                $this->assertSame($mockValidator, $validator);
@@ -201,8 +201,8 @@ class ValidatorResolverTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $methodParameters = array();
                $mockReflectionService = $this->getMock('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService', array(), array(), '', FALSE);
                $mockReflectionService->expects($this->once())->method('getMethodParameters')->with(get_class($mockController), 'fooAction')->will($this->returnValue($methodParameters));
-               $validatorResolver = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array('createValidator'));
-               $validatorResolver->_set('reflectionService', $mockReflectionService);
+               $validatorResolver = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array('createValidator'));
+               $validatorResolver->injectReflectionService($mockReflectionService);
                $result = $validatorResolver->buildMethodArgumentsValidatorConjunctions(get_class($mockController), 'fooAction');
                $this->assertSame(array(), $result);
        }
@@ -250,7 +250,7 @@ class ValidatorResolverTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockArguments = new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments();
                $mockArguments->addArgument(new \TYPO3\CMS\Extbase\Mvc\Controller\Argument('arg1', 'dummyValue'));
                $mockArguments->addArgument(new \TYPO3\CMS\Extbase\Mvc\Controller\Argument('arg2', 'dummyValue'));
-               $validatorResolver = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array('createValidator'));
+               $validatorResolver = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array('createValidator'));
                $validatorResolver->expects($this->at(0))->method('createValidator')->with('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ConjunctionValidator')->will($this->returnValue($conjunction1));
                $validatorResolver->expects($this->at(1))->method('createValidator')->with('string')->will($this->returnValue($mockStringValidator));
                $validatorResolver->expects($this->at(2))->method('createValidator')->with('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ConjunctionValidator')->will($this->returnValue($conjunction2));
@@ -258,7 +258,7 @@ class ValidatorResolverTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $validatorResolver->expects($this->at(4))->method('createValidator')->with('Foo', array('bar' => 'baz'))->will($this->returnValue($mockFooValidator));
                $validatorResolver->expects($this->at(5))->method('createValidator')->with('Bar')->will($this->returnValue($mockBarValidator));
                $validatorResolver->expects($this->at(6))->method('createValidator')->with('VENDOR\\ModelCollection\\Domain\\Model\\Model')->will($this->returnValue($mockQuuxValidator));
-               $validatorResolver->_set('reflectionService', $mockReflectionService);
+               $validatorResolver->injectReflectionService($mockReflectionService);
                $result = $validatorResolver->buildMethodArgumentsValidatorConjunctions(get_class($mockObject), 'fooAction');
                $this->assertEquals(array('arg1' => $conjunction1, 'arg2' => $conjunction2), $result);
        }
@@ -290,11 +290,11 @@ class ValidatorResolverTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockQuuxValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array(), array(), '', FALSE);
                $conjunction1 = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ConjunctionValidator', array(), array(), '', FALSE);
                $conjunction1->expects($this->at(0))->method('addValidator')->with($mockStringValidator);
-               $validatorResolver = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array('createValidator'));
+               $validatorResolver = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array('createValidator'));
                $validatorResolver->expects($this->at(0))->method('createValidator')->with('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ConjunctionValidator')->will($this->returnValue($conjunction1));
                $validatorResolver->expects($this->at(1))->method('createValidator')->with('string')->will($this->returnValue($mockStringValidator));
                $validatorResolver->expects($this->at(2))->method('createValidator')->with('VENDOR\\ModelCollection\\Domain\\Model\\Model')->will($this->returnValue($mockQuuxValidator));
-               $validatorResolver->_set('reflectionService', $mockReflectionService);
+               $validatorResolver->injectReflectionService($mockReflectionService);
                $validatorResolver->buildMethodArgumentsValidatorConjunctions(get_class($mockObject), 'fooAction');
        }
 
@@ -330,8 +330,8 @@ class ValidatorResolverTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface', array(), array(), '', FALSE);
                $mockObjectManager->expects($this->at(0))->method('get')->with('TYPO3\\CMS\\Extbase\\Validation\\Validator\\GenericObjectValidator')->will($this->returnValue($mockObjectValidator));
                $validatorResolver = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array('resolveValidatorObjectName', 'createValidator'));
-               $validatorResolver->_set('reflectionService', $mockReflectionService);
-               $validatorResolver->_set('objectManager', $mockObjectManager);
+               $validatorResolver->injectReflectionService($mockReflectionService);
+               $validatorResolver->injectObjectManager($mockObjectManager);
                $validatorResolver->expects($this->at(0))->method('createValidator')->with('Foo', array('bar' => 'baz'))->will($this->returnValue($mockObjectValidator));
                $validatorResolver->expects($this->at(1))->method('createValidator')->with('Bar')->will($this->returnValue($mockObjectValidator));
                $validatorResolver->expects($this->at(2))->method('createValidator')->with('Baz')->will($this->returnValue($mockObjectValidator));
@@ -362,7 +362,7 @@ class ValidatorResolverTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        public function buildBaseValidatorConjunctionCreatesValidatorFromClassName($modelClassName, $validatorClassName) {
                $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface', array(), array(), '', FALSE);
                $validatorResolver = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array('resolveValidatorObjectName', 'createValidator'));
-               $validatorResolver->_set('objectManager', $mockObjectManager);
+               $validatorResolver->injectObjectManager($mockObjectManager);
                $validatorResolver->expects($this->once())->method('createValidator')->with($validatorClassName)->will($this->returnValue(NULL));
                $validatorResolver->_call('buildBaseValidatorConjunction', $modelClassName, $modelClassName);
        }
index e9cea3f..1b56c40 100644 (file)
@@ -49,7 +49,7 @@ class AbstractWidgetControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTes
                $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->_set('mvcPropertyMappingConfigurationService', $configurationService);
+               $abstractWidgetController->injectMvcPropertyMappingConfigurationService($configurationService);
                $abstractWidgetController->_set('arguments', new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments());
 
                $abstractWidgetController->_set('objectManager', $objectManager);
@@ -79,7 +79,7 @@ class AbstractWidgetControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTes
                $configurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($frameworkConfiguration));
                $view = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('dummy'));
                $abstractWidgetController = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\AbstractWidgetController', array('dummy'));
-               $abstractWidgetController->_set('configurationManager', $configurationManager);
+               $abstractWidgetController->injectConfigurationManager($configurationManager);
                $abstractWidgetController->_set('request', $request);
                $abstractWidgetController->_call('setViewConfiguration', $view);
                $this->assertEquals(\TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName('EXT:fluid/Resources/Private/DummyTestTemplates'), $view->_call('getTemplateRootPath'));
index 85dccd1..f66eace 100644 (file)
@@ -48,10 +48,10 @@ class FormViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHel
         * @return void
         */
        protected function injectDependenciesIntoViewHelper(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper $viewHelper) {
-               $viewHelper->_set('configurationManager', $this->mockConfigurationManager);
+               $viewHelper->injectConfigurationManager($this->mockConfigurationManager);
                parent::injectDependenciesIntoViewHelper($viewHelper);
-               $this->mvcPropertyMapperConfigurationService->_set('hashService', new \TYPO3\CMS\Extbase\Security\Cryptography\HashService());
-               $viewHelper->_set('mvcPropertyMapperConfigurationService', $this->mvcPropertyMapperConfigurationService);
+               $this->mvcPropertyMapperConfigurationService->injectHashService(new \TYPO3\CMS\Extbase\Security\Cryptography\HashService());
+               $viewHelper->injectMvcPropertyMapperConfigurationService($this->mvcPropertyMapperConfigurationService);
        }
 
        /**
@@ -132,12 +132,12 @@ class FormViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHel
         * @test
         */
        public function renderWrapsHiddenFieldsWithDivForXhtmlCompatibilityWithOldPropertyMapper() {
-               $viewHelper = $this->getAccessibleMock($this->buildAccessibleProxy('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper'), array('renderChildren', 'renderHiddenIdentityField', 'renderAdditionalIdentityFields', 'renderHiddenReferrerFields', 'renderRequestHashField'), array(), '', FALSE);
+               $viewHelper = $this->getMock($this->buildAccessibleProxy('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper'), array('renderChildren', 'renderHiddenIdentityField', 'renderAdditionalIdentityFields', 'renderHiddenReferrerFields', 'renderRequestHashField'), array(), '', FALSE);
                $configurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager', array('isFeatureEnabled'));
                $configurationManager->expects($this->once())->method('isFeatureEnabled')->with('rewrittenPropertyMapper')->will($this->returnValue(FALSE));
-               $viewHelper->_set('configurationManager', $configurationManager);
-               $this->mvcPropertyMapperConfigurationService->_set('hashService', new \TYPO3\CMS\Extbase\Security\Cryptography\HashService());
-               $viewHelper->_set('mvcPropertyMapperConfigurationService', $this->mvcPropertyMapperConfigurationService);
+               $viewHelper->injectConfigurationManager($configurationManager);
+               $this->mvcPropertyMapperConfigurationService->injectHashService(new \TYPO3\CMS\Extbase\Security\Cryptography\HashService());
+               $viewHelper->injectMvcPropertyMapperConfigurationService($this->mvcPropertyMapperConfigurationService);
                parent::injectDependenciesIntoViewHelper($viewHelper);
                $viewHelper->expects($this->once())->method('renderHiddenIdentityField')->will($this->returnValue('hiddenIdentityField'));
                $viewHelper->expects($this->once())->method('renderAdditionalIdentityFields')->will($this->returnValue('additionalIdentityFields'));
@@ -153,12 +153,12 @@ class FormViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHel
         * @test
         */
        public function renderWrapsHiddenFieldsWithDivForXhtmlCompatibilityWithRewrittenPropertyMapper() {
-               $viewHelper = $this->getAccessibleMock($this->buildAccessibleProxy('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper'), array('renderChildren', 'renderHiddenIdentityField', 'renderAdditionalIdentityFields', 'renderHiddenReferrerFields', 'renderTrustedPropertiesField'), array(), '', FALSE);
+               $viewHelper = $this->getMock($this->buildAccessibleProxy('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper'), array('renderChildren', 'renderHiddenIdentityField', 'renderAdditionalIdentityFields', 'renderHiddenReferrerFields', 'renderTrustedPropertiesField'), array(), '', FALSE);
                $configurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager', array('isFeatureEnabled'));
                $configurationManager->expects($this->once())->method('isFeatureEnabled')->with('rewrittenPropertyMapper')->will($this->returnValue(TRUE));
-               $viewHelper->_set('configurationManager', $configurationManager);
-               $this->mvcPropertyMapperConfigurationService->_set('hashService', new \TYPO3\CMS\Extbase\Security\Cryptography\HashService());
-               $viewHelper->_set('mvcPropertyMapperConfigurationService', $this->mvcPropertyMapperConfigurationService);
+               $viewHelper->injectConfigurationManager($configurationManager);
+               $this->mvcPropertyMapperConfigurationService->injectHashService(new \TYPO3\CMS\Extbase\Security\Cryptography\HashService());
+               $viewHelper->injectMvcPropertyMapperConfigurationService($this->mvcPropertyMapperConfigurationService);
                parent::injectDependenciesIntoViewHelper($viewHelper);
                $viewHelper->expects($this->once())->method('renderHiddenIdentityField')->will($this->returnValue('hiddenIdentityField'));
                $viewHelper->expects($this->once())->method('renderAdditionalIdentityFields')->will($this->returnValue('additionalIdentityFields'));
@@ -176,9 +176,9 @@ class FormViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHel
                $viewHelper = $this->getMock($this->buildAccessibleProxy('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper'), array('renderChildren', 'renderHiddenIdentityField', 'renderAdditionalIdentityFields', 'renderHiddenReferrerFields', 'renderTrustedPropertiesField'), array(), '', FALSE);
                $configurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager', array('isFeatureEnabled'));
                $configurationManager->expects($this->once())->method('isFeatureEnabled')->with('rewrittenPropertyMapper')->will($this->returnValue(TRUE));
-               $viewHelper->_set('configurationManager', $configurationManager);
-               $this->mvcPropertyMapperConfigurationService->_set('hashService', new \TYPO3\CMS\Extbase\Security\Cryptography\HashService());
-               $viewHelper->_set('mvcPropertyMapperConfigurationService', $this->mvcPropertyMapperConfigurationService);
+               $viewHelper->injectConfigurationManager($configurationManager);
+               $this->mvcPropertyMapperConfigurationService->injectHashService(new \TYPO3\CMS\Extbase\Security\Cryptography\HashService());
+               $viewHelper->injectMvcPropertyMapperConfigurationService($this->mvcPropertyMapperConfigurationService);
                parent::injectDependenciesIntoViewHelper($viewHelper);
                $viewHelper->expects($this->once())->method('renderHiddenIdentityField')->will($this->returnValue('hiddenIdentityField'));
                $viewHelper->expects($this->once())->method('renderAdditionalIdentityFields')->will($this->returnValue('additionalIdentityFields'));
@@ -242,7 +242,7 @@ class FormViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHel
                $expectedPrefix = 'tx_someextension_someplugin';
                $viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', array('renderChildren', 'renderHiddenIdentityField', 'renderHiddenReferrerFields', 'renderRequestHashField', 'addFormFieldNamesToViewHelperVariableContainer', 'removeFormFieldNamesFromViewHelperVariableContainer', 'renderTrustedPropertiesField'), array(), '', FALSE);
                $this->mockExtensionService->expects($this->once())->method('getPluginNamespace')->with('SomeExtension', 'SomePlugin')->will($this->returnValue('tx_someextension_someplugin'));
-               $viewHelper->_set('extensionService', $this->mockExtensionService);
+               $viewHelper->injectExtensionService($this->mockExtensionService);
                $this->injectDependenciesIntoViewHelper($viewHelper);
                $viewHelper->setArguments(array('extensionName' => 'SomeExtension', 'pluginName' => 'SomePlugin'));
                $this->viewHelperVariableContainer->expects($this->once())->method('add')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'fieldNamePrefix', $expectedPrefix);
index 87c731c..640b0bf 100644 (file)
@@ -90,7 +90,7 @@ abstract class ViewHelperBaseTestcase extends \TYPO3\CMS\Extbase\Tests\Unit\Base
                $this->renderingContext->injectTemplateVariableContainer($this->templateVariableContainer);
                $this->renderingContext->injectViewHelperVariableContainer($this->viewHelperVariableContainer);
                $this->renderingContext->setControllerContext($this->controllerContext);
-               $this->mvcPropertyMapperConfigurationService = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService', array('dummy'));
+               $this->mvcPropertyMapperConfigurationService = new \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService;
        }
 
        /**