[TASK] Replace inject methods with @inject 06/22006/2
authorAlexander Schnitzler <alex.schnitzler@typovision.de>
Sat, 6 Jul 2013 11:40:29 +0000 (13:40 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Mon, 8 Jul 2013 17:14:37 +0000 (19:14 +0200)
Currently we are using inject methods like:

/*
 * @param $foo Foo
 */
public function injectFoo(Foo $foo) {
$this->foo = $foo;
}

This patch removes these methods and introduces
property annotations:

/**
 * @var Foo
 * @inject
 */
protected $foo;

Change-Id: I5b6f1aae29f95c31b9dd69629f05d8451fe30261
Releases: 6.2
Resolves: #46598
Reviewed-on: https://review.typo3.org/22006
Reviewed-by: Alexander Schnitzler
Tested-by: Alexander Schnitzler
Reviewed-by: Marc Bastian Heinrichs
Tested-by: Marc Bastian Heinrichs
Reviewed-by: Stefan Neufeind
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
83 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/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 1d6c1bf..5702a89 100644 (file)
@@ -36,6 +36,7 @@ class HelpCommandController extends \TYPO3\CMS\Extbase\Mvc\Controller\CommandCon
 
        /**
         * @var \TYPO3\CMS\Extbase\Mvc\Cli\CommandManager
+        * @inject
         */
        protected $commandManager;
 
@@ -45,14 +46,6 @@ 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 606f410..b50c523 100755 (executable)
@@ -51,11 +51,13 @@ 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;
 
@@ -82,34 +84,11 @@ 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 1876812..bf8f926 100644 (file)
@@ -33,18 +33,12 @@ namespace TYPO3\CMS\Extbase\Configuration;
 class BackendConfigurationManager extends \TYPO3\CMS\Extbase\Configuration\AbstractConfigurationManager {
 
        /**
-        * @var \TYPO3\CMS\Core\Database\QueryGenerator Needed to recursively fetch a page tree
-        */
-       protected $queryGenerator;
-
-       /**
-        * Inject query generator
+        * Needed to recursively fetch a page tree
         *
-        * @param \TYPO3\CMS\Core\Database\QueryGenerator $queryGenerator
+        * @var \TYPO3\CMS\Core\Database\QueryGenerator
+        * @inject
         */
-       public function injectQueryGenerator(\TYPO3\CMS\Core\Database\QueryGenerator $queryGenerator) {
-               $this->queryGenerator = $queryGenerator;
-       }
+       protected $queryGenerator;
 
        /**
         * @var array
index bb9e913..1325b55 100644 (file)
@@ -37,6 +37,7 @@ class ConfigurationManager implements \TYPO3\CMS\Extbase\Configuration\Configura
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
+        * @inject
         */
        protected $objectManager;
 
@@ -47,26 +48,11 @@ 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 30f471b..debded9 100644 (file)
@@ -36,18 +36,11 @@ 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 882db52..52867be 100644 (file)
@@ -36,6 +36,7 @@ class Command {
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
+        * @inject
         */
        protected $objectManager;
 
@@ -63,8 +64,9 @@ class Command {
         * Reflection service
         *
         * @var \TYPO3\CMS\Extbase\Reflection\ReflectionService
+        * @inject
         */
-       private $reflectionService;
+       protected $reflectionService;
 
        /**
         * Constructor
@@ -91,21 +93,6 @@ 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 4af59e0..ca0ec8d 100644 (file)
@@ -33,6 +33,7 @@ class CommandManager implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
+        * @inject
         */
        protected $objectManager;
 
@@ -47,14 +48,6 @@ 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 a31bbce..06ae906 100644 (file)
@@ -34,6 +34,7 @@ class Request implements \TYPO3\CMS\Extbase\Mvc\RequestInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
+        * @inject
         */
        protected $objectManager;
 
@@ -82,14 +83,6 @@ 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 31631fc..b3528bf 100644 (file)
@@ -33,44 +33,23 @@ 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 b023c6b..96011a3 100644 (file)
@@ -33,57 +33,29 @@ 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 87f75ab..20d2789 100644 (file)
@@ -36,6 +36,7 @@ abstract class AbstractController implements \TYPO3\CMS\Extbase\Mvc\Controller\C
 
        /**
         * @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher
+        * @inject
         */
        protected $signalSlotDispatcher;
 
@@ -81,11 +82,13 @@ 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;
 
@@ -165,17 +168,6 @@ 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
@@ -187,16 +179,6 @@ 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
         *
@@ -210,15 +192,6 @@ 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 b2382b2..fc8b8a8 100644 (file)
@@ -36,11 +36,13 @@ 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;
 
@@ -106,34 +108,12 @@ 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 be49f8e..3d67bdb 100644 (file)
@@ -36,21 +36,25 @@ 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
         */
@@ -60,11 +64,13 @@ 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;
 
@@ -164,6 +170,7 @@ class Argument {
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface
+        * @inject
         */
        protected $persistenceManager;
 
@@ -187,32 +194,6 @@ 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
         */
@@ -223,34 +204,6 @@ 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
         */
@@ -260,14 +213,6 @@ 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 ca5a4de..2ebd233 100644 (file)
@@ -34,6 +34,7 @@ class Arguments extends \ArrayObject {
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
+        * @inject
         */
        protected $objectManager;
 
@@ -55,16 +56,6 @@ 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 b553d58..daab2b3 100644 (file)
@@ -57,6 +57,7 @@ class CommandController implements \TYPO3\CMS\Extbase\Mvc\Controller\CommandCont
 
        /**
         * @var \TYPO3\CMS\Extbase\Reflection\ReflectionService
+        * @inject
         */
        protected $reflectionService;
 
@@ -66,14 +67,6 @@ 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 643bb46..af54621 100644 (file)
@@ -73,41 +73,23 @@ 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 0c2186b..487d79b 100644 (file)
@@ -50,19 +50,11 @@ 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 99de910..35dcc62 100644 (file)
@@ -40,11 +40,13 @@ 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;
 
@@ -63,25 +65,6 @@ 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 fdaeaf1..98a8d68 100644 (file)
@@ -34,50 +34,23 @@ 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 b353a19..517967d 100644 (file)
@@ -34,57 +34,29 @@ 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 116c3ed..50f4a2f 100644 (file)
@@ -34,31 +34,17 @@ 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 73a1ae1..35cadb9 100644 (file)
@@ -36,6 +36,7 @@ class Request extends \TYPO3\CMS\Extbase\Mvc\Request {
 
        /**
         * @var \TYPO3\CMS\Extbase\Security\Cryptography\HashService
+        * @inject
         */
        protected $hashService;
 
@@ -72,39 +73,17 @@ 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 00e6caf..62e78fd 100644 (file)
@@ -34,6 +34,7 @@ class RequestBuilder implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
+        * @inject
         */
        protected $objectManager;
 
@@ -81,53 +82,23 @@ 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 67c9de6..ad8943a 100644 (file)
@@ -124,19 +124,11 @@ 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 a5efd98..aab6128 100644 (file)
@@ -22,11 +22,13 @@ class UriBuilder {
 
        /**
         * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
+        * @inject
         */
        protected $configurationManager;
 
        /**
         * @var \TYPO3\CMS\Extbase\Service\ExtensionService
+        * @inject
         */
        protected $extensionService;
 
@@ -116,34 +118,11 @@ 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 e30a8e7..b74fb0b 100644 (file)
@@ -230,6 +230,7 @@ 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 41f907d..04c1163 100644 (file)
@@ -35,6 +35,7 @@ class Backend implements \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\Generic\Session
+        * @inject
         */
        protected $session;
 
@@ -65,21 +66,25 @@ 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;
 
@@ -97,6 +102,7 @@ class Backend implements \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface
 
        /**
         * @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher
+        * @inject
         */
        protected $signalSlotDispatcher;
 
@@ -115,59 +121,6 @@ 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 8de6cd8..f29a6fe 100644 (file)
@@ -39,17 +39,11 @@ 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 7a496d6..66646e2 100644 (file)
@@ -35,6 +35,7 @@ class LazyLoadingProxy implements \Iterator, \TYPO3\CMS\Extbase\Persistence\Gene
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper
+        * @inject
         */
        protected $dataMapper;
 
@@ -73,16 +74,6 @@ 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 3661ddb..8270c3a 100644 (file)
@@ -45,6 +45,7 @@ class LazyObjectStorage extends \TYPO3\CMS\Extbase\Persistence\ObjectStorage imp
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper
+        * @inject
         */
        protected $dataMapper;
 
@@ -98,16 +99,6 @@ 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 d052ae8..5ad5c31 100644 (file)
@@ -34,21 +34,25 @@ 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;
 
@@ -58,39 +62,6 @@ 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 a832d92..1a17857 100644 (file)
@@ -34,21 +34,25 @@ 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;
 
@@ -68,11 +72,13 @@ 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;
 
@@ -85,77 +91,11 @@ 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
@@ -589,4 +529,4 @@ class DataMapper implements \TYPO3\CMS\Core\SingletonInterface {
        }
 }
 
-?>
\ No newline at end of file
+?>
index 30617a9..0e80a71 100644 (file)
@@ -56,16 +56,19 @@ 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;
 
@@ -79,36 +82,6 @@ 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 25cefb9..08f1f9d 100644 (file)
@@ -34,18 +34,11 @@ 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 45bb74c..53ccea5 100644 (file)
@@ -61,21 +61,25 @@ 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;
 
@@ -126,44 +130,6 @@ 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 5c7637b..d8222ea 100644 (file)
@@ -34,43 +34,23 @@ 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 be32ee3..80ed5c9 100644 (file)
@@ -47,11 +47,13 @@ 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;
 
@@ -76,26 +78,6 @@ 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 43e4467..ef189d1 100644 (file)
@@ -60,6 +60,7 @@ class Session implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Reflection\ReflectionService
+        * @inject
         */
        protected $reflectionService;
 
@@ -72,16 +73,6 @@ 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 bdca5e0..1d1d0e0 100644 (file)
@@ -44,6 +44,7 @@ class Typo3DbBackend implements \TYPO3\CMS\Extbase\Persistence\Generic\Storage\B
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper
+        * @inject
         */
        protected $dataMapper;
 
@@ -63,16 +64,19 @@ 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;
 
@@ -83,6 +87,7 @@ class Typo3DbBackend implements \TYPO3\CMS\Extbase\Persistence\Generic\Storage\B
 
        /**
         * @var \TYPO3\CMS\Extbase\Service\EnvironmentService
+        * @inject
         */
        protected $environmentService;
 
@@ -94,21 +99,6 @@ 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
@@ -118,32 +108,6 @@ 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 b3bbfc5..3cef6a4 100644 (file)
@@ -37,23 +37,27 @@ 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;
 
@@ -93,55 +97,16 @@ 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->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'));
+                       $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');
                } 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 ee11083..0346a0a 100644 (file)
@@ -61,70 +61,35 @@ 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 64d514e..bd37fc3 100644 (file)
@@ -31,11 +31,13 @@ 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;
 
@@ -59,22 +61,6 @@ 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 8b3cf36..9bab34f 100644 (file)
@@ -46,17 +46,11 @@ 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 bd73bfa..f382ed2 100644 (file)
@@ -46,17 +46,11 @@ 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 4ca8bd9..9a21906 100644 (file)
@@ -58,19 +58,11 @@ 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 24c8aea..e16b7b3 100644 (file)
@@ -84,6 +84,7 @@ class ClassSchema {
 
        /**
         * @var \TYPO3\CMS\Extbase\Service\TypeHandlingService
+        * @inject
         */
        protected $typeHandlingService;
 
@@ -97,14 +98,6 @@ 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 f302e35..395626c 100644 (file)
@@ -40,6 +40,7 @@ class ReflectionService implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
+        * @inject
         */
        protected $objectManager;
 
@@ -141,6 +142,7 @@ class ReflectionService implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
+        * @inject
         */
        protected $configurationManager;
 
@@ -155,22 +157,6 @@ 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 782a897..d8fa9e9 100644 (file)
@@ -52,41 +52,23 @@ 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 b075dc0..87ad9a6 100644 (file)
@@ -49,18 +49,11 @@ 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 4837adf..13d6356 100644 (file)
@@ -37,11 +37,13 @@ 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;
 
@@ -52,22 +54,6 @@ 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 43b59f1..3e26498 100644 (file)
@@ -74,11 +74,13 @@ 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;
 
@@ -88,26 +90,6 @@ 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.
@@ -557,4 +539,4 @@ class ValidatorResolver implements \TYPO3\CMS\Core\SingletonInterface {
        }
 }
 
-?>
\ No newline at end of file
+?>
index c6572d8..f504141 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->injectTypoScriptService($this->mockTypoScriptService);
+               $this->abstractConfigurationManager->_set('typoScriptService', $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->injectTypoScriptService($this->mockTypoScriptService);
+               $abstractConfigurationManager->_set('typoScriptService', $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->injectTypoScriptService($this->mockTypoScriptService);
+               $abstractConfigurationManager->_set('typoScriptService', $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->injectTypoScriptService($this->mockTypoScriptService);
+               $abstractConfigurationManager->_set('typoScriptService', $this->mockTypoScriptService);
                $abstractConfigurationManager->setConfiguration($configuration);
                $abstractConfigurationManager->expects($this->any())->method('getPluginConfiguration')->will($this->returnValue(array()));
                $abstractConfigurationManager->expects($this->once())->method('overrideSwitchableControllerActions');
index 428763d..ea7a38e 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->injectTypoScriptService($this->mockTypoScriptService);
+               $this->backendConfigurationManager->_set('typoScriptService', $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->injectQueryGenerator($queryGenerator);
+               $abstractConfigurationManager->_set('queryGenerator', $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->injectQueryGenerator($queryGenerator);
+               $abstractConfigurationManager->_set('queryGenerator', $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->injectQueryGenerator($queryGenerator);
+               $abstractConfigurationManager->_set('queryGenerator', $queryGenerator);
 
                $expectedResult = '1,2,3';
                $actualResult = $abstractConfigurationManager->_call('getRecursiveStoragePids', $storagePid, $recursive);
index 0ad4c35..1b04a1f 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->injectTypoScriptService($this->mockTypoScriptService);
+               $this->frontendConfigurationManager->_set('typoScriptService', $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->injectTypoScriptService($this->mockTypoScriptService);
+               $frontendConfigurationManager->_set('typoScriptService', $this->mockTypoScriptService);
 
                $this->mockTypoScriptService->expects($this->once())->method('convertTypoScriptArrayToPlainArray')->will($this->returnValue(array(
                        'persistence' => array(
index a32556e..edbf4d1 100644 (file)
@@ -85,12 +85,11 @@ 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->getMock('TYPO3\CMS\Extbase\Mvc\Cli\RequestHandler', array('canHandleRequest'));
+               $cliRequestHandler = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Cli\RequestHandler', array('canHandleRequest'));
                $cliRequestHandler->expects($this->any())->method('canHandleRequest')->will($this->returnValue(TRUE));
-               $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'));
-
+               $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'));
                /** @var $cliResponse \TYPO3\CMS\Extbase\Mvc\Cli\Response */
                $cliResponse = $this->getMock('TYPO3\CMS\Extbase\Mvc\Cli\Response', array('send'));
 
index 32aab95..a6b7239 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->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Cli\\CommandManager', array('getAvailableCommands'));
+               $this->commandManager = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Cli\\CommandManager', array('getAvailableCommands'));
                $this->mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
-               $this->commandManager->injectObjectManager($this->mockObjectManager);
+               $this->commandManager->_set('objectManager', $this->mockObjectManager);
        }
 
        public function tearDown() {
@@ -56,8 +56,9 @@ class CommandManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
         * @author Bastian Waidelich <bastian@typo3.org>
         */
        public function getAvailableCommandsReturnsAllAvailableCommands() {
-               $commandManager = new \TYPO3\CMS\Extbase\Mvc\Cli\CommandManager();
-               $commandManager->injectObjectManager($this->mockObjectManager);
+               /** @var \TYPO3\CMS\Core\Tests\AccessibleObjectInterface $commandManager */
+               $commandManager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Cli\CommandManager', array('dummy'));
+               $commandManager->_set('objectManager', $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 afc4de6..57940fa 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->injectObjectManager($this->mockObjectManager);
+               $this->command->_set('objectManager', $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->injectReflectionService($mockReflectionService);
+               $this->command->_set('reflectionService', $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 f17dcdd..bb17a1b 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
+        * @var \TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_Comparator_MockObject
         */
        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 = new \TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder();
-               $this->requestBuilder->injectObjectManager($this->mockObjectManager);
-               $this->requestBuilder->injectReflectionService($this->mockReflectionService);
-               $this->requestBuilder->injectCommandManager($this->mockCommandManager);
+               $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);
        }
 
        /**
@@ -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->injectCommandManager($mockCommandManager);
+               $this->requestBuilder->_set('commandManager', $mockCommandManager);
                $request = $this->requestBuilder->build('test:default:list');
                $this->assertSame('TYPO3\\CMS\\Extbase\\Command\\HelpCommandController', $request->getControllerObjectName());
        }
index 8a2a959..3f5a88a 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
+        * @var \TYPO3\CMS\Extbase\Mvc\Cli\Request|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface
         */
        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 = new \TYPO3\CMS\Extbase\Mvc\Cli\Request();
+               $this->request = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Cli\Request', array('dummy'));
                $this->mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
-               $this->request->injectObjectManager($this->mockObjectManager);
+               $this->request->_set('objectManager', $this->mockObjectManager);
        }
 
        /**
index 92ff596..56a389a 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->injectMvcPropertyMappingConfigurationService($configurationService);
+               $mockController->_set('mvcPropertyMappingConfigurationService', $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->injectSignalSlotDispatcher($mockSignalSlotDispatcher);
+               $mockController->_set('signalSlotDispatcher', $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->injectSignalSlotDispatcher($mockSignalSlotDispatcher);
+               $mockController->_set('signalSlotDispatcher', $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->injectSignalSlotDispatcher($mockSignalSlotDispatcher);
+               $mockController->_set('signalSlotDispatcher', $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->injectReflectionService($mockReflectionService);
+               $mockController->_set('reflectionService', $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->injectReflectionService($mockReflectionService);
+               $mockController->_set('reflectionService', $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->injectReflectionService($mockReflectionService);
+               $mockController->_set('reflectionService', $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->injectReflectionService($mockReflectionService);
-               $mockController->injectValidatorResolver($mockValidatorResolver);
+               $mockController->_set('reflectionService', $mockReflectionService);
+               $mockController->_set('validatorResolver', $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->injectReflectionService($mockReflectionService);
-               $mockController->injectValidatorResolver($mockValidatorResolver);
+               $mockController->_set('reflectionService', $mockReflectionService);
+               $mockController->_set('validatorResolver', $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->injectReflectionService($mockReflectionService);
-               $mockController->injectValidatorResolver($mockValidatorResolver);
+               $mockController->_set('reflectionService', $mockReflectionService);
+               $mockController->_set('validatorResolver', $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->injectReflectionService($mockReflectionService);
+               $mockController->_set('reflectionService', $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->injectReflectionService($mockReflectionService);
+               $mockController->_set('reflectionService', $mockReflectionService);
                $mockController->_call('checkRequestHash');
        }
 
index 1e40e35..9f5578f 100644 (file)
@@ -71,7 +71,7 @@ class ArgumentBehaviorBeforeExtbase14Test extends \TYPO3\CMS\Extbase\Tests\Unit\
         * @test
         */
        public function setValueProvidesFluentInterface() {
-               $argument = new \TYPO3\CMS\Extbase\Mvc\Controller\Argument('dummy', 'Text');
+               $argument = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Argument', array('dummy'), array('dummy', 'Text'));
                $this->enableDeprecatedPropertyMapperInArgument($argument);
                $returnedArgument = $argument->setValue('x');
                $this->assertSame($argument, $returnedArgument, 'The returned argument is not the original argument.');
@@ -82,7 +82,7 @@ class ArgumentBehaviorBeforeExtbase14Test extends \TYPO3\CMS\Extbase\Tests\Unit\
         * @author Karsten Dambekalns <karsten@typo3.org>
         */
        public function setValueUsesNullAsIs() {
-               $argument = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array('transformValue'), array('dummy', 'ArrayObject'));
+               $argument = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array('transformValue'), array('dummy', 'ArrayObject'));
                $this->enableDeprecatedPropertyMapperInArgument($argument);
                $argument->expects($this->never())->method('transformValue');
                $argument->setValue(NULL);
@@ -93,7 +93,7 @@ class ArgumentBehaviorBeforeExtbase14Test extends \TYPO3\CMS\Extbase\Tests\Unit\
         * @author Karsten Dambekalns <karsten@typo3.org>
         */
        public function setValueUsesMatchingInstanceAsIs() {
-               $argument = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array('transformValue'), array('dummy', 'ArrayObject'));
+               $argument = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array('transformValue'), array('dummy', 'ArrayObject'));
                $this->enableDeprecatedPropertyMapperInArgument($argument);
                $argument->expects($this->never())->method('transformValue');
                $argument->setValue(new \ArrayObject());
@@ -119,7 +119,7 @@ class ArgumentBehaviorBeforeExtbase14Test extends \TYPO3\CMS\Extbase\Tests\Unit\
         * @test
         */
        public function toStringReturnsTheStringVersionOfTheArgumentsValue() {
-               $argument = new \TYPO3\CMS\Extbase\Mvc\Controller\Argument('dummy', 'Text');
+               $argument = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Argument', array('dummy'), array('dummy', 'Text'));
                $this->enableDeprecatedPropertyMapperInArgument($argument);
                $argument->setValue(123);
                $this->assertSame((string) $argument, '123', 'The returned argument is not a string.');
@@ -130,11 +130,11 @@ class ArgumentBehaviorBeforeExtbase14Test extends \TYPO3\CMS\Extbase\Tests\Unit\
         * @test
         */
        public function setNewValidatorConjunctionCreatesANewValidatorConjunctionObject() {
-               $argument = new \TYPO3\CMS\Extbase\Mvc\Controller\Argument('dummy', 'Text');
+               $argument = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Argument', array('dummy'), array('dummy', 'Text'));
                $mockConjunctionValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ConjunctionValidator');
                $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
                $mockObjectManager->expects($this->once())->method('get')->with('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ConjunctionValidator')->will($this->returnValue($mockConjunctionValidator));
-               $argument->injectObjectManager($mockObjectManager);
+               $argument->_set('objectManager', $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->injectObjectManager($mockObjectManager);
+               $argument->_set('objectManager', $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->injectConfigurationManager($mockConfigurationManager);
+               $argument->_set('configurationManager', $mockConfigurationManager);
        }
 }
 
index 7ca4c20..2a10d55 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 = new \TYPO3\CMS\Extbase\Mvc\Controller\Argument('someName', 'string');
-               $this->objectArgument = new \TYPO3\CMS\Extbase\Mvc\Controller\Argument('someName', 'DateTime');
+               $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->mockPropertyMapper = $this->getMock('TYPO3\\CMS\\Extbase\\Property\\PropertyMapper');
-               $this->simpleValueArgument->injectPropertyMapper($this->mockPropertyMapper);
-               $this->objectArgument->injectPropertyMapper($this->mockPropertyMapper);
+               $this->simpleValueArgument->_set('propertyMapper', $this->mockPropertyMapper);
+               $this->objectArgument->_set('propertyMapper', $this->mockPropertyMapper);
                $this->mockConfiguration = new \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfiguration();
                $propertyMappingConfiguranion = new \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfiguration();
-               $this->simpleValueArgument->injectPropertyMappingConfiguration($propertyMappingConfiguranion);
-               $this->objectArgument->injectPropertyMappingConfiguration($propertyMappingConfiguranion);
+               $this->simpleValueArgument->_set('propertyMappingConfiguration', $propertyMappingConfiguranion);
+               $this->objectArgument->_set('propertyMappingConfiguration', $propertyMappingConfiguranion);
        }
 
        /**
@@ -173,6 +173,7 @@ 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());
@@ -298,7 +299,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->injectConfigurationManager($mockConfigurationManager);
+               $argument->_set('configurationManager', $mockConfigurationManager);
        }
 }
 
index a72e6f6..b9233be 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 = new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments();
-               $arguments->injectObjectManager($mockObjectManager);
+               $arguments = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Arguments', array('dummy'));
+               $arguments->_set('objectManager', $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 = new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments();
-               $arguments->injectObjectManager($mockObjectManager);
+               $arguments = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Arguments', array('dummy'));
+               $arguments->_set('objectManager', $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 = new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments();
-               $arguments->injectObjectManager($mockObjectManager);
+               $arguments = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Arguments', array('dummy'));
+               $arguments->_set('objectManager', $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 = new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments();
-               $arguments->injectObjectManager($mockObjectManager);
+               $arguments = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Arguments', array('dummy'));
+               $arguments->_set('objectManager', $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 = new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments();
-               $arguments->injectObjectManager($mockObjectManager);
+               $arguments = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Arguments', array('dummy'));
+               $arguments->_set('objectManager', $mockObjectManager);
                $arguments->addNewArgument('dummyName', 'Text', FALSE, 'someDefaultValue');
        }
 
index 55fc185..3a91a17 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 = new \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService();
-               $requestHashService->injectHashService($mockHashService);
+               $requestHashService = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService', array('dummy'));
+               $requestHashService->_set('hashService', $mockHashService);
 
                $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
-               $mockArgument = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array('getName'), array(), '', FALSE);
+               $mockArgument = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array('getName'), array(), '', FALSE);
 
                $propertyMappingConfiguration = new \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfiguration();
 
-               $mockArgument->injectPropertyMappingConfiguration($propertyMappingConfiguration);
+               $mockArgument->_set('propertyMappingConfiguration', $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 = new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments();
-               $arguments->injectObjectManager($mockObjectManager);
+               $arguments = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Arguments', array('dummy'));
+               $arguments->_set('objectManager', $mockObjectManager);
                $arguments->addNewArgument('foo');
 
                $requestHashService->initializePropertyMappingConfigurationFromRequest($request, $arguments);
index e2ae629..cae9e9b 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->injectConfigurationManager($this->mockConfigurationManager);
+               $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
                $this->mockObjectManager->expects($this->any())->method('get')->with('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request')->will($this->returnValue($this->mockRequest));
-               $this->requestBuilder->injectObjectManager($this->mockObjectManager);
+               $this->requestBuilder->_set('objectManager', $this->mockObjectManager);
                $pluginNamespace = 'tx_' . strtolower(($this->configuration['extensionName'] . '_' . $this->configuration['pluginName']));
                $this->mockExtensionService->expects($this->any())->method('getPluginNamespace')->will($this->returnValue($pluginNamespace));
-               $this->requestBuilder->injectExtensionService($this->mockExtensionService);
+               $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
                $this->mockEnvironmentService->expects($this->any())->method('getServerRequestMethod')->will($this->returnValue('GET'));
-               $this->requestBuilder->injectEnvironmentService($this->mockEnvironmentService);
+               $this->requestBuilder->_set('environmentService', $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->injectEnvironmentService($mockEnvironmentService);
+               $this->requestBuilder->_set('environmentService', $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->injectConfigurationManager($mockConfigurationManager);
-               $this->requestBuilder->injectExtensionService($this->mockExtensionService);
+               $this->requestBuilder->_set('configurationManager', $mockConfigurationManager);
+               $this->requestBuilder->_set('extensionService', $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->injectConfigurationManager($mockConfigurationManager);
+               $this->requestBuilder->_set('configurationManager', $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->injectConfigurationManager($mockConfigurationManager);
+               $this->requestBuilder->_set('configurationManager', $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->injectConfigurationManager($mockConfigurationManager);
+               $this->requestBuilder->_set('configurationManager', $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->injectConfigurationManager($mockConfigurationManager);
-               $this->requestBuilder->injectExtensionService($this->mockExtensionService);
+               $this->requestBuilder->_set('configurationManager', $mockConfigurationManager);
+               $this->requestBuilder->_set('extensionService', $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->injectConfigurationManager($this->mockConfigurationManager);
-               $this->requestBuilder->injectExtensionService($this->mockExtensionService);
+               $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
+               $this->requestBuilder->_set('extensionService', $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->injectConfigurationManager($this->mockConfigurationManager);
-               $this->requestBuilder->injectExtensionService($this->mockExtensionService);
+               $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
+               $this->requestBuilder->_set('extensionService', $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->injectConfigurationManager($this->mockConfigurationManager);
-               $this->requestBuilder->injectExtensionService($this->mockExtensionService);
+               $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
+               $this->requestBuilder->_set('extensionService', $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->injectConfigurationManager($this->mockConfigurationManager);
+               $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
                $this->mockExtensionService->expects($this->any())->method('getPluginNamespace')->will($this->returnValue('tx_myextension_pi1'));
-               $this->requestBuilder->injectExtensionService($this->mockExtensionService);
+               $this->requestBuilder->_set('extensionService', $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->injectConfigurationManager($this->mockConfigurationManager);
+               $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
                $this->mockExtensionService->expects($this->any())->method('getPluginNamespace')->will($this->returnValue('tx_myextension_pi1'));
-               $this->requestBuilder->injectExtensionService($this->mockExtensionService);
+               $this->requestBuilder->_set('extensionService', $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->injectConfigurationManager($this->mockConfigurationManager);
+               $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
                $this->mockExtensionService->expects($this->any())->method('getPluginNamespace')->will($this->returnValue('tx_myextension_pi1'));
-               $this->requestBuilder->injectExtensionService($this->mockExtensionService);
+               $this->requestBuilder->_set('extensionService', $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->injectExtensionService($this->mockExtensionService);
+               $this->requestBuilder->_set('extensionService', $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->injectConfigurationManager($this->mockConfigurationManager);
+               $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
                $this->mockExtensionService->expects($this->any())->method('getPluginNamespace')->will($this->returnValue('tx_myextension_pi1'));
-               $this->requestBuilder->injectExtensionService($this->mockExtensionService);
+               $this->requestBuilder->_set('extensionService', $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->injectConfigurationManager($this->mockConfigurationManager);
+               $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
                $this->mockExtensionService->expects($this->any())->method('getPluginNamespace')->will($this->returnValue('tx_myextension_pi1'));
-               $this->requestBuilder->injectExtensionService($this->mockExtensionService);
+               $this->requestBuilder->_set('extensionService', $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->injectConfigurationManager($this->mockConfigurationManager);
+               $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
                $this->mockExtensionService->expects($this->any())->method('getPluginNamespace')->will($this->returnValue('tx_myextension_pi1'));
-               $this->requestBuilder->injectExtensionService($this->mockExtensionService);
+               $this->requestBuilder->_set('extensionService', $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->injectExtensionService($this->mockExtensionService);
+               $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
                $_GET = array(
                        'tx_myextension_pi1' => array(
                                'controller' => 'TheThirdController',
index 3cafd26..994c1bc 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->injectConfigurationManager($this->mockConfigurationManager);
-               $this->uriBuilder->injectExtensionService($this->mockExtensionService);
-               $this->uriBuilder->injectEnvironmentService($this->objectManager->get('TYPO3\\CMS\\Extbase\\Service\\EnvironmentService'));
+               $this->uriBuilder->_set('configurationManager', $this->mockConfigurationManager);
+               $this->uriBuilder->_set('extensionService', $this->mockExtensionService);
+               $this->uriBuilder->_set('environmentService', $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->injectConfigurationManager($mockConfigurationManager);
+               $this->uriBuilder->_set('configurationManager', $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->injectConfigurationManager($mockConfigurationManager);
+               $this->uriBuilder->_set('configurationManager', $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->injectConfigurationManager($mockConfigurationManager);
+               $this->uriBuilder->_set('configurationManager', $mockConfigurationManager);
 
                $this->mockExtensionService->expects($this->any())->method('getTargetPageTypeByFormat')
                        ->with(NULL, 'txt')
index bfdfeb2..26bfb58 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->injectReflectionService(new \TYPO3\CMS\Extbase\Reflection\ReflectionService());
-               $dataMapFactory->injectObjectManager(new \TYPO3\CMS\Extbase\Object\ObjectManager());
-               $dataMapFactory->injectConfigurationManager($configurationManager);
+               $dataMapFactory->_set('reflectionService', new \TYPO3\CMS\Extbase\Reflection\ReflectionService());
+               $dataMapFactory->_set('objectManager', new \TYPO3\CMS\Extbase\Object\ObjectManager());
+               $dataMapFactory->_set('configurationManager', $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->injectObjectManager($this->objectManager);
+               $dataMapFactory->_set('objectManager', $this->objectManager);
 
                $this->assertEquals(
                        new \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap('column', 'property'),
index d2a0fa8..1e73d6b 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->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Mapper\\DataMapper', array('mapSingleRow', 'getTargetType'));
+               $dataMapper = $this->getAccessibleMock('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->injectDataMapFactory($dataMapFactory);
+               $dataMapper->_set('dataMapFactory', $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->injectIdentityMap($identityMap);
+               $dataMapper->_set('identityMap', $identityMap);
                $dataMapper->_call('mapSingleRow', get_class($object), $row);
        }
 
@@ -85,8 +85,9 @@ class DataMapperTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $dataMaps = array(
                        $className => $dataMap
                );
-               $classSchema = new \TYPO3\CMS\Extbase\Reflection\ClassSchema($className);
-               $classSchema->injectTypeHandlingService(new \TYPO3\CMS\Extbase\Service\TypeHandlingService());
+               /** @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->addProperty('pid', 'integer');
                $classSchema->addProperty('uid', 'integer');
                $classSchema->addProperty('firstProperty', 'string');
@@ -97,7 +98,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->injectReflectionService($mockReflectionService);
+               $dataMapper->_set('reflectionService', $mockReflectionService);
                $dataMapper->_call('thawProperties', $object, $row);
                $this->assertAttributeEquals('firstValue', 'firstProperty', $object);
                $this->assertAttributeEquals(1234, 'secondProperty', $object);
index b55e1e7..7af6bb0 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 = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager();
-               $manager->injectBackend($mockBackend);
+               $manager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy'));
+               $manager->_set('backend', $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 = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager();
-               $manager->injectBackend($mockBackend);
+               $manager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy'));
+               $manager->_set('backend', $mockBackend);
                $manager->remove($entity2);
 
                $manager->persistAll();
@@ -79,8 +79,9 @@ 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));
 
-               $manager = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager();
-               $manager->injectPersistenceSession($mockSession);
+               /** @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);
 
                $this->assertEquals($manager->getIdentifierByObject($object), $fakeUuid);
        }
@@ -96,8 +97,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 = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager();
-               $manager->injectPersistenceSession($mockSession);
+               $manager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy'));
+               $manager->_set('persistenceSession', $mockSession);
 
                $this->assertEquals($manager->getObjectByIdentifier($fakeUuid), $object);
        }
@@ -116,9 +117,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 = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager();
-               $manager->injectPersistenceSession($mockSession);
-               $manager->injectBackend($mockBackend);
+               $manager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy'));
+               $manager->_set('persistenceSession', $mockSession);
+               $manager->_set('backend', $mockBackend);
 
                $this->assertEquals($manager->getObjectByIdentifier($fakeUuid, $fakeEntityType), $object);
        }
@@ -136,9 +137,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 = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager();
-               $manager->injectPersistenceSession($mockSession);
-               $manager->injectBackend($mockBackend);
+               $manager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy'));
+               $manager->_set('persistenceSession', $mockSession);
+               $manager->_set('backend', $mockBackend);
 
                $this->assertNull($manager->getObjectByIdentifier($fakeUuid, $fakeEntityType));
        }
@@ -229,20 +230,21 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
                $classNameWithNamespace = 'Foo\\Bar\\Domain\\Model\\' . $className;
                $repositorClassNameWithNamespace = 'Foo\\Bar\\Domain\\Repository\\' . $className . 'Repository';
 
-               $persistenceManager = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager();
+               $persistenceManager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy'));
                $session = new \TYPO3\CMS\Extbase\Persistence\Generic\Session();
                $changedEntities = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
                $entity1 = new $classNameWithNamespace();
-               $repository = new $repositorClassNameWithNamespace;
+               $repository = $this->getAccessibleMock($repositorClassNameWithNamespace, array('dummy'));
+               $repository->_set('objectType', get_class($entity1));
                $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->injectBackend($mockBackend);
-               $persistenceManager->injectPersistenceSession($session);
-               $repository->injectPersistenceManager($persistenceManager);
+               $persistenceManager->_set('backend', $mockBackend);
+               $persistenceManager->_set('persistenceSession', $session);
 
+               $repository->_set('persistenceManager', $persistenceManager);
                $session->registerObject($entity1, 42);
                $changedEntities->attach($entity1);
                $repository->update($entity1);
@@ -262,9 +264,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 = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager();
-               $persistenceManager->injectPersistenceSession($mockSession);
-               $persistenceManager->injectBackend($mockBackend);
+               $persistenceManager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy'));
+               $persistenceManager->_set('persistenceSession', $mockSession);
+               $persistenceManager->_set('backend', $mockBackend);
 
                $persistenceManager->registerNewObject($mockObject);
                $persistenceManager->clearState();
@@ -280,8 +282,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 = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager();
-               $persistenceManager->injectBackend($mockBackend);
+               $persistenceManager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy'));
+               $persistenceManager->_set('backend', $mockBackend);
 
                $persistenceManager->tearDown();
        }
@@ -294,8 +296,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 = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager();
-               $persistenceManager->injectBackend($mockBackend);
+               $persistenceManager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy'));
+               $persistenceManager->_set('backend', $mockBackend);
 
                $persistenceManager->tearDown();
        }
@@ -315,7 +317,7 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
                eval ('
                        class Foo_Bar_Domain_Repository_' . $className . 'Repository {}
                ');
-               $persistenceManager = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager();
+               $persistenceManager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy'));
                $aggregateRootObjects = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
                $fullClassName = 'Foo_Bar_Domain_Model_' . $className;
                $entity1 = new $fullClassName();
@@ -324,7 +326,7 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
                $mockBackend->expects($this->once())
                        ->method('setAggregateRootObjects')
                        ->with($this->equalTo($aggregateRootObjects));
-               $persistenceManager->injectBackend($mockBackend);
+               $persistenceManager->_set('backend', $mockBackend);
                $persistenceManager->add($entity1);
                $persistenceManager->persistAll();
        }
@@ -342,7 +344,7 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
                        namespace Foo\\Bar\\Domain\\Repository;
                        class  ' . $className . 'Repository {}
                ');
-               $persistenceManager = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager();
+               $persistenceManager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy'));
                $aggregateRootObjects = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
                $classNameWithNamespace = 'Foo\\Bar\\Domain\\Model\\' . $className;
                $entity1 = new $classNameWithNamespace();
@@ -351,7 +353,7 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
                $mockBackend->expects($this->once())
                        ->method('setAggregateRootObjects')
                        ->with($this->equalTo($aggregateRootObjects));
-               $persistenceManager->injectBackend($mockBackend);
+               $persistenceManager->_set('backend', $mockBackend);
                $persistenceManager->add($entity1);
                $persistenceManager->persistAll();
        }
index 5060ded..559b725 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 = new \TYPO3\CMS\Extbase\Persistence\Generic\QueryFactory();
-               $this->queryFactory->injectConfigurationManager(
+               $this->queryFactory = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\QueryFactory', array('dummy'));
+               $this->queryFactory->_set('configurationManager',
                        $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface')
                );
 
                $this->objectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
-               $this->queryFactory->injectObjectManager($this->objectManager);
+               $this->queryFactory->_set('objectManager', $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->injectDataMapper($this->dataMapper);
+               $this->queryFactory->_set('dataMapper', $this->dataMapper);
        }
 
        protected function tearDown() {
index a54ddf1..55cd9f7 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 = new \TYPO3\CMS\Extbase\Persistence\Generic\QueryResult($this->mockQuery);
-               $this->queryResult->injectPersistenceManager($this->mockPersistenceManager);
-               $this->queryResult->injectDataMapper($this->mockDataMapper);
+               $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->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->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QueryResult', array('initialize'), array($this->mockQuery));
-               $queryResult->injectPersistenceManager($this->mockPersistenceManager);
+               $queryResult = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QueryResult', array('initialize'), array($this->mockQuery));
+               $queryResult->_set('persistenceManager', $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->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QueryResult', array('initialize'), array($this->mockQuery));
-               $queryResult->injectPersistenceManager($this->mockPersistenceManager);
+               $queryResult = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QueryResult', array('initialize'), array($this->mockQuery));
+               $queryResult->_set('persistenceManager', $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->injectPersistenceManager($this->mockPersistenceManager);
-               $queryResult->injectDataMapper($this->mockDataMapper);
+               $queryResult->_set('persistenceManager', $this->mockPersistenceManager);
+               $queryResult->_set('dataMapper', $this->mockDataMapper);
                $this->mockPersistenceManager->expects($this->once())->method('getObjectDataByQuery')->with($this->mockQuery)->will($this->returnValue(array('FAKERESULT')));
                $queryResult->_call('initialize');
        }
index 85f0174..ffe06e7 100644 (file)
@@ -63,17 +63,18 @@ class QueryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
         */
        public function setUp() {
                $this->objectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
-               $this->query = new \TYPO3\CMS\Extbase\Persistence\Generic\Query('someType');
-               $this->query->injectObjectManager($this->objectManager);
+
+               $this->query = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\Query', array('dummy'), array('someType'));
+               $this->query->_set('objectManager', $this->objectManager);
                $this->querySettings = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QuerySettingsInterface');
-               $this->query->setQuerySettings($this->querySettings);
+               $this->query->_set('querySettings', $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->injectPersistenceManager($this->persistenceManager);
+               $this->query->_set('persistenceManager', $this->persistenceManager);
                $this->dataMapper = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Mapper\\DataMapper');
-               $this->query->injectDataMapper($this->dataMapper);
+               $this->query->_set('dataMapper', $this->dataMapper);
        }
 
        /**
@@ -152,10 +153,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->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Qom\\QueryObjectModelFactory', array('comparison'));
-               $qomFactory->injectObjectManager(\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager'));
+               $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->expects($this->once())->method('comparison')->with($this->anything(), $this->anything(), $expectedOperand);
-               $this->query->injectQomFactory($qomFactory);
+               $this->query->_set('qomFactory', $qomFactory);
                $this->query->equals($propertyName, $operand, FALSE);
        }
 }
index 2437317..29c365d 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->injectEnvironmentService($mockEnvironmentService);
+               $mockTypo3DbBackend->_set('environmentService', $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->injectEnvironmentService($mockEnvironmentService);
+               $mockTypo3DbBackend->_set('environmentService', $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->injectEnvironmentService($mockEnvironmentService);
+               $mockTypo3DbBackend->_set('environmentService', $mockEnvironmentService);
                $mockTypo3DbBackend->_callRef('addVisibilityConstraintStatement', $mockQuerySettings, $tableName, $sql);
                unset($GLOBALS['TCA'][$tableName]);
        }
index f616076..722f8b8 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->injectPersistenceManager($this->mockPersistenceManager);
+               $this->repository->_set('persistenceManager', $this->mockPersistenceManager);
        }
 
        /**
index 425dd66..4d577ca 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->getMock('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService');
-               $reflectionService->injectObjectManager($objectManager);
+               $reflectionService = $this-> getAccessibleMock('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService');
+               $reflectionService->_set('objectManager', $objectManager);
 
                /** @var \TYPO3\CMS\Extbase\Validation\ValidatorResolver $validatorResolver */
                $validatorResolver = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\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);
+               $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);
        }
 
        public function tearDown() {
index d3cd6d1..7539daa 100644 (file)
@@ -89,8 +89,8 @@ class ReflectionServiceTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                        class ' . $className . 'Repository {}
                ');
 
-               $service = new \TYPO3\CMS\Extbase\Reflection\ReflectionService();
-               $service->injectObjectManager($this->objectManager);
+               $service = $this->getAccessibleMock('TYPO3\CMS\Extbase\Reflection\ReflectionService', array('dummy'));
+               $service->_set('objectManager', $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 = new \TYPO3\CMS\Extbase\Reflection\ReflectionService();
-               $service->injectObjectManager($this->objectManager);
+               $service = $this->getAccessibleMock('TYPO3\CMS\Extbase\Reflection\ReflectionService', array('dummy'));
+               $service->_set('objectManager', $this->objectManager);
                $classSchema = $service->getClassSchema('Foo_Bar_Domain_Model_' . $className);
                $this->assertTrue($classSchema->isAggregateRoot());
        }
index ee15006..a023bc1 100644 (file)
@@ -78,19 +78,19 @@ class FieldProviderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                        FALSE
                );
 
-               $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 = $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->expects($this->any())->method('isInternal')->will($this->returnValue(FALSE));
 
-               $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 = $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->expects($this->any())->method('isInternal')->will($this->returnValue(FALSE));
 
-               $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 = $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->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 b0febc1..38bf6ba 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->injectReflectionService($this->objectManager->get('TYPO3\CMS\Extbase\Reflection\ReflectionService'));
-               $this->controller->injectObjectManager($this->objectManager);
+               $this->controller->_set('reflectionService', $this->objectManager->get('TYPO3\CMS\Extbase\Reflection\ReflectionService'));
+               $this->controller->_set('objectManager', $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->getMock('TYPO3\CMS\Extbase\Mvc\Dispatcher', array('resolveController'), array($this->objectManager));
+               $dispatcher = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Dispatcher', array('resolveController'), array($this->objectManager));
                $dispatcher->expects($this->any())->method('resolveController')->will($this->returnValue($this->controller));
-               $dispatcher->injectSignalSlotDispatcher($this->objectManager->get('TYPO3\CMS\Extbase\SignalSlot\Dispatcher'));
+               $dispatcher->_set('signalSlotDispatcher', $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->injectObjectManager($this->objectManager);
-               $this->taskExecuter->injectCommandManager($this->commandManager);
-               $this->taskExecuter->injectConfigurationManager($this->configurationManager);
+               $this->taskExecuter->_set('objectManager', $this->objectManager);
+               $this->taskExecuter->_set('commandManager', $this->commandManager);
+               $this->taskExecuter->_set('configurationManager', $this->configurationManager);
                $this->taskExecuter->initializeObject();
 
                /** @var $task \TYPO3\CMS\Extbase\Scheduler\Task|\PHPUnit_Framework_MockObject_MockObject */
index 564d337..4121235 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 = new \TYPO3\CMS\Extbase\Service\ExtensionService();
+               $this->extensionService = $this->getAccessibleMock('TYPO3\CMS\Extbase\Service\ExtensionService', array('dummy'));
                $this->mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
-               $this->extensionService->injectConfigurationManager($this->mockConfigurationManager);
+               $this->extensionService->_set('configurationManager', $this->mockConfigurationManager);
                $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions'] = array(
                        'ExtensionName' => array(
                                'plugins' => array(
index f3cc41b..182df9c 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->injectObjectManager($this->mockObjectManager);
+               $this->validatorResolver->_set('objectManager', $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->injectObjectManager($this->mockObjectManager);
+               $validatorResolver->_set('objectManager', $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->getMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array('createValidator'));
-               $validatorResolver->injectReflectionService($mockReflectionService);
+               $validatorResolver = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array('createValidator'));
+               $validatorResolver->_set('reflectionService', $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->getMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array('createValidator'));
+               $validatorResolver = $this->getAccessibleMock('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->injectReflectionService($mockReflectionService);
+               $validatorResolver->_set('reflectionService', $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->getMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array('createValidator'));
+               $validatorResolver = $this->getAccessibleMock('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->injectReflectionService($mockReflectionService);
+               $validatorResolver->_set('reflectionService', $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->injectReflectionService($mockReflectionService);
-               $validatorResolver->injectObjectManager($mockObjectManager);
+               $validatorResolver->_set('reflectionService', $mockReflectionService);
+               $validatorResolver->_set('objectManager', $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->injectObjectManager($mockObjectManager);
+               $validatorResolver->_set('objectManager', $mockObjectManager);
                $validatorResolver->expects($this->once())->method('createValidator')->with($validatorClassName)->will($this->returnValue(NULL));
                $validatorResolver->_call('buildBaseValidatorConjunction', $modelClassName, $modelClassName);
        }
index 1b56c40..e9cea3f 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->injectMvcPropertyMappingConfigurationService($configurationService);
+               $abstractWidgetController->_set('mvcPropertyMappingConfigurationService', $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->injectConfigurationManager($configurationManager);
+               $abstractWidgetController->_set('configurationManager', $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 f66eace..85dccd1 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->injectConfigurationManager($this->mockConfigurationManager);
+               $viewHelper->_set('configurationManager', $this->mockConfigurationManager);
                parent::injectDependenciesIntoViewHelper($viewHelper);
-               $this->mvcPropertyMapperConfigurationService->injectHashService(new \TYPO3\CMS\Extbase\Security\Cryptography\HashService());
-               $viewHelper->injectMvcPropertyMapperConfigurationService($this->mvcPropertyMapperConfigurationService);
+               $this->mvcPropertyMapperConfigurationService->_set('hashService', new \TYPO3\CMS\Extbase\Security\Cryptography\HashService());
+               $viewHelper->_set('mvcPropertyMapperConfigurationService', $this->mvcPropertyMapperConfigurationService);
        }
 
        /**
@@ -132,12 +132,12 @@ class FormViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHel
         * @test
         */
        public function renderWrapsHiddenFieldsWithDivForXhtmlCompatibilityWithOldPropertyMapper() {
-               $viewHelper = $this->getMock($this->buildAccessibleProxy('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper'), array('renderChildren', 'renderHiddenIdentityField', 'renderAdditionalIdentityFields', 'renderHiddenReferrerFields', 'renderRequestHashField'), array(), '', FALSE);
+               $viewHelper = $this->getAccessibleMock($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->injectConfigurationManager($configurationManager);
-               $this->mvcPropertyMapperConfigurationService->injectHashService(new \TYPO3\CMS\Extbase\Security\Cryptography\HashService());
-               $viewHelper->injectMvcPropertyMapperConfigurationService($this->mvcPropertyMapperConfigurationService);
+               $viewHelper->_set('configurationManager', $configurationManager);
+               $this->mvcPropertyMapperConfigurationService->_set('hashService', new \TYPO3\CMS\Extbase\Security\Cryptography\HashService());
+               $viewHelper->_set('mvcPropertyMapperConfigurationService', $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->getMock($this->buildAccessibleProxy('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper'), array('renderChildren', 'renderHiddenIdentityField', 'renderAdditionalIdentityFields', 'renderHiddenReferrerFields', 'renderTrustedPropertiesField'), array(), '', FALSE);
+               $viewHelper = $this->getAccessibleMock($this->buildAccessibleProxy('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper'), 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->injectConfigurationManager($configurationManager);
-               $this->mvcPropertyMapperConfigurationService->injectHashService(new \TYPO3\CMS\Extbase\Security\Cryptography\HashService());
-               $viewHelper->injectMvcPropertyMapperConfigurationService($this->mvcPropertyMapperConfigurationService);
+               $viewHelper->_set('configurationManager', $configurationManager);
+               $this->mvcPropertyMapperConfigurationService->_set('hashService', new \TYPO3\CMS\Extbase\Security\Cryptography\HashService());
+               $viewHelper->_set('mvcPropertyMapperConfigurationService', $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->injectConfigurationManager($configurationManager);
-               $this->mvcPropertyMapperConfigurationService->injectHashService(new \TYPO3\CMS\Extbase\Security\Cryptography\HashService());
-               $viewHelper->injectMvcPropertyMapperConfigurationService($this->mvcPropertyMapperConfigurationService);
+               $viewHelper->_set('configurationManager', $configurationManager);
+               $this->mvcPropertyMapperConfigurationService->_set('hashService', new \TYPO3\CMS\Extbase\Security\Cryptography\HashService());
+               $viewHelper->_set('mvcPropertyMapperConfigurationService', $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->injectExtensionService($this->mockExtensionService);
+               $viewHelper->_set('extensionService', $this->mockExtensionService);
                $this->injectDependenciesIntoViewHelper($viewHelper);
                $viewHelper->setArguments(array('extensionName' => 'SomeExtension', 'pluginName' => 'SomePlugin'));
                $this->viewHelperVariableContainer->expects($this->once())->method('add')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'fieldNamePrefix', $expectedPrefix);
index 640b0bf..87c731c 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 = new \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService;
+               $this->mvcPropertyMapperConfigurationService = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService', array('dummy'));
        }
 
        /**