diff --git a/typo3/sysext/extbase/Classes/Command/HelpCommandController.php b/typo3/sysext/extbase/Classes/Command/HelpCommandController.php index 5702a891fa5304568f8b6f7453c84ca53bb02ac8..1d6c1bf97ca00c8f6cad3290d02b0cf994ccfa70 100644 --- a/typo3/sysext/extbase/Classes/Command/HelpCommandController.php +++ b/typo3/sysext/extbase/Classes/Command/HelpCommandController.php @@ -36,7 +36,6 @@ class HelpCommandController extends \TYPO3\CMS\Extbase\Mvc\Controller\CommandCon /** * @var \TYPO3\CMS\Extbase\Mvc\Cli\CommandManager - * @inject */ protected $commandManager; @@ -45,6 +44,14 @@ class HelpCommandController extends \TYPO3\CMS\Extbase\Mvc\Controller\CommandCon */ protected $commandsByExtensionsAndControllers = array(); + /** + * @param \TYPO3\CMS\Extbase\Mvc\Cli\CommandManager $commandManager + * @return void + */ + public function injectCommandManager(\TYPO3\CMS\Extbase\Mvc\Cli\CommandManager $commandManager) { + $this->commandManager = $commandManager; + } + /** * Displays a short, general help message * diff --git a/typo3/sysext/extbase/Classes/Configuration/AbstractConfigurationManager.php b/typo3/sysext/extbase/Classes/Configuration/AbstractConfigurationManager.php index b50c5235e1ba98bad45f6f43b5ec02e5cfeed1fe..606f4107c38a0133f2c13e4db2f03c14365589bf 100755 --- a/typo3/sysext/extbase/Classes/Configuration/AbstractConfigurationManager.php +++ b/typo3/sysext/extbase/Classes/Configuration/AbstractConfigurationManager.php @@ -51,13 +51,11 @@ abstract class AbstractConfigurationManager implements \TYPO3\CMS\Core\Singleton /** * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface - * @inject */ protected $objectManager; /** * @var \TYPO3\CMS\Extbase\Service\TypoScriptService - * @inject */ protected $typoScriptService; @@ -84,10 +82,33 @@ 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 diff --git a/typo3/sysext/extbase/Classes/Configuration/BackendConfigurationManager.php b/typo3/sysext/extbase/Classes/Configuration/BackendConfigurationManager.php index bf8f926f94790d25b07713d7341b166fce5782ee..1876812dd1e55c6f220c9b3725cef5705fc0983f 100644 --- a/typo3/sysext/extbase/Classes/Configuration/BackendConfigurationManager.php +++ b/typo3/sysext/extbase/Classes/Configuration/BackendConfigurationManager.php @@ -33,13 +33,19 @@ namespace TYPO3\CMS\Extbase\Configuration; class BackendConfigurationManager extends \TYPO3\CMS\Extbase\Configuration\AbstractConfigurationManager { /** - * Needed to recursively fetch a page tree - * - * @var \TYPO3\CMS\Core\Database\QueryGenerator - * @inject + * @var \TYPO3\CMS\Core\Database\QueryGenerator Needed to recursively fetch a page tree */ protected $queryGenerator; + /** + * Inject query generator + * + * @param \TYPO3\CMS\Core\Database\QueryGenerator $queryGenerator + */ + public function injectQueryGenerator(\TYPO3\CMS\Core\Database\QueryGenerator $queryGenerator) { + $this->queryGenerator = $queryGenerator; + } + /** * @var array */ diff --git a/typo3/sysext/extbase/Classes/Configuration/ConfigurationManager.php b/typo3/sysext/extbase/Classes/Configuration/ConfigurationManager.php index 1325b559f24c7166d386fd1f15b29ecb566e1220..bb9e913f529cf32925d8ac5c34e1438def8b9261 100644 --- a/typo3/sysext/extbase/Classes/Configuration/ConfigurationManager.php +++ b/typo3/sysext/extbase/Classes/Configuration/ConfigurationManager.php @@ -37,7 +37,6 @@ class ConfigurationManager implements \TYPO3\CMS\Extbase\Configuration\Configura /** * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface - * @inject */ protected $objectManager; @@ -48,10 +47,25 @@ 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 * diff --git a/typo3/sysext/extbase/Classes/Configuration/FrontendConfigurationManager.php b/typo3/sysext/extbase/Classes/Configuration/FrontendConfigurationManager.php index debded99e8599666e58d33612928eb046a798647..30f471b5f353de4664ec278f33de2a831fdf905a 100644 --- a/typo3/sysext/extbase/Classes/Configuration/FrontendConfigurationManager.php +++ b/typo3/sysext/extbase/Classes/Configuration/FrontendConfigurationManager.php @@ -36,10 +36,17 @@ 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. * diff --git a/typo3/sysext/extbase/Classes/Mvc/Cli/Command.php b/typo3/sysext/extbase/Classes/Mvc/Cli/Command.php index 52867beb8af65cb0bffb11409ca4a604611a539f..882db5288493169b09c15109f229806f0ef33656 100644 --- a/typo3/sysext/extbase/Classes/Mvc/Cli/Command.php +++ b/typo3/sysext/extbase/Classes/Mvc/Cli/Command.php @@ -36,7 +36,6 @@ class Command { /** * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface - * @inject */ protected $objectManager; @@ -64,9 +63,8 @@ class Command { * Reflection service * * @var \TYPO3\CMS\Extbase\Reflection\ReflectionService - * @inject */ - protected $reflectionService; + private $reflectionService; /** * Constructor @@ -92,6 +90,21 @@ class Command { $this->commandIdentifier = strtolower($extensionKey . ':' . substr($classNameParts[3], 0, -17) . ':' . $controllerCommandName); } + /** + * @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 */ diff --git a/typo3/sysext/extbase/Classes/Mvc/Cli/CommandManager.php b/typo3/sysext/extbase/Classes/Mvc/Cli/CommandManager.php index ca0ec8d5e2aa1a47a98cea9f5085ae3a8032a331..4af59e0a2a062e908f92e404cf0f0f0e03b74af6 100644 --- a/typo3/sysext/extbase/Classes/Mvc/Cli/CommandManager.php +++ b/typo3/sysext/extbase/Classes/Mvc/Cli/CommandManager.php @@ -33,7 +33,6 @@ class CommandManager implements \TYPO3\CMS\Core\SingletonInterface { /** * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface - * @inject */ protected $objectManager; @@ -47,6 +46,14 @@ class CommandManager implements \TYPO3\CMS\Core\SingletonInterface { */ protected $shortCommandIdentifiers = NULL; + /** + * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager A reference to the object manager + * @return void + */ + public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) { + $this->objectManager = $objectManager; + } + /** * Returns an array of all commands * diff --git a/typo3/sysext/extbase/Classes/Mvc/Cli/Request.php b/typo3/sysext/extbase/Classes/Mvc/Cli/Request.php index 06ae906052e938df833854bb1d5a31dd9d0bb8aa..a31bbcebf1eccf6e68eda3123b239eb56578cc16 100644 --- a/typo3/sysext/extbase/Classes/Mvc/Cli/Request.php +++ b/typo3/sysext/extbase/Classes/Mvc/Cli/Request.php @@ -34,7 +34,6 @@ class Request implements \TYPO3\CMS\Extbase\Mvc\RequestInterface { /** * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface - * @inject */ protected $objectManager; @@ -82,6 +81,14 @@ class Request implements \TYPO3\CMS\Extbase\Mvc\RequestInterface { */ protected $command = NULL; + /** + * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager A reference to the object manager + * @return void + */ + public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) { + $this->objectManager = $objectManager; + } + /** * Sets the dispatched flag * diff --git a/typo3/sysext/extbase/Classes/Mvc/Cli/RequestBuilder.php b/typo3/sysext/extbase/Classes/Mvc/Cli/RequestBuilder.php index b3528bf60043e008d7cf7366ba5fd3d60121b437..31631fc1e221ccaee5b5a181037d095295552457 100644 --- a/typo3/sysext/extbase/Classes/Mvc/Cli/RequestBuilder.php +++ b/typo3/sysext/extbase/Classes/Mvc/Cli/RequestBuilder.php @@ -33,22 +33,43 @@ 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. * diff --git a/typo3/sysext/extbase/Classes/Mvc/Cli/RequestHandler.php b/typo3/sysext/extbase/Classes/Mvc/Cli/RequestHandler.php index 96011a30d3037567341c5d40ab95f73aea6073fe..b023c6b910c30ddaf41a4ad629841d9173290f0e 100644 --- a/typo3/sysext/extbase/Classes/Mvc/Cli/RequestHandler.php +++ b/typo3/sysext/extbase/Classes/Mvc/Cli/RequestHandler.php @@ -33,28 +33,56 @@ 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 * diff --git a/typo3/sysext/extbase/Classes/Mvc/Controller/AbstractController.php b/typo3/sysext/extbase/Classes/Mvc/Controller/AbstractController.php index 20d27892b8e9949087a46c247b33d53d43fb5d1f..87f75aba1c881fca1f720fb54e6572586505728c 100644 --- a/typo3/sysext/extbase/Classes/Mvc/Controller/AbstractController.php +++ b/typo3/sysext/extbase/Classes/Mvc/Controller/AbstractController.php @@ -36,7 +36,6 @@ abstract class AbstractController implements \TYPO3\CMS\Extbase\Mvc\Controller\C /** * @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher - * @inject */ protected $signalSlotDispatcher; @@ -82,13 +81,11 @@ abstract class AbstractController implements \TYPO3\CMS\Extbase\Mvc\Controller\C /** * @var \TYPO3\CMS\Extbase\Property\Mapper * @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1 - * @inject */ protected $deprecatedPropertyMapper; /** * @var \TYPO3\CMS\Extbase\Validation\ValidatorResolver - * @inject */ protected $validatorResolver; @@ -167,6 +164,17 @@ abstract class AbstractController implements \TYPO3\CMS\Extbase\Mvc\Controller\C $this->settings = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS); } + /** + * 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 * @@ -178,6 +186,16 @@ abstract class AbstractController implements \TYPO3\CMS\Extbase\Mvc\Controller\C $this->arguments = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Arguments'); } + /** + * 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 @@ -191,6 +209,15 @@ abstract class AbstractController implements \TYPO3\CMS\Extbase\Mvc\Controller\C $this->flashMessageContainer = $flashMessageContainer; } + /** + * 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. * diff --git a/typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php b/typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php index fc8b8a8175de70b1a79abd5c9d04a44cda98fdb6..b2382b284da1bbaecbd4fc13b2e497e395fb69ea 100644 --- a/typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php +++ b/typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php @@ -36,13 +36,11 @@ class ActionController extends \TYPO3\CMS\Extbase\Mvc\Controller\AbstractControl /** * @var \TYPO3\CMS\Extbase\Reflection\ReflectionService - * @inject */ protected $reflectionService; /** * @var \TYPO3\CMS\Extbase\Service\CacheService - * @inject */ protected $cacheService; @@ -108,11 +106,33 @@ 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. * diff --git a/typo3/sysext/extbase/Classes/Mvc/Controller/Argument.php b/typo3/sysext/extbase/Classes/Mvc/Controller/Argument.php index 3d67bdb2b4dce8495c666b2c1849b19c81dffcc3..be49f8eb357c6d09be7d0fedfcd5149aa689069c 100644 --- a/typo3/sysext/extbase/Classes/Mvc/Controller/Argument.php +++ b/typo3/sysext/extbase/Classes/Mvc/Controller/Argument.php @@ -36,25 +36,21 @@ class Argument { /** * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface - * @inject */ protected $objectManager; /** * @var \TYPO3\CMS\Extbase\Persistence\Generic\QueryFactory - * @inject */ protected $queryFactory; /** * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface - * @inject */ protected $configurationManager; /** * This is the old property mapper, which has been completely rewritten for 1.4. - * @inject * * @var \TYPO3\CMS\Extbase\Property\Mapper */ @@ -64,13 +60,11 @@ class Argument { * The new, completely rewritten property mapper since Extbase 1.4. * * @var \TYPO3\CMS\Extbase\Property\PropertyMapper - * @inject */ protected $propertyMapper; /** * @var \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfiguration - * @inject */ protected $propertyMappingConfiguration; @@ -170,7 +164,6 @@ class Argument { /** * @var \TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface - * @inject */ protected $persistenceManager; @@ -193,6 +186,32 @@ class Argument { $this->dataType = $dataType; } + /** + * 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 @@ -203,6 +222,34 @@ class Argument { $this->dataTypeClassSchema = strpbrk($this->dataType, '_\\') !== FALSE ? $this->reflectionService->getClassSchema($this->dataType) : NULL; } + /** + * 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 @@ -212,6 +259,14 @@ class Argument { $this->dataType = $this->typeHandlingService->normalizeType($this->dataType); } + /** + * @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 * diff --git a/typo3/sysext/extbase/Classes/Mvc/Controller/Arguments.php b/typo3/sysext/extbase/Classes/Mvc/Controller/Arguments.php index 2ebd23324d1cb943e601ea18e23a59814bf7509d..ca5a4de8d7f923e4cdf50e32324ce1537aa2469e 100644 --- a/typo3/sysext/extbase/Classes/Mvc/Controller/Arguments.php +++ b/typo3/sysext/extbase/Classes/Mvc/Controller/Arguments.php @@ -34,7 +34,6 @@ class Arguments extends \ArrayObject { /** * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface - * @inject */ protected $objectManager; @@ -55,6 +54,16 @@ class Arguments extends \ArrayObject { parent::__construct(); } + /** + * 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. diff --git a/typo3/sysext/extbase/Classes/Mvc/Controller/CommandController.php b/typo3/sysext/extbase/Classes/Mvc/Controller/CommandController.php index daab2b349167544652a40f7ba4337dca1db0cc65..b553d58599829926473b46db38ec68a1f2911e29 100644 --- a/typo3/sysext/extbase/Classes/Mvc/Controller/CommandController.php +++ b/typo3/sysext/extbase/Classes/Mvc/Controller/CommandController.php @@ -57,7 +57,6 @@ class CommandController implements \TYPO3\CMS\Extbase\Mvc\Controller\CommandCont /** * @var \TYPO3\CMS\Extbase\Reflection\ReflectionService - * @inject */ protected $reflectionService; @@ -66,6 +65,14 @@ class CommandController implements \TYPO3\CMS\Extbase\Mvc\Controller\CommandCont */ protected $objectManager; + /** + * @param \TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService + * @return void + */ + public function injectReflectionService(\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService) { + $this->reflectionService = $reflectionService; + } + /** * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager * @return void diff --git a/typo3/sysext/extbase/Classes/Mvc/Controller/ControllerContext.php b/typo3/sysext/extbase/Classes/Mvc/Controller/ControllerContext.php index af54621d78cec4897d1b4f83960c1e99e836193b..643bb46c4e2303046e8c13bb1211014db1af22db 100644 --- a/typo3/sysext/extbase/Classes/Mvc/Controller/ControllerContext.php +++ b/typo3/sysext/extbase/Classes/Mvc/Controller/ControllerContext.php @@ -73,22 +73,40 @@ 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 * diff --git a/typo3/sysext/extbase/Classes/Mvc/Controller/MvcPropertyMappingConfigurationService.php b/typo3/sysext/extbase/Classes/Mvc/Controller/MvcPropertyMappingConfigurationService.php index 487d79b44a8997a6ea32c6eb9f504896aa63c83e..0c2186b7f35a5b225e2f4d2069be903025952049 100644 --- a/typo3/sysext/extbase/Classes/Mvc/Controller/MvcPropertyMappingConfigurationService.php +++ b/typo3/sysext/extbase/Classes/Mvc/Controller/MvcPropertyMappingConfigurationService.php @@ -50,10 +50,18 @@ 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 * diff --git a/typo3/sysext/extbase/Classes/Mvc/Dispatcher.php b/typo3/sysext/extbase/Classes/Mvc/Dispatcher.php index 35dcc620035c2e27cb93f1fb45acd26a3c41fb9f..99de9109788c365fb0f2a003320beb126d1a79f4 100644 --- a/typo3/sysext/extbase/Classes/Mvc/Dispatcher.php +++ b/typo3/sysext/extbase/Classes/Mvc/Dispatcher.php @@ -40,13 +40,11 @@ class Dispatcher implements \TYPO3\CMS\Core\SingletonInterface { /** * @var \TYPO3\CMS\Extbase\Reflection\ReflectionService - * @inject */ protected $reflectionService; /** * @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher - * @inject */ protected $signalSlotDispatcher; @@ -64,6 +62,25 @@ class Dispatcher implements \TYPO3\CMS\Core\SingletonInterface { $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 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. * diff --git a/typo3/sysext/extbase/Classes/Mvc/RequestHandlerResolver.php b/typo3/sysext/extbase/Classes/Mvc/RequestHandlerResolver.php index 98a8d68f58ef466580252e28fefae4f6659087e4..fdaeaf1235f3e1ecd2984637e05eb24b3a58666b 100644 --- a/typo3/sysext/extbase/Classes/Mvc/RequestHandlerResolver.php +++ b/typo3/sysext/extbase/Classes/Mvc/RequestHandlerResolver.php @@ -34,22 +34,49 @@ 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. diff --git a/typo3/sysext/extbase/Classes/Mvc/Web/AbstractRequestHandler.php b/typo3/sysext/extbase/Classes/Mvc/Web/AbstractRequestHandler.php index 517967df64cf078523658359c0e1326b29c2a722..b353a1985e8798f2de1823eb3ec931133b33e91e 100644 --- a/typo3/sysext/extbase/Classes/Mvc/Web/AbstractRequestHandler.php +++ b/typo3/sysext/extbase/Classes/Mvc/Web/AbstractRequestHandler.php @@ -34,28 +34,56 @@ 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. * diff --git a/typo3/sysext/extbase/Classes/Mvc/Web/FrontendRequestHandler.php b/typo3/sysext/extbase/Classes/Mvc/Web/FrontendRequestHandler.php index 50f4a2f79690445dc92acf6728a1109b50ca3907..116c3edca94bb80b43229f8b44948cb1ceefedaa 100644 --- a/typo3/sysext/extbase/Classes/Mvc/Web/FrontendRequestHandler.php +++ b/typo3/sysext/extbase/Classes/Mvc/Web/FrontendRequestHandler.php @@ -34,16 +34,30 @@ 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. * diff --git a/typo3/sysext/extbase/Classes/Mvc/Web/Request.php b/typo3/sysext/extbase/Classes/Mvc/Web/Request.php index 35cadb92014eb3594d1761fe95129df15523e3cd..73a1ae11910a1108a1bacff552a4284b2b70c5e9 100644 --- a/typo3/sysext/extbase/Classes/Mvc/Web/Request.php +++ b/typo3/sysext/extbase/Classes/Mvc/Web/Request.php @@ -36,7 +36,6 @@ class Request extends \TYPO3\CMS\Extbase\Mvc\Request { /** * @var \TYPO3\CMS\Extbase\Security\Cryptography\HashService - * @inject */ protected $hashService; @@ -73,16 +72,38 @@ 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 * diff --git a/typo3/sysext/extbase/Classes/Mvc/Web/RequestBuilder.php b/typo3/sysext/extbase/Classes/Mvc/Web/RequestBuilder.php index 62e78fdaa84c95c0dec383f17a34d4231bbd3ec3..00e6caf965f0c100acd45ca18a3bbc3de06db982 100644 --- a/typo3/sysext/extbase/Classes/Mvc/Web/RequestBuilder.php +++ b/typo3/sysext/extbase/Classes/Mvc/Web/RequestBuilder.php @@ -34,7 +34,6 @@ class RequestBuilder implements \TYPO3\CMS\Core\SingletonInterface { /** * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface - * @inject */ protected $objectManager; @@ -82,22 +81,52 @@ 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 diff --git a/typo3/sysext/extbase/Classes/Mvc/Web/Response.php b/typo3/sysext/extbase/Classes/Mvc/Web/Response.php index ad8943a4b9f1fad49a2250c86f577bb7f885a114..67c9de622867e6fd866a79ce64381c09271876ee 100644 --- a/typo3/sysext/extbase/Classes/Mvc/Web/Response.php +++ b/typo3/sysext/extbase/Classes/Mvc/Web/Response.php @@ -124,10 +124,18 @@ 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. * diff --git a/typo3/sysext/extbase/Classes/Mvc/Web/Routing/UriBuilder.php b/typo3/sysext/extbase/Classes/Mvc/Web/Routing/UriBuilder.php index aab6128249c2d2f83623888bea67d0a1a172f6e3..a5efd9874d714c3585d835b35025d5857d23cda9 100644 --- a/typo3/sysext/extbase/Classes/Mvc/Web/Routing/UriBuilder.php +++ b/typo3/sysext/extbase/Classes/Mvc/Web/Routing/UriBuilder.php @@ -22,13 +22,11 @@ class UriBuilder { /** * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface - * @inject */ protected $configurationManager; /** * @var \TYPO3\CMS\Extbase\Service\ExtensionService - * @inject */ protected $extensionService; @@ -118,10 +116,33 @@ 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 * diff --git a/typo3/sysext/extbase/Classes/Object/Container/ClassInfoFactory.php b/typo3/sysext/extbase/Classes/Object/Container/ClassInfoFactory.php index bf86393ce70571c2fc539474885cab31e69d4312..69f51f964bb29f8346e561c4455e6cf01eb71e81 100644 --- a/typo3/sysext/extbase/Classes/Object/Container/ClassInfoFactory.php +++ b/typo3/sysext/extbase/Classes/Object/Container/ClassInfoFactory.php @@ -123,7 +123,7 @@ class ClassInfoFactory { if (is_array($reflectionProperties)) { foreach ($reflectionProperties as $reflectionProperty) { $reflectedProperty = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Reflection\\PropertyReflection', $reflectedClass->getName(), $reflectionProperty->getName()); - if (($reflectedProperty->isTaggedWith('inject') || $reflectedProperty->isTaggedWith('Flow\\Inject')) && $reflectedProperty->getName() !== 'settings') { + if (($reflectedProperty->isTaggedWith('inject') || $reflectedProperty->isTaggedWith('Flow\Inject')) && $reflectedProperty->getName() !== 'settings') { $varValues = $reflectedProperty->getTagValues('var'); if (count($varValues) == 1) { $result[$reflectedProperty->getName()] = ltrim($varValues[0], '\\'); diff --git a/typo3/sysext/extbase/Classes/Object/Container/Container.php b/typo3/sysext/extbase/Classes/Object/Container/Container.php index b74fb0b0a44dca9c867cf8054ddf6e720d81bcd2..e30a8e7b709c81f770503914c73c8d202dc642d6 100644 --- a/typo3/sysext/extbase/Classes/Object/Container/Container.php +++ b/typo3/sysext/extbase/Classes/Object/Container/Container.php @@ -230,7 +230,6 @@ class Container implements \TYPO3\CMS\Core\SingletonInterface { $this->log('The singleton "' . $classInfo->getClassName() . '" needs a prototype in "' . $injectPropertyName . '". This is often a bad code smell; often you rather want to inject a singleton.', 1320177676); } $propertyReflection = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Reflection\\PropertyReflection', $instance, $injectPropertyName); - $propertyReflection->setAccessible(TRUE); $propertyReflection->setValue($instance, $instanceToInject); } diff --git a/typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php b/typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php index 04c11635f31e10721ec9c7f742eb305f772be181..41f907d4c18bad040014544a2df333e40360c5c4 100644 --- a/typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php +++ b/typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php @@ -35,7 +35,6 @@ class Backend implements \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface /** * @var \TYPO3\CMS\Extbase\Persistence\Generic\Session - * @inject */ protected $session; @@ -66,25 +65,21 @@ class Backend implements \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface /** * @var \TYPO3\CMS\Extbase\Reflection\ReflectionService - * @inject */ protected $reflectionService; /** * @var \TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelFactory - * @inject */ protected $qomFactory; /** * @var \TYPO3\CMS\Extbase\Persistence\Generic\Storage\BackendInterface - * @inject */ protected $storageBackend; /** * @var \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper - * @inject */ protected $dataMapper; @@ -102,7 +97,6 @@ class Backend implements \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface /** * @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher - * @inject */ protected $signalSlotDispatcher; @@ -120,6 +114,59 @@ class Backend implements \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface $this->changedEntities = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); } + /** + * @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 */ diff --git a/typo3/sysext/extbase/Classes/Persistence/Generic/IdentityMap.php b/typo3/sysext/extbase/Classes/Persistence/Generic/IdentityMap.php index f29a6fea0409d3bb19db78d6feac21cef1c7a68c..8de6cd8a28d6585191332bc08862d7df4bf222dd 100644 --- a/typo3/sysext/extbase/Classes/Persistence/Generic/IdentityMap.php +++ b/typo3/sysext/extbase/Classes/Persistence/Generic/IdentityMap.php @@ -39,10 +39,16 @@ 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 * diff --git a/typo3/sysext/extbase/Classes/Persistence/Generic/LazyLoadingProxy.php b/typo3/sysext/extbase/Classes/Persistence/Generic/LazyLoadingProxy.php index 66646e2c7dc4480fe7b3460c7ad518df63cc23da..7a496d667ec857042d040d30fa60944d4844bc0a 100644 --- a/typo3/sysext/extbase/Classes/Persistence/Generic/LazyLoadingProxy.php +++ b/typo3/sysext/extbase/Classes/Persistence/Generic/LazyLoadingProxy.php @@ -35,7 +35,6 @@ class LazyLoadingProxy implements \Iterator, \TYPO3\CMS\Extbase\Persistence\Gene /** * @var \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper - * @inject */ protected $dataMapper; @@ -73,6 +72,16 @@ class LazyLoadingProxy implements \Iterator, \TYPO3\CMS\Extbase\Persistence\Gene $this->fieldValue = $fieldValue; } + /** + * 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. * diff --git a/typo3/sysext/extbase/Classes/Persistence/Generic/LazyObjectStorage.php b/typo3/sysext/extbase/Classes/Persistence/Generic/LazyObjectStorage.php index 8270c3a00c79fb4928921d118869b7db3bd87da9..3661ddb08ff8689e539d79c9c0548e163d6df819 100644 --- a/typo3/sysext/extbase/Classes/Persistence/Generic/LazyObjectStorage.php +++ b/typo3/sysext/extbase/Classes/Persistence/Generic/LazyObjectStorage.php @@ -45,7 +45,6 @@ class LazyObjectStorage extends \TYPO3\CMS\Extbase\Persistence\ObjectStorage imp /** * @var \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper - * @inject */ protected $dataMapper; @@ -98,6 +97,16 @@ class LazyObjectStorage extends \TYPO3\CMS\Extbase\Persistence\ObjectStorage imp reset($this->storage); } + /** + * 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. * diff --git a/typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapFactory.php b/typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapFactory.php index 5ad5c3108938bae1e1c5712a9926ffb75d800bdb..d052ae8ad070f84b38839180be84e6a112f557b0 100644 --- a/typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapFactory.php +++ b/typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapFactory.php @@ -34,25 +34,21 @@ class DataMapFactory implements \TYPO3\CMS\Core\SingletonInterface { /** * @var \TYPO3\CMS\Extbase\Reflection\ReflectionService - * @inject */ protected $reflectionService; /** * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface - * @inject */ protected $configurationManager; /** * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface - * @inject */ protected $objectManager; /** * @var \TYPO3\CMS\Core\Cache\CacheManager - * @inject */ protected $cacheManager; @@ -61,6 +57,39 @@ class DataMapFactory implements \TYPO3\CMS\Core\SingletonInterface { */ protected $dataMapCache; + /** + * Injects the reflection service + * + * @param \TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService + * @return void + */ + public function injectReflectionService(\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService) { + $this->reflectionService = $reflectionService; + } + + /** + * @param \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager + * @return void + */ + public function injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager) { + $this->configurationManager = $configurationManager; + } + + /** + * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager + * @return void + */ + public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) { + $this->objectManager = $objectManager; + } + + /** + * @param \TYPO3\CMS\Core\Cache\CacheManager $cacheManager + */ + public function injectCacheManager(\TYPO3\CMS\Core\Cache\CacheManager $cacheManager) { + $this->cacheManager = $cacheManager; + } + /** * Lifecycle method * diff --git a/typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapper.php b/typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapper.php index 461911c5c8ef5c9793262999d7d5769474c0bed9..a354429cb2a8d8d8fffe828eead1d5e9fe73ebb4 100644 --- a/typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapper.php +++ b/typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapper.php @@ -34,25 +34,21 @@ class DataMapper implements \TYPO3\CMS\Core\SingletonInterface { /** * @var \TYPO3\CMS\Extbase\Persistence\Generic\IdentityMap - * @inject */ protected $identityMap; /** * @var \TYPO3\CMS\Extbase\Reflection\ReflectionService - * @inject */ protected $reflectionService; /** * @var \TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelFactory - * @inject */ protected $qomFactory; /** * @var \TYPO3\CMS\Extbase\Persistence\Generic\Session - * @inject */ protected $persistenceSession; @@ -72,13 +68,11 @@ class DataMapper implements \TYPO3\CMS\Core\SingletonInterface { /** * @var \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory - * @inject */ protected $dataMapFactory; /** * @var \TYPO3\CMS\Extbase\Persistence\Generic\QueryFactoryInterface - * @inject */ protected $queryFactory; @@ -91,10 +85,76 @@ 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 * diff --git a/typo3/sysext/extbase/Classes/Persistence/Generic/PersistenceManager.php b/typo3/sysext/extbase/Classes/Persistence/Generic/PersistenceManager.php index 0e80a71997b3810a2595cfa73f2ff2208c650615..30617a976eb37a3de8f0098b0e40af0f0a1d4a81 100644 --- a/typo3/sysext/extbase/Classes/Persistence/Generic/PersistenceManager.php +++ b/typo3/sysext/extbase/Classes/Persistence/Generic/PersistenceManager.php @@ -56,19 +56,16 @@ class PersistenceManager implements \TYPO3\CMS\Extbase\Persistence\PersistenceMa /** * @var \TYPO3\CMS\Extbase\Persistence\Generic\QueryFactoryInterface - * @inject */ protected $queryFactory; /** * @var \TYPO3\CMS\Extbase\Persistence\Generic\Backend - * @inject */ protected $backend; /** * @var \TYPO3\CMS\Extbase\Persistence\Generic\Session - * @inject */ protected $persistenceSession; @@ -81,6 +78,36 @@ class PersistenceManager implements \TYPO3\CMS\Extbase\Persistence\PersistenceMa $this->changedObjects = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); } + /** + * 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 * diff --git a/typo3/sysext/extbase/Classes/Persistence/Generic/Qom/QueryObjectModelFactory.php b/typo3/sysext/extbase/Classes/Persistence/Generic/Qom/QueryObjectModelFactory.php index 08f1f9d23f182e4dc197fe8acc3c354dd7661b48..25cefb9bf32ad853c1cd25c4561a769505e7dcc9 100644 --- a/typo3/sysext/extbase/Classes/Persistence/Generic/Qom/QueryObjectModelFactory.php +++ b/typo3/sysext/extbase/Classes/Persistence/Generic/Qom/QueryObjectModelFactory.php @@ -34,10 +34,17 @@ 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. * diff --git a/typo3/sysext/extbase/Classes/Persistence/Generic/Query.php b/typo3/sysext/extbase/Classes/Persistence/Generic/Query.php index 53ccea593e5a1b5e93c9131cef40e98253296ade..45bb74cdc025b31c0dbcfd52beecf4ed056ae891 100644 --- a/typo3/sysext/extbase/Classes/Persistence/Generic/Query.php +++ b/typo3/sysext/extbase/Classes/Persistence/Generic/Query.php @@ -61,25 +61,21 @@ class Query implements \TYPO3\CMS\Extbase\Persistence\QueryInterface { /** * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface - * @inject */ protected $objectManager; /** * @var \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper - * @inject */ protected $dataMapper; /** * @var \TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface - * @inject */ protected $persistenceManager; /** * @var \TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelFactory - * @inject */ protected $qomFactory; @@ -129,6 +125,44 @@ class Query implements \TYPO3\CMS\Extbase\Persistence\QueryInterface { $this->type = $type; } + /** + * @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. diff --git a/typo3/sysext/extbase/Classes/Persistence/Generic/QueryFactory.php b/typo3/sysext/extbase/Classes/Persistence/Generic/QueryFactory.php index d8222ea33b7edcc170d3377dcf957ea1f5842ef4..5c7637be27d46080bc23311d111ecf2c4f9ec004 100644 --- a/typo3/sysext/extbase/Classes/Persistence/Generic/QueryFactory.php +++ b/typo3/sysext/extbase/Classes/Persistence/Generic/QueryFactory.php @@ -34,22 +34,42 @@ 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 * diff --git a/typo3/sysext/extbase/Classes/Persistence/Generic/QueryResult.php b/typo3/sysext/extbase/Classes/Persistence/Generic/QueryResult.php index 80ed5c9d2fafbe9452f92dbb6cc5175d781a12c6..be32ee3cb6a48d95ce1758fdf10b42dc48b41e24 100644 --- a/typo3/sysext/extbase/Classes/Persistence/Generic/QueryResult.php +++ b/typo3/sysext/extbase/Classes/Persistence/Generic/QueryResult.php @@ -47,13 +47,11 @@ class QueryResult implements \TYPO3\CMS\Extbase\Persistence\QueryResultInterface /** * @var \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper - * @inject */ protected $dataMapper; /** * @var \TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface - * @inject */ protected $persistenceManager; @@ -77,6 +75,26 @@ class QueryResult implements \TYPO3\CMS\Extbase\Persistence\QueryResultInterface $this->query = $query; } + /** + * 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 * diff --git a/typo3/sysext/extbase/Classes/Persistence/Generic/Session.php b/typo3/sysext/extbase/Classes/Persistence/Generic/Session.php index ef189d1a60c87c4eec6e428e9eadf84830bac291..43e4467c33d2780b22840b4a781cd5455796b34d 100644 --- a/typo3/sysext/extbase/Classes/Persistence/Generic/Session.php +++ b/typo3/sysext/extbase/Classes/Persistence/Generic/Session.php @@ -60,7 +60,6 @@ class Session implements \TYPO3\CMS\Core\SingletonInterface { /** * @var \TYPO3\CMS\Extbase\Reflection\ReflectionService - * @inject */ protected $reflectionService; @@ -72,6 +71,16 @@ class Session implements \TYPO3\CMS\Core\SingletonInterface { $this->objectMap = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); } + /** + * 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. * diff --git a/typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbBackend.php b/typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbBackend.php index 1d1d0e08d616071eef5c4c39c607139d08fc5fe6..bdca5e0b53d2274eb5df81e359fa927df78a75f6 100644 --- a/typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbBackend.php +++ b/typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbBackend.php @@ -44,7 +44,6 @@ class Typo3DbBackend implements \TYPO3\CMS\Extbase\Persistence\Generic\Storage\B /** * @var \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper - * @inject */ protected $dataMapper; @@ -64,19 +63,16 @@ class Typo3DbBackend implements \TYPO3\CMS\Extbase\Persistence\Generic\Storage\B /** * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface - * @inject */ protected $configurationManager; /** * @var \TYPO3\CMS\Extbase\Service\CacheService - * @inject */ protected $cacheService; /** * @var \TYPO3\CMS\Core\Cache\CacheManager - * @inject */ protected $cacheManager; @@ -87,7 +83,6 @@ class Typo3DbBackend implements \TYPO3\CMS\Extbase\Persistence\Generic\Storage\B /** * @var \TYPO3\CMS\Extbase\Service\EnvironmentService - * @inject */ protected $environmentService; @@ -98,6 +93,21 @@ class Typo3DbBackend implements \TYPO3\CMS\Extbase\Persistence\Generic\Storage\B $this->databaseHandle = $GLOBALS['TYPO3_DB']; } + /** + * @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 * @@ -107,6 +117,32 @@ class Typo3DbBackend implements \TYPO3\CMS\Extbase\Persistence\Generic\Storage\B $this->tableColumnCache = $this->cacheManager->getCache('extbase_typo3dbbackend_tablecolumns'); } + /** + * 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 * diff --git a/typo3/sysext/extbase/Classes/Persistence/Repository.php b/typo3/sysext/extbase/Classes/Persistence/Repository.php index 3cef6a433cd2cd63d895cd5570bbcd0f348cf36d..b3bbfc518a7e1cc1313c5adb2232d00fa8a74aba 100644 --- a/typo3/sysext/extbase/Classes/Persistence/Repository.php +++ b/typo3/sysext/extbase/Classes/Persistence/Repository.php @@ -37,27 +37,23 @@ class Repository implements \TYPO3\CMS\Extbase\Persistence\RepositoryInterface, /** * @var \TYPO3\CMS\Extbase\Persistence\Generic\IdentityMap * @deprecated since 6.1 will be removed two versions later, use the persistence session instead - * @inject */ protected $identityMap; /** * @var \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface * @deprecated since 6.1, will be removed two versions later, use the persistence manager instead - * @inject */ protected $backend; /** * @var \TYPO3\CMS\Extbase\Persistence\Generic\Session * @deprecated since 6.1 will be removed two versions later, use the persistence manager instead - * @inject */ protected $session; /** * @var \TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface - * @inject */ protected $persistenceManager; @@ -97,15 +93,54 @@ class Repository implements \TYPO3\CMS\Extbase\Persistence\RepositoryInterface, \TYPO3\CMS\Core\Utility\GeneralUtility::logDeprecatedFunction(); $this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager'); - $this->identityMap = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\IdentityMap'); - $this->persistenceManager = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\PersistenceManager'); - $this->backend = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\BackendInterface'); - $this->session = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Session'); + $this->injectIdentityMap($this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\IdentityMap')); + $this->injectPersistenceManager($this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\PersistenceManager')); + $this->injectBackend($this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\BackendInterface')); + $this->injectSession($this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Session')); } else { $this->objectManager = $objectManager; } } + /** + * @param \TYPO3\CMS\Extbase\Persistence\Generic\IdentityMap $identityMap + * @return void + * @deprecated since 6.1, will be removed two versions later + */ + public function injectIdentityMap(\TYPO3\CMS\Extbase\Persistence\Generic\IdentityMap $identityMap) { + $this->identityMap = $identityMap; + } + + /** + * Injects the Persistence Backend + * + * @param \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface $backend The persistence backend + * @return void + * @deprecated since 6.1, will be removed two versions later + */ + public function injectBackend(\TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface $backend) { + $this->backend = $backend; + } + + /** + * Injects the Persistence Session + * + * @param \TYPO3\CMS\Extbase\Persistence\Generic\Session $session The persistence session + * @return void + * @deprecated since 6.1, will be removed two versions later + */ + public function injectSession(\TYPO3\CMS\Extbase\Persistence\Generic\Session $session) { + $this->session = $session; + } + + /** + * @param \TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface $persistenceManager + * @return void + */ + public function injectPersistenceManager(\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface $persistenceManager) { + $this->persistenceManager = $persistenceManager; + } + /** * Adds an object to this repository * diff --git a/typo3/sysext/extbase/Classes/Property/Mapper.php b/typo3/sysext/extbase/Classes/Property/Mapper.php index 0346a0a4c7228f67dea6fd223d5d66270c1454e3..ee110835799b4ccde776a13aff0f70a6ab126a1b 100644 --- a/typo3/sysext/extbase/Classes/Property/Mapper.php +++ b/typo3/sysext/extbase/Classes/Property/Mapper.php @@ -61,34 +61,69 @@ 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 diff --git a/typo3/sysext/extbase/Classes/Property/PropertyMapper.php b/typo3/sysext/extbase/Classes/Property/PropertyMapper.php index bd37fc3980e658db8427b3e474c9cc75fb82ba0c..64d514e444be157fdb6810b872b09be23e8dbf29 100644 --- a/typo3/sysext/extbase/Classes/Property/PropertyMapper.php +++ b/typo3/sysext/extbase/Classes/Property/PropertyMapper.php @@ -31,13 +31,11 @@ class PropertyMapper implements \TYPO3\CMS\Core\SingletonInterface { /** * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface - * @inject */ protected $objectManager; /** * @var \TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationBuilder - * @inject */ protected $configurationBuilder; @@ -60,6 +58,22 @@ class PropertyMapper implements \TYPO3\CMS\Core\SingletonInterface { */ protected $messages; + /** + * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager + * @return void + */ + public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) { + $this->objectManager = $objectManager; + } + + /** + * @param \TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationBuilder $propertyMappingConfigurationBuilder + * @return void + */ + public function injectPropertyMappingConfigurationBuilder(\TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationBuilder $propertyMappingConfigurationBuilder) { + $this->configurationBuilder = $propertyMappingConfigurationBuilder; + } + /** * Lifecycle method, called after all dependencies have been injected. * Here, the typeConverter array gets initialized. diff --git a/typo3/sysext/extbase/Classes/Property/TypeConverter/AbstractFileCollectionConverter.php b/typo3/sysext/extbase/Classes/Property/TypeConverter/AbstractFileCollectionConverter.php index 9bab34ffe4ca06863223b35ed87d1526554d14cd..8b3cf36c2adbc5e4d2cbf5ced33fbfd1b3fb9360 100644 --- a/typo3/sysext/extbase/Classes/Property/TypeConverter/AbstractFileCollectionConverter.php +++ b/typo3/sysext/extbase/Classes/Property/TypeConverter/AbstractFileCollectionConverter.php @@ -46,10 +46,16 @@ 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. diff --git a/typo3/sysext/extbase/Classes/Property/TypeConverter/AbstractFileFolderConverter.php b/typo3/sysext/extbase/Classes/Property/TypeConverter/AbstractFileFolderConverter.php index f382ed2a72bb6fc36c5a998144aa2ca60daa5bca..bd73bfa2b3900bfc4990bfc92daf85076f84d144 100644 --- a/typo3/sysext/extbase/Classes/Property/TypeConverter/AbstractFileFolderConverter.php +++ b/typo3/sysext/extbase/Classes/Property/TypeConverter/AbstractFileFolderConverter.php @@ -46,10 +46,16 @@ 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. diff --git a/typo3/sysext/extbase/Classes/Property/TypeConverter/AbstractTypeConverter.php b/typo3/sysext/extbase/Classes/Property/TypeConverter/AbstractTypeConverter.php index 9a21906cdaa54344a9cd1d9e54d924a5fb0d03e0..4ca8bd9f683cfcb51d5eeacd89ea88f55f903215 100644 --- a/typo3/sysext/extbase/Classes/Property/TypeConverter/AbstractTypeConverter.php +++ b/typo3/sysext/extbase/Classes/Property/TypeConverter/AbstractTypeConverter.php @@ -58,10 +58,18 @@ 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. diff --git a/typo3/sysext/extbase/Classes/Reflection/ClassSchema.php b/typo3/sysext/extbase/Classes/Reflection/ClassSchema.php index e16b7b3896155114d0de438e74780ed6bc92a76f..24c8aeaa7f6c9af4379dda20c4e768ef86554d84 100644 --- a/typo3/sysext/extbase/Classes/Reflection/ClassSchema.php +++ b/typo3/sysext/extbase/Classes/Reflection/ClassSchema.php @@ -84,7 +84,6 @@ class ClassSchema { /** * @var \TYPO3\CMS\Extbase\Service\TypeHandlingService - * @inject */ protected $typeHandlingService; @@ -97,6 +96,14 @@ class ClassSchema { $this->className = $className; } + /** + * @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 * diff --git a/typo3/sysext/extbase/Classes/Reflection/ReflectionService.php b/typo3/sysext/extbase/Classes/Reflection/ReflectionService.php index 395626c2e8fd18675b6106dfdf5ee51899a08129..f302e357fa46e4bfcfa39298249a2e784d4b746e 100644 --- a/typo3/sysext/extbase/Classes/Reflection/ReflectionService.php +++ b/typo3/sysext/extbase/Classes/Reflection/ReflectionService.php @@ -40,7 +40,6 @@ class ReflectionService implements \TYPO3\CMS\Core\SingletonInterface { /** * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface - * @inject */ protected $objectManager; @@ -142,7 +141,6 @@ class ReflectionService implements \TYPO3\CMS\Core\SingletonInterface { /** * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface - * @inject */ protected $configurationManager; @@ -156,6 +154,22 @@ class ReflectionService implements \TYPO3\CMS\Core\SingletonInterface { */ protected $methodReflections = array(); + /** + * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager + * @return void + */ + public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) { + $this->objectManager = $objectManager; + } + + /** + * @param \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager + * @return void + */ + public function injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager) { + $this->configurationManager = $configurationManager; + } + /** * Sets the data cache. * diff --git a/typo3/sysext/extbase/Classes/Scheduler/TaskExecutor.php b/typo3/sysext/extbase/Classes/Scheduler/TaskExecutor.php index d8fa9e971fae06ad85705ffbc9c559765ca827cf..782a8977aed1ea16d996abc54e48336e947e9924 100644 --- a/typo3/sysext/extbase/Classes/Scheduler/TaskExecutor.php +++ b/typo3/sysext/extbase/Classes/Scheduler/TaskExecutor.php @@ -52,22 +52,40 @@ 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 */ diff --git a/typo3/sysext/extbase/Classes/Security/Channel/RequestHashService.php b/typo3/sysext/extbase/Classes/Security/Channel/RequestHashService.php index 87ad9a63966b59254636ffde4f184f5020e2320d..b075dc0f99c6179de4afc753a0260a01e8181e97 100644 --- a/typo3/sysext/extbase/Classes/Security/Channel/RequestHashService.php +++ b/typo3/sysext/extbase/Classes/Security/Channel/RequestHashService.php @@ -49,10 +49,17 @@ 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 * diff --git a/typo3/sysext/extbase/Classes/Service/ExtensionService.php b/typo3/sysext/extbase/Classes/Service/ExtensionService.php index 13d6356b26f196e7863a5018ac2751756ec5eb78..4837adfd4c76eefae3e1e718d797fa17a5be45f8 100644 --- a/typo3/sysext/extbase/Classes/Service/ExtensionService.php +++ b/typo3/sysext/extbase/Classes/Service/ExtensionService.php @@ -37,13 +37,11 @@ class ExtensionService implements \TYPO3\CMS\Core\SingletonInterface { /** * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface - * @inject */ protected $objectManager; /** * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface - * @inject */ protected $configurationManager; @@ -53,6 +51,22 @@ class ExtensionService implements \TYPO3\CMS\Core\SingletonInterface { */ protected $targetPidPluginCache = array(); + /** + * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager + * @return void + */ + public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) { + $this->objectManager = $objectManager; + } + + /** + * @param \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager + * @return void + */ + public function injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager) { + $this->configurationManager = $configurationManager; + } + /** * Determines the plugin namespace of the specified plugin (defaults to "tx_[extensionname]_[pluginname]") * If plugin.tx_$pluginSignature.view.pluginNamespace is set, this value is returned diff --git a/typo3/sysext/extbase/Classes/Validation/ValidatorResolver.php b/typo3/sysext/extbase/Classes/Validation/ValidatorResolver.php index a2ba692c0c012ab7355fc00156aa2d4607868c90..383bc3f4dd925039da09cc292eb8b9821659f31f 100644 --- a/typo3/sysext/extbase/Classes/Validation/ValidatorResolver.php +++ b/typo3/sysext/extbase/Classes/Validation/ValidatorResolver.php @@ -74,13 +74,11 @@ class ValidatorResolver implements \TYPO3\CMS\Core\SingletonInterface { /** * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface - * @inject */ protected $objectManager; /** * @var \TYPO3\CMS\Extbase\Reflection\ReflectionService - * @inject */ protected $reflectionService; @@ -89,6 +87,26 @@ class ValidatorResolver implements \TYPO3\CMS\Core\SingletonInterface { */ protected $baseValidatorConjunctions = array(); + /** + * Injects the object manager + * + * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager A reference to the object manager + * @return void + */ + public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) { + $this->objectManager = $objectManager; + } + + /** + * Injects the reflection service + * + * @param \TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService + * @return void + */ + public function injectReflectionService(\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService) { + $this->reflectionService = $reflectionService; + } + /** * Get a validator for a given data type. Returns a validator implementing * the \TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface or NULL if no validator diff --git a/typo3/sysext/extbase/Tests/Unit/Configuration/AbstractConfigurationManagerTest.php b/typo3/sysext/extbase/Tests/Unit/Configuration/AbstractConfigurationManagerTest.php index f504141802b5ea32cd82188b78fded54a542547a..c6572d8017693ba097b52360d2c595ce0ebe3f0f 100644 --- a/typo3/sysext/extbase/Tests/Unit/Configuration/AbstractConfigurationManagerTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Configuration/AbstractConfigurationManagerTest.php @@ -121,7 +121,7 @@ class AbstractConfigurationManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\Bas public function setUp() { $this->abstractConfigurationManager = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Configuration\\AbstractConfigurationManager', array('getContextSpecificFrameworkConfiguration', 'getTypoScriptSetup', 'getPluginConfiguration', 'getSwitchableControllerActions', 'getRecursiveStoragePids')); $this->mockTypoScriptService = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Service\\TypoScriptService'); - $this->abstractConfigurationManager->_set('typoScriptService', $this->mockTypoScriptService); + $this->abstractConfigurationManager->injectTypoScriptService($this->mockTypoScriptService); } /** @@ -316,7 +316,7 @@ class AbstractConfigurationManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\Bas public function switchableControllerActionsAreNotOverriddenIfPluginNameIsSpecified() { /** @var \TYPO3\CMS\Extbase\Configuration\AbstractConfigurationManager|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */ $abstractConfigurationManager = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Configuration\\AbstractConfigurationManager', array('overrideSwitchableControllerActions', 'getContextSpecificFrameworkConfiguration', 'getTypoScriptSetup', 'getPluginConfiguration', 'getSwitchableControllerActions', 'getRecursiveStoragePids')); - $abstractConfigurationManager->_set('typoScriptService', $this->mockTypoScriptService); + $abstractConfigurationManager->injectTypoScriptService($this->mockTypoScriptService); $abstractConfigurationManager->setConfiguration(array('switchableControllerActions' => array('overriddenSwitchableControllerActions'))); $abstractConfigurationManager->expects($this->any())->method('getPluginConfiguration')->will($this->returnValue(array())); $abstractConfigurationManager->expects($this->never())->method('overrideSwitchableControllerActions'); @@ -331,7 +331,7 @@ class AbstractConfigurationManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\Bas $configuration = array('extensionName' => 'CurrentExtensionName', 'pluginName' => 'CurrentPluginName', 'switchableControllerActions' => array('overriddenSwitchableControllerActions')); $abstractConfigurationManager = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Configuration\\AbstractConfigurationManager', array('overrideSwitchableControllerActions', 'getContextSpecificFrameworkConfiguration', 'getTypoScriptSetup', 'getPluginConfiguration', 'getSwitchableControllerActions', 'getRecursiveStoragePids')); $this->mockTypoScriptService->expects($this->any())->method('convertTypoScriptArrayToPlainArray')->with($configuration)->will($this->returnValue($configuration)); - $abstractConfigurationManager->_set('typoScriptService', $this->mockTypoScriptService); + $abstractConfigurationManager->injectTypoScriptService($this->mockTypoScriptService); $abstractConfigurationManager->setConfiguration($configuration); $abstractConfigurationManager->expects($this->any())->method('getPluginConfiguration')->will($this->returnValue(array())); $abstractConfigurationManager->expects($this->once())->method('overrideSwitchableControllerActions'); @@ -346,7 +346,7 @@ class AbstractConfigurationManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\Bas $configuration = array('switchableControllerActions' => array('overriddenSwitchableControllerActions')); $abstractConfigurationManager = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Configuration\\AbstractConfigurationManager', array('overrideSwitchableControllerActions', 'getContextSpecificFrameworkConfiguration', 'getTypoScriptSetup', 'getPluginConfiguration', 'getSwitchableControllerActions', 'getRecursiveStoragePids')); $this->mockTypoScriptService->expects($this->any())->method('convertTypoScriptArrayToPlainArray')->with($configuration)->will($this->returnValue($configuration)); - $abstractConfigurationManager->_set('typoScriptService', $this->mockTypoScriptService); + $abstractConfigurationManager->injectTypoScriptService($this->mockTypoScriptService); $abstractConfigurationManager->setConfiguration($configuration); $abstractConfigurationManager->expects($this->any())->method('getPluginConfiguration')->will($this->returnValue(array())); $abstractConfigurationManager->expects($this->once())->method('overrideSwitchableControllerActions'); diff --git a/typo3/sysext/extbase/Tests/Unit/Configuration/BackendConfigurationManagerTest.php b/typo3/sysext/extbase/Tests/Unit/Configuration/BackendConfigurationManagerTest.php index ea7a38e881041affc895f89a71b0cafd882577de..428763d08c11e1ef9d5c62911f5fcdc0657adb9a 100644 --- a/typo3/sysext/extbase/Tests/Unit/Configuration/BackendConfigurationManagerTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Configuration/BackendConfigurationManagerTest.php @@ -52,7 +52,7 @@ class BackendConfigurationManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\Base $GLOBALS['TYPO3_DB'] = $this->getMock('TYPO3\\CMS\\Core\\Database\\DatabaseConnection', array()); $this->backendConfigurationManager = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Configuration\\BackendConfigurationManager', array('getTypoScriptSetup')); $this->mockTypoScriptService = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Service\\TypoScriptService'); - $this->backendConfigurationManager->_set('typoScriptService', $this->mockTypoScriptService); + $this->backendConfigurationManager->injectTypoScriptService($this->mockTypoScriptService); } /** @@ -351,7 +351,7 @@ class BackendConfigurationManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\Base $queryGenerator->expects($this->any()) ->method('getTreeList') ->will($this->onConsecutiveCalls('1,4', '2', '3,5,6')); - $abstractConfigurationManager->_set('queryGenerator', $queryGenerator); + $abstractConfigurationManager->injectQueryGenerator($queryGenerator); $expectedResult = '1,4,2,3,5,6'; $actualResult = $abstractConfigurationManager->_call('getRecursiveStoragePids', $storagePid, $recursive); @@ -368,7 +368,7 @@ class BackendConfigurationManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\Base $queryGenerator = $this->getMock('TYPO3\\CMS\\Core\\Database\\QueryGenerator'); $queryGenerator->expects($this->never())->method('getTreeList'); - $abstractConfigurationManager->_set('queryGenerator', $queryGenerator); + $abstractConfigurationManager->injectQueryGenerator($queryGenerator); $expectedResult = '1,2,3'; $actualResult = $abstractConfigurationManager->_call('getRecursiveStoragePids', $storagePid); @@ -386,7 +386,7 @@ class BackendConfigurationManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\Base $queryGenerator = $this->getMock('TYPO3\\CMS\\Core\\Database\\QueryGenerator'); $queryGenerator->expects($this->never())->method('getTreeList'); - $abstractConfigurationManager->_set('queryGenerator', $queryGenerator); + $abstractConfigurationManager->injectQueryGenerator($queryGenerator); $expectedResult = '1,2,3'; $actualResult = $abstractConfigurationManager->_call('getRecursiveStoragePids', $storagePid, $recursive); diff --git a/typo3/sysext/extbase/Tests/Unit/Configuration/FrontendConfigurationManagerTest.php b/typo3/sysext/extbase/Tests/Unit/Configuration/FrontendConfigurationManagerTest.php index 1b04a1f23c4f35bccbfad3808372f6469577f21a..0ad4c35d6e6cfdf3f75c8c46529ebf5e881272c9 100644 --- a/typo3/sysext/extbase/Tests/Unit/Configuration/FrontendConfigurationManagerTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Configuration/FrontendConfigurationManagerTest.php @@ -54,7 +54,7 @@ class FrontendConfigurationManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\Bas $this->frontendConfigurationManager = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Configuration\\FrontendConfigurationManager', array('dummy')); $this->frontendConfigurationManager->_set('contentObject', $this->mockContentObject); $this->mockTypoScriptService = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Service\\TypoScriptService'); - $this->frontendConfigurationManager->_set('typoScriptService', $this->mockTypoScriptService); + $this->frontendConfigurationManager->injectTypoScriptService($this->mockTypoScriptService); } /** @@ -455,7 +455,7 @@ class FrontendConfigurationManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\Bas /** @var $frontendConfigurationManager \TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager */ $frontendConfigurationManager = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Configuration\\FrontendConfigurationManager', array('getTypoScriptSetup')); $frontendConfigurationManager->_set('contentObject', $this->mockContentObject); - $frontendConfigurationManager->_set('typoScriptService', $this->mockTypoScriptService); + $frontendConfigurationManager->injectTypoScriptService($this->mockTypoScriptService); $this->mockTypoScriptService->expects($this->once())->method('convertTypoScriptArrayToPlainArray')->will($this->returnValue(array( 'persistence' => array( diff --git a/typo3/sysext/extbase/Tests/Unit/Core/BootstrapTest.php b/typo3/sysext/extbase/Tests/Unit/Core/BootstrapTest.php index edbf4d19f3ebf10c57b9d82654baaa45b4a51228..a32556e4657f8101a3e8a13204231f01e113878c 100644 --- a/typo3/sysext/extbase/Tests/Unit/Core/BootstrapTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Core/BootstrapTest.php @@ -85,11 +85,12 @@ class BootstrapTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $requestHandlerResolver = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\RequestHandlerResolver', array('resolveRequestHandler')); /** @var $cliRequestHandler \TYPO3\CMS\Extbase\Mvc\Cli\RequestHandler|\PHPUnit_Framework_MockObject_MockObject */ - $cliRequestHandler = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Cli\RequestHandler', array('canHandleRequest')); + $cliRequestHandler = $this->getMock('TYPO3\CMS\Extbase\Mvc\Cli\RequestHandler', array('canHandleRequest')); $cliRequestHandler->expects($this->any())->method('canHandleRequest')->will($this->returnValue(TRUE)); - $cliRequestHandler->_set('objectManager', $this->objectManager); - $cliRequestHandler->_set('requestBuilder', $this->objectManager->get('TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder')); - $cliRequestHandler->_set('dispatcher', $this->objectManager->get('TYPO3\CMS\Extbase\Mvc\Dispatcher')); + $cliRequestHandler->injectObjectManager($this->objectManager); + $cliRequestHandler->injectRequestBuilder($this->objectManager->get('TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder')); + $cliRequestHandler->injectDispatcher($this->objectManager->get('TYPO3\CMS\Extbase\Mvc\Dispatcher')); + /** @var $cliResponse \TYPO3\CMS\Extbase\Mvc\Cli\Response */ $cliResponse = $this->getMock('TYPO3\CMS\Extbase\Mvc\Cli\Response', array('send')); diff --git a/typo3/sysext/extbase/Tests/Unit/Mvc/Cli/CommandManagerTest.php b/typo3/sysext/extbase/Tests/Unit/Mvc/Cli/CommandManagerTest.php index a6b72395292ce86850cc5cec1247911f7464b0e5..32aab9551fb9237fd43cfdc98f24c3da84aea110 100644 --- a/typo3/sysext/extbase/Tests/Unit/Mvc/Cli/CommandManagerTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Mvc/Cli/CommandManagerTest.php @@ -42,9 +42,9 @@ class CommandManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { public function setUp() { $this->commandControllerBackup = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers']; - $this->commandManager = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Cli\\CommandManager', array('getAvailableCommands')); + $this->commandManager = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Cli\\CommandManager', array('getAvailableCommands')); $this->mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface'); - $this->commandManager->_set('objectManager', $this->mockObjectManager); + $this->commandManager->injectObjectManager($this->mockObjectManager); } public function tearDown() { @@ -56,9 +56,8 @@ class CommandManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { * @author Bastian Waidelich <bastian@typo3.org> */ public function getAvailableCommandsReturnsAllAvailableCommands() { - /** @var \TYPO3\CMS\Core\Tests\AccessibleObjectInterface $commandManager */ - $commandManager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Cli\CommandManager', array('dummy')); - $commandManager->_set('objectManager', $this->mockObjectManager); + $commandManager = new \TYPO3\CMS\Extbase\Mvc\Cli\CommandManager(); + $commandManager->injectObjectManager($this->mockObjectManager); $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers'] = array( 'TYPO3\\CMS\\Extbase\\Tests\\Unit\\Mvc\\Cli\\Fixture\\Command\\MockACommandController', 'TYPO3\\CMS\\Extbase\\Tests\\Unit\\Mvc\\Cli\\Fixture\\Command\\MockBCommandController' diff --git a/typo3/sysext/extbase/Tests/Unit/Mvc/Cli/CommandTest.php b/typo3/sysext/extbase/Tests/Unit/Mvc/Cli/CommandTest.php index 57940fa7803f7ef64410d1f931b408e101dffc8c..afc4de6098af331a542f0ead821052704bad86e8 100644 --- a/typo3/sysext/extbase/Tests/Unit/Mvc/Cli/CommandTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Mvc/Cli/CommandTest.php @@ -48,7 +48,7 @@ class CommandTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $this->mockMethodReflection = $this->getMock('TYPO3\\CMS\\Extbase\\Reflection\\MethodReflection', array(), array(), '', FALSE); $this->command->expects($this->any())->method('getCommandMethodReflection')->will($this->returnValue($this->mockMethodReflection)); $this->mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface'); - $this->command->_set('objectManager', $this->mockObjectManager); + $this->command->injectObjectManager($this->mockObjectManager); } /** @@ -135,7 +135,7 @@ class CommandTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $mockReflectionService = $this->getMock('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService'); $mockMethodParameters = array('argument1' => array('optional' => FALSE), 'argument2' => array('optional' => TRUE)); $mockReflectionService->expects($this->atLeastOnce())->method('getMethodParameters')->will($this->returnValue($mockMethodParameters)); - $this->command->_set('reflectionService', $mockReflectionService); + $this->command->injectReflectionService($mockReflectionService); $this->mockMethodReflection->expects($this->atLeastOnce())->method('getParameters')->will($this->returnValue(array($mockParameterReflection))); $this->mockMethodReflection->expects($this->atLeastOnce())->method('getTagsValues')->will($this->returnValue(array('param' => array('@param $argument1 argument1 description', '@param $argument2 argument2 description')))); $mockCommandArgumentDefinition1 = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Cli\\CommandArgumentDefinition', array(), array(), '', FALSE); diff --git a/typo3/sysext/extbase/Tests/Unit/Mvc/Cli/RequestBuilderTest.php b/typo3/sysext/extbase/Tests/Unit/Mvc/Cli/RequestBuilderTest.php index bb17a1b5c876079b11f3f971ff6696b7007bf40e..f17dcdd6caca8c9638c9cf6b2c49f181ac8c8cf1 100644 --- a/typo3/sysext/extbase/Tests/Unit/Mvc/Cli/RequestBuilderTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Mvc/Cli/RequestBuilderTest.php @@ -26,7 +26,7 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Mvc\Cli; class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { /** - * @var \TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_Comparator_MockObject + * @var \TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder */ protected $requestBuilder; @@ -70,10 +70,10 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $this->mockCommandManager = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Cli\\CommandManager'); $this->mockCommandManager->expects($this->any())->method('getCommandByIdentifier')->with('some_extension_name:default:list')->will($this->returnValue($this->mockCommand)); $this->mockReflectionService = $this->getMock('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService'); - $this->requestBuilder = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder', array('dummy')); - $this->requestBuilder->_set('objectManager', $this->mockObjectManager); - $this->requestBuilder->_set('reflectionService', $this->mockReflectionService); - $this->requestBuilder->_set('commandManager', $this->mockCommandManager); + $this->requestBuilder = new \TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder(); + $this->requestBuilder->injectObjectManager($this->mockObjectManager); + $this->requestBuilder->injectReflectionService($this->mockReflectionService); + $this->requestBuilder->injectCommandManager($this->mockCommandManager); } /** @@ -100,7 +100,7 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $this->mockCommandManager->getCommandByIdentifier('some_extension_name:default:list'); $mockCommandManager = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Cli\\CommandManager'); $mockCommandManager->expects($this->any())->method('getCommandByIdentifier')->with('test:default:list')->will($this->throwException(new \TYPO3\CMS\Extbase\Mvc\Exception\NoSuchCommandException())); - $this->requestBuilder->_set('commandManager', $mockCommandManager); + $this->requestBuilder->injectCommandManager($mockCommandManager); $request = $this->requestBuilder->build('test:default:list'); $this->assertSame('TYPO3\\CMS\\Extbase\\Command\\HelpCommandController', $request->getControllerObjectName()); } diff --git a/typo3/sysext/extbase/Tests/Unit/Mvc/Cli/RequestTest.php b/typo3/sysext/extbase/Tests/Unit/Mvc/Cli/RequestTest.php index 3f5a88a1c43368e4fa13e3c574288f4ca39c17bc..8a2a959b648ff4ea63d13c26ce549f9812627d87 100644 --- a/typo3/sysext/extbase/Tests/Unit/Mvc/Cli/RequestTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Mvc/Cli/RequestTest.php @@ -26,7 +26,7 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Mvc\Cli; class RequestTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { /** - * @var \TYPO3\CMS\Extbase\Mvc\Cli\Request|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface + * @var \TYPO3\CMS\Extbase\Mvc\Cli\Request */ protected $request; @@ -39,9 +39,9 @@ class RequestTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { * Sets up this test case */ public function setUp() { - $this->request = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Cli\Request', array('dummy')); + $this->request = new \TYPO3\CMS\Extbase\Mvc\Cli\Request(); $this->mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface'); - $this->request->_set('objectManager', $this->mockObjectManager); + $this->request->injectObjectManager($this->mockObjectManager); } /** diff --git a/typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ActionControllerTest.php b/typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ActionControllerTest.php index 56a389acd699cece87a68bbea4dae07b4acc4455..92ff596a18c67ccab9f36899463cc14b2fea6f96 100644 --- a/typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ActionControllerTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ActionControllerTest.php @@ -91,7 +91,7 @@ class ActionControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $mockController->expects($this->at(7))->method('buildControllerContext'); $mockController->expects($this->at(8))->method('resolveView'); - $mockController->_set('mvcPropertyMappingConfigurationService', $configurationService); + $mockController->injectMvcPropertyMappingConfigurationService($configurationService); $mockController->_set('arguments', new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments()); $mockController->processRequest($mockRequest, $mockResponse); @@ -112,7 +112,7 @@ class ActionControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $mockArgumentMappingResults->expects($this->once())->method('hasErrors')->will($this->returnValue(FALSE)); $mockController = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ActionController', array('fooAction', 'initializeAction'), array(), '', FALSE); $mockSignalSlotDispatcher = $this->getMock('TYPO3\\CMS\Extbase\\SignalSlot\\Dispatcher', array(), array(), '', FALSE); - $mockController->_set('signalSlotDispatcher', $mockSignalSlotDispatcher); + $mockController->injectSignalSlotDispatcher($mockSignalSlotDispatcher); $this->enableDeprecatedPropertyMapperInController($mockController); $mockController->expects($this->once())->method('fooAction')->will($this->returnValue('the returned string')); $mockController->_set('request', $mockRequest); @@ -138,7 +138,7 @@ class ActionControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $mockArgumentMappingResults->expects($this->once())->method('hasErrors')->will($this->returnValue(FALSE)); $mockController = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ActionController', array('fooAction', 'initializeAction'), array(), '', FALSE); $mockSignalSlotDispatcher = $this->getMock('TYPO3\\CMS\Extbase\\SignalSlot\\Dispatcher', array(), array(), '', FALSE); - $mockController->_set('signalSlotDispatcher', $mockSignalSlotDispatcher); + $mockController->injectSignalSlotDispatcher($mockSignalSlotDispatcher); $this->enableDeprecatedPropertyMapperInController($mockController); $mockController->expects($this->once())->method('fooAction'); $mockController->_set('request', $mockRequest); @@ -188,7 +188,7 @@ class ActionControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $mockArgumentMappingResults->expects($this->once())->method('hasErrors')->will($this->returnValue(FALSE)); $mockController = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ActionController', array('fooAction', 'initializeAction'), array(), '', FALSE); $mockSignalSlotDispatcher = $this->getMock('TYPO3\\CMS\Extbase\\SignalSlot\\Dispatcher', array(), array(), '', FALSE); - $mockController->_set('signalSlotDispatcher', $mockSignalSlotDispatcher); + $mockController->injectSignalSlotDispatcher($mockSignalSlotDispatcher); $this->enableDeprecatedPropertyMapperInController($mockController); $mockController->expects($this->once())->method('fooAction')->with('Default value'); $mockController->_set('request', $mockRequest); @@ -349,7 +349,7 @@ class ActionControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { ); $mockReflectionService = $this->getMock('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService', array(), array(), '', FALSE); $mockReflectionService->expects($this->once())->method('getMethodParameters')->with(get_class($mockController), 'fooAction')->will($this->returnValue($methodParameters)); - $mockController->_set('reflectionService', $mockReflectionService); + $mockController->injectReflectionService($mockReflectionService); $mockController->_set('request', $mockRequest); $mockController->_set('arguments', $mockArguments); $mockController->_set('actionMethodName', 'fooAction'); @@ -396,7 +396,7 @@ class ActionControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { ); $mockReflectionService = $this->getMock('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService', array(), array(), '', FALSE); $mockReflectionService->expects($this->once())->method('getMethodParameters')->with(get_class($mockController), 'fooAction')->will($this->returnValue($methodParameters)); - $mockController->_set('reflectionService', $mockReflectionService); + $mockController->injectReflectionService($mockReflectionService); $mockController->_set('request', $mockRequest); $mockController->_set('arguments', $mockArguments); $mockController->_set('actionMethodName', 'fooAction'); @@ -423,7 +423,7 @@ class ActionControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { ); $mockReflectionService = $this->getMock('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService', array(), array(), '', FALSE); $mockReflectionService->expects($this->once())->method('getMethodParameters')->with(get_class($mockController), 'fooAction')->will($this->returnValue($methodParameters)); - $mockController->_set('reflectionService', $mockReflectionService); + $mockController->injectReflectionService($mockReflectionService); $mockController->_set('request', $mockRequest); $mockController->_set('arguments', $mockArguments); $mockController->_set('actionMethodName', 'fooAction'); @@ -448,8 +448,8 @@ class ActionControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $mockReflectionService->expects($this->once())->method('getMethodTagsValues')->with(get_class($mockController), 'fooAction')->will($this->returnValue($methodTagsValues)); $mockValidatorResolver = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array(), array(), '', FALSE); $mockValidatorResolver->expects($this->once())->method('buildMethodArgumentsValidatorConjunctions')->with(get_class($mockController), 'fooAction')->will($this->returnValue($methodArgumentsValidatorConjunctions)); - $mockController->_set('reflectionService', $mockReflectionService); - $mockController->_set('validatorResolver', $mockValidatorResolver); + $mockController->injectReflectionService($mockReflectionService); + $mockController->injectValidatorResolver($mockValidatorResolver); $mockController->_set('arguments', $arguments); $mockController->_set('actionMethodName', 'fooAction'); $mockController->_call('initializeActionMethodValidators'); @@ -478,8 +478,8 @@ class ActionControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $mockValidatorResolver = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array(), array(), '', FALSE); $mockValidatorResolver->expects($this->once())->method('buildMethodArgumentsValidatorConjunctions')->with(get_class($mockController), 'fooAction')->will($this->returnValue($methodArgumentsValidatorConjunctions)); $mockValidatorResolver->expects($this->once())->method('getBaseValidatorConjunction')->with('F3_Foo_Quux')->will($this->returnValue($quuxBaseValidatorConjunction)); - $mockController->_set('reflectionService', $mockReflectionService); - $mockController->_set('validatorResolver', $mockValidatorResolver); + $mockController->injectReflectionService($mockReflectionService); + $mockController->injectValidatorResolver($mockValidatorResolver); $mockController->_set('arguments', $arguments); $mockController->_set('actionMethodName', 'fooAction'); $mockController->_call('initializeActionMethodValidators'); @@ -510,8 +510,8 @@ class ActionControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $mockValidatorResolver = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array(), array(), '', FALSE); $mockValidatorResolver->expects($this->once())->method('buildMethodArgumentsValidatorConjunctions')->with(get_class($mockController), 'fooAction')->will($this->returnValue($methodArgumentsValidatorConjunctions)); $mockValidatorResolver->expects($this->any())->method('getBaseValidatorConjunction')->will($this->throwException(new \Exception('This should not be called because the dontvalidate annotation is set.'))); - $mockController->_set('reflectionService', $mockReflectionService); - $mockController->_set('validatorResolver', $mockValidatorResolver); + $mockController->injectReflectionService($mockReflectionService); + $mockController->injectValidatorResolver($mockValidatorResolver); $mockController->_set('arguments', $arguments); $mockController->_set('actionMethodName', 'fooAction'); $mockController->_call('initializeActionMethodValidators'); @@ -583,7 +583,7 @@ class ActionControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $mockController->_set('arguments', array($argument1, $argument2)); $mockController->_set('request', $mockRequest); $mockController->_set('actionMethodName', 'fooAction'); - $mockController->_set('reflectionService', $mockReflectionService); + $mockController->injectReflectionService($mockReflectionService); $mockController->_call('checkRequestHash'); } @@ -610,7 +610,7 @@ class ActionControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $mockController->_set('arguments', array($argument1, $argument2)); $mockController->_set('request', $mockRequest); $mockController->_set('actionMethodName', 'fooAction'); - $mockController->_set('reflectionService', $mockReflectionService); + $mockController->injectReflectionService($mockReflectionService); $mockController->_call('checkRequestHash'); } diff --git a/typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ArgumentBehaviorBeforeExtbase14Test.php b/typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ArgumentBehaviorBeforeExtbase14Test.php index 9f5578fb49463c24cce7d7cc97b620cb444cc050..1e40e3525ebf0867525255cdc7255b2aee543132 100644 --- a/typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ArgumentBehaviorBeforeExtbase14Test.php +++ b/typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ArgumentBehaviorBeforeExtbase14Test.php @@ -71,7 +71,7 @@ class ArgumentBehaviorBeforeExtbase14Test extends \TYPO3\CMS\Extbase\Tests\Unit\ * @test */ public function setValueProvidesFluentInterface() { - $argument = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Argument', array('dummy'), array('dummy', 'Text')); + $argument = new \TYPO3\CMS\Extbase\Mvc\Controller\Argument('dummy', 'Text'); $this->enableDeprecatedPropertyMapperInArgument($argument); $returnedArgument = $argument->setValue('x'); $this->assertSame($argument, $returnedArgument, 'The returned argument is not the original argument.'); @@ -82,7 +82,7 @@ class ArgumentBehaviorBeforeExtbase14Test extends \TYPO3\CMS\Extbase\Tests\Unit\ * @author Karsten Dambekalns <karsten@typo3.org> */ public function setValueUsesNullAsIs() { - $argument = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array('transformValue'), array('dummy', 'ArrayObject')); + $argument = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array('transformValue'), array('dummy', 'ArrayObject')); $this->enableDeprecatedPropertyMapperInArgument($argument); $argument->expects($this->never())->method('transformValue'); $argument->setValue(NULL); @@ -93,7 +93,7 @@ class ArgumentBehaviorBeforeExtbase14Test extends \TYPO3\CMS\Extbase\Tests\Unit\ * @author Karsten Dambekalns <karsten@typo3.org> */ public function setValueUsesMatchingInstanceAsIs() { - $argument = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array('transformValue'), array('dummy', 'ArrayObject')); + $argument = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array('transformValue'), array('dummy', 'ArrayObject')); $this->enableDeprecatedPropertyMapperInArgument($argument); $argument->expects($this->never())->method('transformValue'); $argument->setValue(new \ArrayObject()); @@ -119,7 +119,7 @@ class ArgumentBehaviorBeforeExtbase14Test extends \TYPO3\CMS\Extbase\Tests\Unit\ * @test */ public function toStringReturnsTheStringVersionOfTheArgumentsValue() { - $argument = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Argument', array('dummy'), array('dummy', 'Text')); + $argument = new \TYPO3\CMS\Extbase\Mvc\Controller\Argument('dummy', 'Text'); $this->enableDeprecatedPropertyMapperInArgument($argument); $argument->setValue(123); $this->assertSame((string) $argument, '123', 'The returned argument is not a string.'); @@ -130,11 +130,11 @@ class ArgumentBehaviorBeforeExtbase14Test extends \TYPO3\CMS\Extbase\Tests\Unit\ * @test */ public function setNewValidatorConjunctionCreatesANewValidatorConjunctionObject() { - $argument = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Argument', array('dummy'), array('dummy', 'Text')); + $argument = new \TYPO3\CMS\Extbase\Mvc\Controller\Argument('dummy', 'Text'); $mockConjunctionValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ConjunctionValidator'); $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface'); $mockObjectManager->expects($this->once())->method('get')->with('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ConjunctionValidator')->will($this->returnValue($mockConjunctionValidator)); - $argument->_set('objectManager', $mockObjectManager); + $argument->injectObjectManager($mockObjectManager); $argument->setNewValidatorConjunction(array()); $this->assertSame($mockConjunctionValidator, $argument->getValidator()); } @@ -163,7 +163,7 @@ class ArgumentBehaviorBeforeExtbase14Test extends \TYPO3\CMS\Extbase\Tests\Unit\ $mockObjectManager->expects($this->never())->method('create'); $mockObjectManager->expects($this->at(0))->method('get')->with('Validator1')->will($this->returnValue($validator1)); $mockObjectManager->expects($this->at(1))->method('get')->with('Validator2')->will($this->returnValue($validator2)); - $argument->_set('objectManager', $mockObjectManager); + $argument->injectObjectManager($mockObjectManager); $argument->_set('validator', $mockValidatorConjunction); $argument->setNewValidatorConjunction(array('Validator1', 'Validator2')); } @@ -185,7 +185,7 @@ class ArgumentBehaviorBeforeExtbase14Test extends \TYPO3\CMS\Extbase\Tests\Unit\ protected function enableDeprecatedPropertyMapperInArgument(\TYPO3\CMS\Extbase\Mvc\Controller\Argument $argument) { $mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface'); $mockConfigurationManager->expects($this->any())->method('isFeatureEnabled')->with('rewrittenPropertyMapper')->will($this->returnValue(FALSE)); - $argument->_set('configurationManager', $mockConfigurationManager); + $argument->injectConfigurationManager($mockConfigurationManager); } } diff --git a/typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ArgumentTest.php b/typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ArgumentTest.php index 2a10d557efbecdb3b11d9dc8fa191e13594bc847..7ca4c207f2987a39b8aa8be4020b3537d55e817c 100644 --- a/typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ArgumentTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ArgumentTest.php @@ -48,15 +48,15 @@ class ArgumentTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { * @author Sebastian Kurfürst <sebastian@typo3.org> */ public function setUp() { - $this->simpleValueArgument = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Argument', array('dummy'), array('someName', 'string')); - $this->objectArgument = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Argument', array('dummy'), array('someName', 'DateTime')); + $this->simpleValueArgument = new \TYPO3\CMS\Extbase\Mvc\Controller\Argument('someName', 'string'); + $this->objectArgument = new \TYPO3\CMS\Extbase\Mvc\Controller\Argument('someName', 'DateTime'); $this->mockPropertyMapper = $this->getMock('TYPO3\\CMS\\Extbase\\Property\\PropertyMapper'); - $this->simpleValueArgument->_set('propertyMapper', $this->mockPropertyMapper); - $this->objectArgument->_set('propertyMapper', $this->mockPropertyMapper); + $this->simpleValueArgument->injectPropertyMapper($this->mockPropertyMapper); + $this->objectArgument->injectPropertyMapper($this->mockPropertyMapper); $this->mockConfiguration = new \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfiguration(); $propertyMappingConfiguranion = new \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfiguration(); - $this->simpleValueArgument->_set('propertyMappingConfiguration', $propertyMappingConfiguranion); - $this->objectArgument->_set('propertyMappingConfiguration', $propertyMappingConfiguranion); + $this->simpleValueArgument->injectPropertyMappingConfiguration($propertyMappingConfiguranion); + $this->objectArgument->injectPropertyMappingConfiguration($propertyMappingConfiguranion); } /** @@ -173,7 +173,6 @@ class ArgumentTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { */ public function setValueUsesNullAsIs() { $this->simpleValueArgument = new \TYPO3\CMS\Extbase\Mvc\Controller\Argument('dummy', 'string'); - $this->simpleValueArgument = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Argument', array('dummy'), array('dummy', 'string')); $this->enableRewrittenPropertyMapperInArgument($this->simpleValueArgument); $this->simpleValueArgument->setValue(NULL); $this->assertNull($this->simpleValueArgument->getValue()); @@ -299,7 +298,7 @@ class ArgumentTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { protected function enableRewrittenPropertyMapperInArgument(\TYPO3\CMS\Extbase\Mvc\Controller\Argument $argument) { $mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface'); $mockConfigurationManager->expects($this->any())->method('isFeatureEnabled')->with('rewrittenPropertyMapper')->will($this->returnValue(TRUE)); - $argument->_set('configurationManager', $mockConfigurationManager); + $argument->injectConfigurationManager($mockConfigurationManager); } } diff --git a/typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ArgumentsTest.php b/typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ArgumentsTest.php index b9233be9bb7ef5e88f502fb98c5d5ca53c46c4d4..a72e6f6e0aaf135d69901f19ce6edc056528b533 100644 --- a/typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ArgumentsTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ArgumentsTest.php @@ -69,8 +69,8 @@ class ArgumentsTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $mockArgument = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array(), array(), '', FALSE); $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface'); $mockObjectManager->expects($this->once())->method('get')->with('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument')->will($this->returnValue($mockArgument)); - $arguments = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Arguments', array('dummy')); - $arguments->_set('objectManager', $mockObjectManager); + $arguments = new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments(); + $arguments->injectObjectManager($mockObjectManager); $newArgument = $arguments->addNewArgument('someArgument'); $this->assertSame($newArgument, $mockArgument); } @@ -169,8 +169,8 @@ class ArgumentsTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $mockArgument->expects($this->any())->method('getName')->will($this->returnValue('dummyName')); $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface'); $mockObjectManager->expects($this->once())->method('get')->with('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument')->will($this->returnValue($mockArgument)); - $arguments = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Arguments', array('dummy')); - $arguments->_set('objectManager', $mockObjectManager); + $arguments = new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments(); + $arguments->injectObjectManager($mockObjectManager); $addedArgument = $arguments->addNewArgument('dummyName'); $this->assertInstanceOf('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', $addedArgument, 'addNewArgument() either did not add a new argument or did not return it.'); $retrievedArgument = $arguments['dummyName']; @@ -185,8 +185,8 @@ class ArgumentsTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $mockArgument->expects($this->any())->method('getName')->will($this->returnValue('dummyName')); $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface'); $mockObjectManager->expects($this->once())->method('get')->with('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', 'dummyName', 'Text')->will($this->returnValue($mockArgument)); - $arguments = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Arguments', array('dummy')); - $arguments->_set('objectManager', $mockObjectManager); + $arguments = new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments(); + $arguments->injectObjectManager($mockObjectManager); $arguments->addNewArgument('dummyName'); } @@ -199,8 +199,8 @@ class ArgumentsTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $mockArgument->expects($this->once())->method('setRequired')->with(TRUE); $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface'); $mockObjectManager->expects($this->once())->method('get')->with('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', 'dummyName', 'Text')->will($this->returnValue($mockArgument)); - $arguments = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Arguments', array('dummy')); - $arguments->_set('objectManager', $mockObjectManager); + $arguments = new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments(); + $arguments->injectObjectManager($mockObjectManager); $arguments->addNewArgument('dummyName', 'Text', TRUE); } @@ -214,8 +214,8 @@ class ArgumentsTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $mockArgument->expects($this->once())->method('setDefaultValue')->with('someDefaultValue'); $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface'); $mockObjectManager->expects($this->once())->method('get')->with('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', 'dummyName', 'Text')->will($this->returnValue($mockArgument)); - $arguments = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Arguments', array('dummy')); - $arguments->_set('objectManager', $mockObjectManager); + $arguments = new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments(); + $arguments->injectObjectManager($mockObjectManager); $arguments->addNewArgument('dummyName', 'Text', FALSE, 'someDefaultValue'); } diff --git a/typo3/sysext/extbase/Tests/Unit/Mvc/Controller/MvcPropertyMappingConfigurationServiceTest.php b/typo3/sysext/extbase/Tests/Unit/Mvc/Controller/MvcPropertyMappingConfigurationServiceTest.php index 3a91a1746bd20b885bcffaad9c6894bfba206a39..55fc185c39a185e17104a2c758970b40ba811df3 100644 --- a/typo3/sysext/extbase/Tests/Unit/Mvc/Controller/MvcPropertyMappingConfigurationServiceTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Mvc/Controller/MvcPropertyMappingConfigurationServiceTest.php @@ -281,20 +281,20 @@ class MvcPropertyMappingConfigurationServiceTest extends \TYPO3\CMS\Extbase\Test $mockHashService = $this->getMock('TYPO3\CMS\Extbase\Security\Cryptography\HashService', array('validateAndStripHmac')); $mockHashService->expects($this->once())->method('validateAndStripHmac')->with('fooTrustedProperties')->will($this->returnValue(serialize($trustedProperties))); - $requestHashService = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService', array('dummy')); - $requestHashService->_set('hashService', $mockHashService); + $requestHashService = new \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService(); + $requestHashService->injectHashService($mockHashService); $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface'); - $mockArgument = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array('getName'), array(), '', FALSE); + $mockArgument = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array('getName'), array(), '', FALSE); $propertyMappingConfiguration = new \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfiguration(); - $mockArgument->_set('propertyMappingConfiguration', $propertyMappingConfiguration); + $mockArgument->injectPropertyMappingConfiguration($propertyMappingConfiguration); $mockArgument->expects($this->any())->method('getName')->will($this->returnValue('foo')); $mockObjectManager->expects($this->once())->method('get')->with('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument')->will($this->returnValue($mockArgument)); - $arguments = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\Arguments', array('dummy')); - $arguments->_set('objectManager', $mockObjectManager); + $arguments = new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments(); + $arguments->injectObjectManager($mockObjectManager); $arguments->addNewArgument('foo'); $requestHashService->initializePropertyMappingConfigurationFromRequest($request, $arguments); diff --git a/typo3/sysext/extbase/Tests/Unit/Mvc/Web/RequestBuilderTest.php b/typo3/sysext/extbase/Tests/Unit/Mvc/Web/RequestBuilderTest.php index cae9e9b7a6e2f353e37c37b19ef5ead64ee86888..e2ae62939eb2c6153cb7112d64378c2b427a749d 100644 --- a/typo3/sysext/extbase/Tests/Unit/Mvc/Web/RequestBuilderTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Mvc/Web/RequestBuilderTest.php @@ -96,14 +96,14 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { */ protected function injectDependencies() { $this->mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration)); - $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager); + $this->requestBuilder->injectConfigurationManager($this->mockConfigurationManager); $this->mockObjectManager->expects($this->any())->method('get')->with('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request')->will($this->returnValue($this->mockRequest)); - $this->requestBuilder->_set('objectManager', $this->mockObjectManager); + $this->requestBuilder->injectObjectManager($this->mockObjectManager); $pluginNamespace = 'tx_' . strtolower(($this->configuration['extensionName'] . '_' . $this->configuration['pluginName'])); $this->mockExtensionService->expects($this->any())->method('getPluginNamespace')->will($this->returnValue($pluginNamespace)); - $this->requestBuilder->_set('extensionService', $this->mockExtensionService); + $this->requestBuilder->injectExtensionService($this->mockExtensionService); $this->mockEnvironmentService->expects($this->any())->method('getServerRequestMethod')->will($this->returnValue('GET')); - $this->requestBuilder->_set('environmentService', $this->mockEnvironmentService); + $this->requestBuilder->injectEnvironmentService($this->mockEnvironmentService); } /** @@ -179,7 +179,7 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $expectedMethod = 'SomeRequestMethod'; $mockEnvironmentService = $this->getMock('TYPO3\\CMS\\Extbase\\Service\\EnvironmentService', array('getServerRequestMethod')); $mockEnvironmentService->expects($this->once())->method('getServerRequestMethod')->will($this->returnValue($expectedMethod)); - $this->requestBuilder->_set('environmentService', $mockEnvironmentService); + $this->requestBuilder->injectEnvironmentService($mockEnvironmentService); $this->mockRequest->expects($this->once())->method('setMethod')->with($expectedMethod); $this->requestBuilder->build(); } @@ -193,8 +193,8 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $this->configuration['vendorName'] = $expectedVendor; $mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface'); $mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration)); - $this->requestBuilder->_set('configurationManager', $mockConfigurationManager); - $this->requestBuilder->_set('extensionService', $this->mockExtensionService); + $this->requestBuilder->injectConfigurationManager($mockConfigurationManager); + $this->requestBuilder->injectExtensionService($this->mockExtensionService); $this->mockRequest->expects($this->once())->method('setControllerVendorName')->with($expectedVendor); $this->requestBuilder->build(); } @@ -209,7 +209,7 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface'); $mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration)); - $this->requestBuilder->_set('configurationManager', $mockConfigurationManager); + $this->requestBuilder->injectConfigurationManager($mockConfigurationManager); $this->mockRequest->expects($this->once())->method('setControllerVendorName')->with($expectedVendor); $this->requestBuilder->build(); @@ -217,7 +217,7 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { unset($this->configuration['vendorName']); $mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface'); $mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration)); - $this->requestBuilder->_set('configurationManager', $mockConfigurationManager); + $this->requestBuilder->injectConfigurationManager($mockConfigurationManager); $this->mockRequest->expects($this->never())->method('setControllerVendorName'); $this->requestBuilder->build(); @@ -231,7 +231,7 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { unset($this->configuration['extensionName']); $mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface'); $mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration)); - $this->requestBuilder->_set('configurationManager', $mockConfigurationManager); + $this->requestBuilder->injectConfigurationManager($mockConfigurationManager); $this->requestBuilder->build(); } @@ -243,8 +243,8 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { unset($this->configuration['pluginName']); $mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface'); $mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration)); - $this->requestBuilder->_set('configurationManager', $mockConfigurationManager); - $this->requestBuilder->_set('extensionService', $this->mockExtensionService); + $this->requestBuilder->injectConfigurationManager($mockConfigurationManager); + $this->requestBuilder->injectExtensionService($this->mockExtensionService); $this->requestBuilder->build(); } @@ -255,8 +255,8 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { public function buildThrowsExceptionIfControllerConfigurationIsEmptyOrNotSet() { $this->configuration['controllerConfiguration'] = array(); $this->mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration)); - $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager); - $this->requestBuilder->_set('extensionService', $this->mockExtensionService); + $this->requestBuilder->injectConfigurationManager($this->mockConfigurationManager); + $this->requestBuilder->injectExtensionService($this->mockExtensionService); $this->requestBuilder->build(); } @@ -267,8 +267,8 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { public function buildThrowsExceptionIfControllerConfigurationHasNoDefaultActionDefined() { $this->configuration['controllerConfiguration']['TheFirstController'] = array(); $this->mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration)); - $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager); - $this->requestBuilder->_set('extensionService', $this->mockExtensionService); + $this->requestBuilder->injectConfigurationManager($this->mockConfigurationManager); + $this->requestBuilder->injectExtensionService($this->mockExtensionService); $this->requestBuilder->build(); } @@ -283,8 +283,8 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { ) ); $this->mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration)); - $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager); - $this->requestBuilder->_set('extensionService', $this->mockExtensionService); + $this->requestBuilder->injectConfigurationManager($this->mockConfigurationManager); + $this->requestBuilder->injectExtensionService($this->mockExtensionService); $this->requestBuilder->build(); } @@ -382,9 +382,9 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { public function buildThrowsExceptionIfDefaultControllerCantBeDetermined() { $this->configuration['controllerConfiguration'] = array(); $this->mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration)); - $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager); + $this->requestBuilder->injectConfigurationManager($this->mockConfigurationManager); $this->mockExtensionService->expects($this->any())->method('getPluginNamespace')->will($this->returnValue('tx_myextension_pi1')); - $this->requestBuilder->_set('extensionService', $this->mockExtensionService); + $this->requestBuilder->injectExtensionService($this->mockExtensionService); $this->requestBuilder->build(); } @@ -422,9 +422,9 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { */ public function buildThrowsInvalidControllerNameExceptionIfSpecifiedControllerIsNotAllowed() { $this->mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration)); - $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager); + $this->requestBuilder->injectConfigurationManager($this->mockConfigurationManager); $this->mockExtensionService->expects($this->any())->method('getPluginNamespace')->will($this->returnValue('tx_myextension_pi1')); - $this->requestBuilder->_set('extensionService', $this->mockExtensionService); + $this->requestBuilder->injectExtensionService($this->mockExtensionService); $_GET = array( 'tx_myextension_pi1' => array( 'controller' => 'SomeInvalidController' @@ -440,9 +440,9 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { public function buildThrowsPageNotFoundExceptionIfEnabledAndSpecifiedControllerIsNotAllowed() { $this->configuration['mvc']['throwPageNotFoundExceptionIfActionCantBeResolved'] = 1; $this->mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration)); - $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager); + $this->requestBuilder->injectConfigurationManager($this->mockConfigurationManager); $this->mockExtensionService->expects($this->any())->method('getPluginNamespace')->will($this->returnValue('tx_myextension_pi1')); - $this->requestBuilder->_set('extensionService', $this->mockExtensionService); + $this->requestBuilder->injectExtensionService($this->mockExtensionService); $_GET = array( 'tx_myextension_pi1' => array( 'controller' => 'SomeInvalidController' @@ -457,7 +457,7 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { public function buildSetsDefaultControllerNameIfSpecifiedControllerIsNotAllowedAndCallDefaultActionIfActionCantBeResolvedIsSet() { $this->configuration['mvc']['callDefaultActionIfActionCantBeResolved'] = 1; $this->injectDependencies(); - $this->requestBuilder->_set('extensionService', $this->mockExtensionService); + $this->requestBuilder->injectExtensionService($this->mockExtensionService); $_GET = array( 'tx_myextension_pi1' => array( 'controller' => 'SomeInvalidController' @@ -474,9 +474,9 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { public function buildThrowsExceptionIfDefaultActionCantBeDetermined() { $this->configuration['controllerConfiguration'] = array(); $this->mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration)); - $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager); + $this->requestBuilder->injectConfigurationManager($this->mockConfigurationManager); $this->mockExtensionService->expects($this->any())->method('getPluginNamespace')->will($this->returnValue('tx_myextension_pi1')); - $this->requestBuilder->_set('extensionService', $this->mockExtensionService); + $this->requestBuilder->injectExtensionService($this->mockExtensionService); $this->requestBuilder->build(); } @@ -529,9 +529,9 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { */ public function buildThrowsInvalidActionNameExceptionIfSpecifiedActionIsNotAllowed() { $this->mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration)); - $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager); + $this->requestBuilder->injectConfigurationManager($this->mockConfigurationManager); $this->mockExtensionService->expects($this->any())->method('getPluginNamespace')->will($this->returnValue('tx_myextension_pi1')); - $this->requestBuilder->_set('extensionService', $this->mockExtensionService); + $this->requestBuilder->injectExtensionService($this->mockExtensionService); $_GET = array( 'tx_myextension_pi1' => array( 'action' => 'someInvalidAction' @@ -547,9 +547,9 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { public function buildThrowsPageNotFoundExceptionIfEnabledAndSpecifiedActionIsNotAllowed() { $this->configuration['mvc']['throwPageNotFoundExceptionIfActionCantBeResolved'] = 1; $this->mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration)); - $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager); + $this->requestBuilder->injectConfigurationManager($this->mockConfigurationManager); $this->mockExtensionService->expects($this->any())->method('getPluginNamespace')->will($this->returnValue('tx_myextension_pi1')); - $this->requestBuilder->_set('extensionService', $this->mockExtensionService); + $this->requestBuilder->injectExtensionService($this->mockExtensionService); $_GET = array( 'tx_myextension_pi1' => array( 'action' => 'someInvalidAction' @@ -564,7 +564,7 @@ class RequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { public function buildSetsDefaultActionNameIfSpecifiedActionIsNotAllowedAndCallDefaultActionIfActionCantBeResolvedIsSet() { $this->configuration['mvc']['callDefaultActionIfActionCantBeResolved'] = 1; $this->injectDependencies(); - $this->requestBuilder->_set('extensionService', $this->mockExtensionService); + $this->requestBuilder->injectExtensionService($this->mockExtensionService); $_GET = array( 'tx_myextension_pi1' => array( 'controller' => 'TheThirdController', diff --git a/typo3/sysext/extbase/Tests/Unit/Mvc/Web/Routing/UriBuilderTest.php b/typo3/sysext/extbase/Tests/Unit/Mvc/Web/Routing/UriBuilderTest.php index 994c1bcb83f7d1297ede36f1b7fdbceb4ade9449..3cafd268cc01b25a3ac5cf92c9e150ac3f262c74 100644 --- a/typo3/sysext/extbase/Tests/Unit/Mvc/Web/Routing/UriBuilderTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Mvc/Web/Routing/UriBuilderTest.php @@ -78,9 +78,9 @@ class UriBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $this->uriBuilder = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder', array('build')); $this->uriBuilder->setRequest($this->mockRequest); $this->uriBuilder->_set('contentObject', $this->mockContentObject); - $this->uriBuilder->_set('configurationManager', $this->mockConfigurationManager); - $this->uriBuilder->_set('extensionService', $this->mockExtensionService); - $this->uriBuilder->_set('environmentService', $this->objectManager->get('TYPO3\\CMS\\Extbase\\Service\\EnvironmentService')); + $this->uriBuilder->injectConfigurationManager($this->mockConfigurationManager); + $this->uriBuilder->injectExtensionService($this->mockExtensionService); + $this->uriBuilder->injectEnvironmentService($this->objectManager->get('TYPO3\\CMS\\Extbase\\Service\\EnvironmentService')); } public function tearDown() { @@ -482,7 +482,7 @@ class UriBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager'); $mockConfigurationManager->expects($this->any())->method('getConfiguration') ->will($this->returnValue(array('view' => array('formatToPageTypeMapping' => array('txt' => 2))))); - $this->uriBuilder->_set('configurationManager', $mockConfigurationManager); + $this->uriBuilder->injectConfigurationManager($mockConfigurationManager); $this->mockExtensionService->expects($this->any())->method('getTargetPageTypeByFormat') ->with(NULL, 'txt') @@ -502,7 +502,7 @@ class UriBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager'); $mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue(array())); - $this->uriBuilder->_set('configurationManager', $mockConfigurationManager); + $this->uriBuilder->injectConfigurationManager($mockConfigurationManager); $this->mockExtensionService->expects($this->any())->method('getTargetPageTypeByFormat') ->with(NULL, 'txt') @@ -524,7 +524,7 @@ class UriBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager'); $mockConfigurationManager->expects($this->any())->method('getConfiguration') ->will($this->returnValue(array(array('view' => array('formatToPageTypeMapping' => array('pdf' => 2)))))); - $this->uriBuilder->_set('configurationManager', $mockConfigurationManager); + $this->uriBuilder->injectConfigurationManager($mockConfigurationManager); $this->mockExtensionService->expects($this->any())->method('getTargetPageTypeByFormat') ->with(NULL, 'txt') diff --git a/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Mapper/DataMapFactoryTest.php b/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Mapper/DataMapFactoryTest.php index 26bfb5827bde95f9c71daff1d19ae155d8931d36..bfdfeb2cb34f5173e0c4b2bd98b863c340a4bf8f 100644 --- a/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Mapper/DataMapFactoryTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Mapper/DataMapFactoryTest.php @@ -397,9 +397,9 @@ class DataMapFactoryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $configurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager'); $configurationManager->expects($this->once())->method('getConfiguration')->with('Framework')->will($this->returnValue($configuration)); $dataMapFactory = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Mapper\\DataMapFactory', array('test')); - $dataMapFactory->_set('reflectionService', new \TYPO3\CMS\Extbase\Reflection\ReflectionService()); - $dataMapFactory->_set('objectManager', new \TYPO3\CMS\Extbase\Object\ObjectManager()); - $dataMapFactory->_set('configurationManager', $configurationManager); + $dataMapFactory->injectReflectionService(new \TYPO3\CMS\Extbase\Reflection\ReflectionService()); + $dataMapFactory->injectObjectManager(new \TYPO3\CMS\Extbase\Object\ObjectManager()); + $dataMapFactory->injectConfigurationManager($configurationManager); $cacheMock = $this->getMock('TYPO3\\CMS\\Core\\Cache\\Frontend\\VariableFrontend', array(), array(), '', FALSE); $cacheMock->expects($this->any())->method('get')->will($this->returnValue(FALSE)); $dataMapFactory->_set('dataMapCache', $cacheMock); @@ -433,7 +433,7 @@ class DataMapFactoryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { public function createColumnMapReturnsAValidColumnMap() { /** @var $dataMapFactory \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory */ $dataMapFactory = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Mapper\\DataMapFactory', array('dummy')); - $dataMapFactory->_set('objectManager', $this->objectManager); + $dataMapFactory->injectObjectManager($this->objectManager); $this->assertEquals( new \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap('column', 'property'), diff --git a/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Mapper/DataMapperTest.php b/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Mapper/DataMapperTest.php index 1e73d6bd3619c3a0f8c5079b53ace6aa49586de1..d2a0fa816f5c9a8e472734a3611379791f5bb56a 100644 --- a/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Mapper/DataMapperTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Mapper/DataMapperTest.php @@ -37,10 +37,10 @@ class DataMapperTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { public function mapMapsArrayToObjectByCallingmapToObject() { $rows = array(array('uid' => '1234')); $object = new \stdClass(); - $dataMapper = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Mapper\\DataMapper', array('mapSingleRow', 'getTargetType')); + $dataMapper = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Mapper\\DataMapper', array('mapSingleRow', 'getTargetType')); $dataMapper->expects($this->any())->method('getTargetType')->will($this->returnArgument(1)); $dataMapFactory = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Mapper\\DataMapFactory'); - $dataMapper->_set('dataMapFactory', $dataMapFactory); + $dataMapper->injectDataMapFactory($dataMapFactory); $dataMapper->expects($this->once())->method('mapSingleRow')->with($rows[0])->will($this->returnValue($object)); $dataMapper->map(get_class($object), $rows); } @@ -55,7 +55,7 @@ class DataMapperTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $identityMap->expects($this->once())->method('hasIdentifier')->with('1234')->will($this->returnValue(TRUE)); $identityMap->expects($this->once())->method('getObjectByIdentifier')->with('1234')->will($this->returnValue($object)); $dataMapper = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Mapper\\DataMapper', array('dummy')); - $dataMapper->_set('identityMap', $identityMap); + $dataMapper->injectIdentityMap($identityMap); $dataMapper->_call('mapSingleRow', get_class($object), $row); } @@ -85,9 +85,8 @@ class DataMapperTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $dataMaps = array( $className => $dataMap ); - /** @var \TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\TYPO3\CMS\Extbase\Reflection\ClassSchema $classSchema */ - $classSchema = $this->getAccessibleMock('TYPO3\CMS\Extbase\Reflection\ClassSchema', array('dummy'), array($className)); - $classSchema->_set('typeHandlingService', new \TYPO3\CMS\Extbase\Service\TypeHandlingService()); + $classSchema = new \TYPO3\CMS\Extbase\Reflection\ClassSchema($className); + $classSchema->injectTypeHandlingService(new \TYPO3\CMS\Extbase\Service\TypeHandlingService()); $classSchema->addProperty('pid', 'integer'); $classSchema->addProperty('uid', 'integer'); $classSchema->addProperty('firstProperty', 'string'); @@ -98,7 +97,7 @@ class DataMapperTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $mockReflectionService->expects($this->any())->method('getClassSchema')->will($this->returnValue($classSchema)); $dataMapper = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Mapper\\DataMapper', array('dummy')); $dataMapper->_set('dataMaps', $dataMaps); - $dataMapper->_set('reflectionService', $mockReflectionService); + $dataMapper->injectReflectionService($mockReflectionService); $dataMapper->_call('thawProperties', $object, $row); $this->assertAttributeEquals('firstValue', 'firstProperty', $object); $this->assertAttributeEquals(1234, 'secondProperty', $object); diff --git a/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/PersistenceManagerTest.php b/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/PersistenceManagerTest.php index 7af6bb05e1911b3915a98b4ab252524d6860cfaf..b55e1e7dfcc898fc30a729a15c1cb0ccd215aedc 100644 --- a/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/PersistenceManagerTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/PersistenceManagerTest.php @@ -45,8 +45,8 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase $mockBackend = $this->getMock('TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface'); $mockBackend->expects($this->once())->method('setAggregateRootObjects')->with($objectStorage); - $manager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy')); - $manager->_set('backend', $mockBackend); + $manager = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager(); + $manager->injectBackend($mockBackend); $manager->add($entity2); $manager->persistAll(); @@ -62,8 +62,8 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase $mockBackend = $this->getMock('TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface'); $mockBackend->expects($this->once())->method('setDeletedEntities')->with($objectStorage); - $manager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy')); - $manager->_set('backend', $mockBackend); + $manager = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager(); + $manager->injectBackend($mockBackend); $manager->remove($entity2); $manager->persistAll(); @@ -79,9 +79,8 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase $mockSession = $this->getMock('TYPO3\CMS\Extbase\Persistence\Generic\Session'); $mockSession->expects($this->once())->method('getIdentifierByObject')->with($object)->will($this->returnValue($fakeUuid)); - /** @var \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface $manager */ - $manager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy')); - $manager->_set('persistenceSession', $mockSession); + $manager = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager(); + $manager->injectPersistenceSession($mockSession); $this->assertEquals($manager->getIdentifierByObject($object), $fakeUuid); } @@ -97,8 +96,8 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase $mockSession->expects($this->once())->method('hasIdentifier')->with($fakeUuid)->will($this->returnValue(TRUE)); $mockSession->expects($this->once())->method('getObjectByIdentifier')->with($fakeUuid)->will($this->returnValue($object)); - $manager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy')); - $manager->_set('persistenceSession', $mockSession); + $manager = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager(); + $manager->injectPersistenceSession($mockSession); $this->assertEquals($manager->getObjectByIdentifier($fakeUuid), $object); } @@ -117,9 +116,9 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase $mockBackend = $this->getMock('TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface'); $mockBackend->expects($this->once())->method('getObjectByIdentifier')->with($fakeUuid, $fakeEntityType)->will($this->returnValue($object)); - $manager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy')); - $manager->_set('persistenceSession', $mockSession); - $manager->_set('backend', $mockBackend); + $manager = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager(); + $manager->injectPersistenceSession($mockSession); + $manager->injectBackend($mockBackend); $this->assertEquals($manager->getObjectByIdentifier($fakeUuid, $fakeEntityType), $object); } @@ -137,9 +136,9 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase $mockBackend = $this->getMock('TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface'); $mockBackend->expects($this->once())->method('getObjectByIdentifier')->with($fakeUuid, $fakeEntityType)->will($this->returnValue(NULL)); - $manager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy')); - $manager->_set('persistenceSession', $mockSession); - $manager->_set('backend', $mockBackend); + $manager = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager(); + $manager->injectPersistenceSession($mockSession); + $manager->injectBackend($mockBackend); $this->assertNull($manager->getObjectByIdentifier($fakeUuid, $fakeEntityType)); } @@ -230,21 +229,20 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase $classNameWithNamespace = 'Foo\\Bar\\Domain\\Model\\' . $className; $repositorClassNameWithNamespace = 'Foo\\Bar\\Domain\\Repository\\' . $className . 'Repository'; - $persistenceManager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy')); + $persistenceManager = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager(); $session = new \TYPO3\CMS\Extbase\Persistence\Generic\Session(); $changedEntities = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); $entity1 = new $classNameWithNamespace(); - $repository = $this->getAccessibleMock($repositorClassNameWithNamespace, array('dummy')); - $repository->_set('objectType', get_class($entity1)); + $repository = new $repositorClassNameWithNamespace; $mockBackend = $this->getMock($this->buildAccessibleProxy('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Backend'), array('commit', 'setChangedEntities'), array(), '', FALSE); $mockBackend->expects($this->once()) ->method('setChangedEntities') ->with($this->equalTo($changedEntities)); - $persistenceManager->_set('backend', $mockBackend); - $persistenceManager->_set('persistenceSession', $session); + $persistenceManager->injectBackend($mockBackend); + $persistenceManager->injectPersistenceSession($session); + $repository->injectPersistenceManager($persistenceManager); - $repository->_set('persistenceManager', $persistenceManager); $session->registerObject($entity1, 42); $changedEntities->attach($entity1); $repository->update($entity1); @@ -264,9 +262,9 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase $mockBackend = $this->getMock('TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface'); $mockBackend->expects($this->any())->method('getObjectDataByIdentifier')->will($this->returnValue(FALSE)); - $persistenceManager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy')); - $persistenceManager->_set('persistenceSession', $mockSession); - $persistenceManager->_set('backend', $mockBackend); + $persistenceManager = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager(); + $persistenceManager->injectPersistenceSession($mockSession); + $persistenceManager->injectBackend($mockBackend); $persistenceManager->registerNewObject($mockObject); $persistenceManager->clearState(); @@ -282,8 +280,8 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase $mockBackend = $this->getMock('TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface'); $mockBackend->expects($this->never())->method('tearDown'); - $persistenceManager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy')); - $persistenceManager->_set('backend', $mockBackend); + $persistenceManager = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager(); + $persistenceManager->injectBackend($mockBackend); $persistenceManager->tearDown(); } @@ -296,8 +294,8 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase $mockBackend = $this->getMock('TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface', $methods); $mockBackend->expects($this->once())->method('tearDown'); - $persistenceManager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy')); - $persistenceManager->_set('backend', $mockBackend); + $persistenceManager = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager(); + $persistenceManager->injectBackend($mockBackend); $persistenceManager->tearDown(); } @@ -317,7 +315,7 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase eval (' class Foo_Bar_Domain_Repository_' . $className . 'Repository {} '); - $persistenceManager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy')); + $persistenceManager = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager(); $aggregateRootObjects = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); $fullClassName = 'Foo_Bar_Domain_Model_' . $className; $entity1 = new $fullClassName(); @@ -326,7 +324,7 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase $mockBackend->expects($this->once()) ->method('setAggregateRootObjects') ->with($this->equalTo($aggregateRootObjects)); - $persistenceManager->_set('backend', $mockBackend); + $persistenceManager->injectBackend($mockBackend); $persistenceManager->add($entity1); $persistenceManager->persistAll(); } @@ -344,7 +342,7 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase namespace Foo\\Bar\\Domain\\Repository; class ' . $className . 'Repository {} '); - $persistenceManager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy')); + $persistenceManager = new \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager(); $aggregateRootObjects = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); $classNameWithNamespace = 'Foo\\Bar\\Domain\\Model\\' . $className; $entity1 = new $classNameWithNamespace(); @@ -353,7 +351,7 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase $mockBackend->expects($this->once()) ->method('setAggregateRootObjects') ->with($this->equalTo($aggregateRootObjects)); - $persistenceManager->_set('backend', $mockBackend); + $persistenceManager->injectBackend($mockBackend); $persistenceManager->add($entity1); $persistenceManager->persistAll(); } diff --git a/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/QueryFactoryTest.php b/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/QueryFactoryTest.php index 559b7253b6a4626cec716bb294aef93a27f5d004..5060ded5c0a622463ac604ae186446e221dbd5e3 100644 --- a/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/QueryFactoryTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/QueryFactoryTest.php @@ -60,17 +60,17 @@ class QueryFactoryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { protected function setUp() { $this->dataMap = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Mapper\\DataMap', array('getIsStatic', 'getRootLevel'), array('Vendor\\Ext\\Domain\\Model\\ClubMate', 'tx_ext_domain_model_clubmate')); - $this->queryFactory = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\QueryFactory', array('dummy')); - $this->queryFactory->_set('configurationManager', + $this->queryFactory = new \TYPO3\CMS\Extbase\Persistence\Generic\QueryFactory(); + $this->queryFactory->injectConfigurationManager( $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface') ); $this->objectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface'); - $this->queryFactory->_set('objectManager', $this->objectManager); + $this->queryFactory->injectObjectManager($this->objectManager); $this->dataMapper = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Mapper\\DataMapper', array('getDataMap', 'convertClassNameToTableName')); $this->dataMapper->expects($this->any())->method('getDataMap')->will($this->returnValue($this->dataMap)); - $this->queryFactory->_set('dataMapper', $this->dataMapper); + $this->queryFactory->injectDataMapper($this->dataMapper); } protected function tearDown() { diff --git a/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/QueryResultTest.php b/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/QueryResultTest.php index 55cd9f7175a496161e38ee89ebb00e1b9fa03c71..a54ddf142db38e355b554f3a37c72a749f16b575 100644 --- a/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/QueryResultTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/QueryResultTest.php @@ -61,9 +61,9 @@ class QueryResultTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $this->mockPersistenceManager->expects($this->any())->method('getObjectCountByQuery')->will($this->returnValue(2)); $this->mockDataMapper = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Mapper\\DataMapper'); $this->mockQuery = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\QueryInterface'); - $this->queryResult = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\QueryResult', array('dummy'), array($this->mockQuery)); - $this->queryResult->_set('persistenceManager', $this->mockPersistenceManager); - $this->queryResult->_set('dataMapper', $this->mockDataMapper); + $this->queryResult = new \TYPO3\CMS\Extbase\Persistence\Generic\QueryResult($this->mockQuery); + $this->queryResult->injectPersistenceManager($this->mockPersistenceManager); + $this->queryResult->injectDataMapper($this->mockDataMapper); $this->sampleResult = array(array('foo' => 'Foo1', 'bar' => 'Bar1'), array('foo' => 'Foo2', 'bar' => 'Bar2')); $this->mockDataMapper->expects($this->any())->method('map')->will($this->returnValue($this->sampleResult)); } @@ -120,8 +120,8 @@ class QueryResultTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { * @test */ public function countDoesNotInitializeProxy() { - $queryResult = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QueryResult', array('initialize'), array($this->mockQuery)); - $queryResult->_set('persistenceManager', $this->mockPersistenceManager); + $queryResult = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QueryResult', array('initialize'), array($this->mockQuery)); + $queryResult->injectPersistenceManager($this->mockPersistenceManager); $queryResult->expects($this->never())->method('initialize'); $queryResult->count(); } @@ -130,8 +130,8 @@ class QueryResultTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { * @test */ public function countCallsGetObjectCountByQueryOnPersistenceManager() { - $queryResult = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QueryResult', array('initialize'), array($this->mockQuery)); - $queryResult->_set('persistenceManager', $this->mockPersistenceManager); + $queryResult = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QueryResult', array('initialize'), array($this->mockQuery)); + $queryResult->injectPersistenceManager($this->mockPersistenceManager); $this->assertEquals(2, $queryResult->count()); } @@ -162,8 +162,8 @@ class QueryResultTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { public function initializeExecutesQueryWithArrayFetchMode() { /** @var \TYPO3\CMS\Extbase\Persistence\Generic\QueryResult|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */ $queryResult = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QueryResult', array('dummy'), array($this->mockQuery)); - $queryResult->_set('persistenceManager', $this->mockPersistenceManager); - $queryResult->_set('dataMapper', $this->mockDataMapper); + $queryResult->injectPersistenceManager($this->mockPersistenceManager); + $queryResult->injectDataMapper($this->mockDataMapper); $this->mockPersistenceManager->expects($this->once())->method('getObjectDataByQuery')->with($this->mockQuery)->will($this->returnValue(array('FAKERESULT'))); $queryResult->_call('initialize'); } diff --git a/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/QueryTest.php b/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/QueryTest.php index ffe06e76a789cfa0a467974c1d9233907a8c04f9..85f01745de8dd33581f3da6b5b15c5d42f539b15 100644 --- a/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/QueryTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/QueryTest.php @@ -63,18 +63,17 @@ class QueryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { */ public function setUp() { $this->objectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface'); - - $this->query = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\Query', array('dummy'), array('someType')); - $this->query->_set('objectManager', $this->objectManager); + $this->query = new \TYPO3\CMS\Extbase\Persistence\Generic\Query('someType'); + $this->query->injectObjectManager($this->objectManager); $this->querySettings = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QuerySettingsInterface'); - $this->query->_set('querySettings', $this->querySettings); + $this->query->setQuerySettings($this->querySettings); $this->persistenceManager = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\PersistenceManagerInterface'); $this->backend = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\BackendInterface'); $this->backend->expects($this->any())->method('getQomFactory')->will($this->returnValue(NULL)); $this->persistenceManager->expects($this->any())->method('getBackend')->will($this->returnValue($this->backend)); - $this->query->_set('persistenceManager', $this->persistenceManager); + $this->query->injectPersistenceManager($this->persistenceManager); $this->dataMapper = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Mapper\\DataMapper'); - $this->query->_set('dataMapper', $this->dataMapper); + $this->query->injectDataMapper($this->dataMapper); } /** @@ -153,10 +152,10 @@ class QueryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { */ public function equalsForCaseSensitiveFalseLowercasesOperand($propertyName, $operand, $expectedOperand) { /** @var $qomFactory \TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelFactory */ - $qomFactory = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Qom\\QueryObjectModelFactory', array('comparison')); - $qomFactory->_set('objectManager', \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager')); + $qomFactory = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Qom\\QueryObjectModelFactory', array('comparison')); + $qomFactory->injectObjectManager(\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager')); $qomFactory->expects($this->once())->method('comparison')->with($this->anything(), $this->anything(), $expectedOperand); - $this->query->_set('qomFactory', $qomFactory); + $this->query->injectQomFactory($qomFactory); $this->query->equals($propertyName, $operand, FALSE); } } diff --git a/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Storage/Typo3DbBackendTest.php b/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Storage/Typo3DbBackendTest.php index 29c365de274b04060fc6bccd9a50f668b24c49be..24373172f3e7e16979128d2a9df5604777bba556 100644 --- a/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Storage/Typo3DbBackendTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Storage/Typo3DbBackendTest.php @@ -336,7 +336,7 @@ class Typo3DbBackendTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { /** @var $mockTypo3DbBackend \TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend | \PHPUnit_Framework_MockObject_MockObject */ $mockTypo3DbBackend = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Storage\\Typo3DbBackend', array('dummy'), array(), '', FALSE); - $mockTypo3DbBackend->_set('environmentService', $mockEnvironmentService); + $mockTypo3DbBackend->injectEnvironmentService($mockEnvironmentService); $mockTypo3DbBackend->_callRef('addVisibilityConstraintStatement', $mockQuerySettings, $tableName, $sql); $this->assertSame($expectedSql, $sql['additionalWhereClause']); unset($GLOBALS['TCA'][$tableName]); @@ -377,7 +377,7 @@ class Typo3DbBackendTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { /** @var $mockTypo3DbBackend \TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend | \PHPUnit_Framework_MockObject_MockObject */ $mockTypo3DbBackend = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Storage\\Typo3DbBackend', array('dummy'), array(), '', FALSE); - $mockTypo3DbBackend->_set('environmentService', $mockEnvironmentService); + $mockTypo3DbBackend->injectEnvironmentService($mockEnvironmentService); $mockTypo3DbBackend->_callRef('addVisibilityConstraintStatement', $mockQuerySettings, $tableName, $sql); $this->assertSame($expectedSql, $sql['additionalWhereClause']); unset($GLOBALS['TCA'][$tableName]); @@ -407,7 +407,7 @@ class Typo3DbBackendTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { /** @var $mockTypo3DbBackend \TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend | \PHPUnit_Framework_MockObject_MockObject */ $mockTypo3DbBackend = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Storage\\Typo3DbBackend', array('dummy'), array(), '', FALSE); - $mockTypo3DbBackend->_set('environmentService', $mockEnvironmentService); + $mockTypo3DbBackend->injectEnvironmentService($mockEnvironmentService); $mockTypo3DbBackend->_callRef('addVisibilityConstraintStatement', $mockQuerySettings, $tableName, $sql); unset($GLOBALS['TCA'][$tableName]); } diff --git a/typo3/sysext/extbase/Tests/Unit/Persistence/RepositoryTest.php b/typo3/sysext/extbase/Tests/Unit/Persistence/RepositoryTest.php index 722f8b8ca5e329b7f33e7ad24886ada38972ce84..f6160768f14a1c4fdd9cae79a8f55a1a131623ea 100644 --- a/typo3/sysext/extbase/Tests/Unit/Persistence/RepositoryTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Persistence/RepositoryTest.php @@ -88,7 +88,7 @@ class RepositoryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $this->mockPersistenceManager->expects($this->any())->method('createQueryForType')->will($this->returnValue($this->mockQuery)); $this->mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface'); $this->repository = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Persistence\\Repository', array('dummy'), array($this->mockObjectManager)); - $this->repository->_set('persistenceManager', $this->mockPersistenceManager); + $this->repository->injectPersistenceManager($this->mockPersistenceManager); } /** diff --git a/typo3/sysext/extbase/Tests/Unit/Property/MapperTest.php b/typo3/sysext/extbase/Tests/Unit/Property/MapperTest.php index 4d577caf27fbb329b840d4d0f1e3f5fa97e5288a..425dd66c5f453f96aa8fc209d350be73079d3b13 100644 --- a/typo3/sysext/extbase/Tests/Unit/Property/MapperTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Property/MapperTest.php @@ -53,18 +53,18 @@ class MapperTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $queryFactory = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QueryFactory'); /** @var \TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService */ - $reflectionService = $this-> getAccessibleMock('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService'); - $reflectionService->_set('objectManager', $objectManager); + $reflectionService = $this->getMock('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService'); + $reflectionService->injectObjectManager($objectManager); /** @var \TYPO3\CMS\Extbase\Validation\ValidatorResolver $validatorResolver */ $validatorResolver = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver'); - $this->fixture = $this->getAccessibleMock('TYPO3\CMS\Extbase\Property\Mapper', array('dummy')); - $this->fixture->_set('objectManager', $objectManager); - $this->fixture->_set('persistenceManager', $persistenceManager); - $this->fixture->_set('queryFactory', $queryFactory); - $this->fixture->_set('reflectionService', $reflectionService); - $this->fixture->_set('validatorResolver', $validatorResolver); + $this->fixture = new \TYPO3\CMS\Extbase\Property\Mapper(); + $this->fixture->injectObjectManager($objectManager); + $this->fixture->injectPersistenceManager($persistenceManager); + $this->fixture->injectQueryFactory($queryFactory); + $this->fixture->injectReflectionService($reflectionService); + $this->fixture->injectValidatorResolver($validatorResolver); } public function tearDown() { diff --git a/typo3/sysext/extbase/Tests/Unit/Reflection/ReflectionServiceTest.php b/typo3/sysext/extbase/Tests/Unit/Reflection/ReflectionServiceTest.php index 7539daad398b9d60c81599828ee5e5ea7af2fa2c..d3cd6d163e89152118a35669acdf564222bc8209 100644 --- a/typo3/sysext/extbase/Tests/Unit/Reflection/ReflectionServiceTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Reflection/ReflectionServiceTest.php @@ -89,8 +89,8 @@ class ReflectionServiceTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { class ' . $className . 'Repository {} '); - $service = $this->getAccessibleMock('TYPO3\CMS\Extbase\Reflection\ReflectionService', array('dummy')); - $service->_set('objectManager', $this->objectManager); + $service = new \TYPO3\CMS\Extbase\Reflection\ReflectionService(); + $service->injectObjectManager($this->objectManager); $classSchema = $service->getClassSchema('Foo\\Bar\\Domain\\Model\\' . $className); $this->assertTrue($classSchema->isAggregateRoot()); } @@ -107,8 +107,8 @@ class ReflectionServiceTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { class Foo_Bar_Domain_Repository_' . $className . 'Repository {} '); - $service = $this->getAccessibleMock('TYPO3\CMS\Extbase\Reflection\ReflectionService', array('dummy')); - $service->_set('objectManager', $this->objectManager); + $service = new \TYPO3\CMS\Extbase\Reflection\ReflectionService(); + $service->injectObjectManager($this->objectManager); $classSchema = $service->getClassSchema('Foo_Bar_Domain_Model_' . $className); $this->assertTrue($classSchema->isAggregateRoot()); } diff --git a/typo3/sysext/extbase/Tests/Unit/Scheduler/FieldProviderTest.php b/typo3/sysext/extbase/Tests/Unit/Scheduler/FieldProviderTest.php index a023bc10e3569d3e28addcf9db337ea827b2894f..ee1500660a69a45790e662dad41c170e6c0db461 100644 --- a/typo3/sysext/extbase/Tests/Unit/Scheduler/FieldProviderTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Scheduler/FieldProviderTest.php @@ -78,19 +78,19 @@ class FieldProviderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { FALSE ); - $this->command1 = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Cli\Command', array('isInternal'), array('TYPO3\\CMS\\Extbase\\Tests\\MockACommandController', 'FuncA')); - $this->command1->_set('objectManager', $this->objectManager); - $this->command1->_set('reflectionService', $this->objectManager->get('TYPO3\CMS\Extbase\Reflection\ReflectionService')); + $this->command1 = $this->getMock('TYPO3\CMS\Extbase\Mvc\Cli\Command', array('isInternal'), array('TYPO3\\CMS\\Extbase\\Tests\\MockACommandController', 'FuncA')); + $this->command1->injectObjectManager($this->objectManager); + $this->command1->injectReflectionService($this->objectManager->get('TYPO3\CMS\Extbase\Reflection\ReflectionService')); $this->command1->expects($this->any())->method('isInternal')->will($this->returnValue(FALSE)); - $this->command2 = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Cli\Command', array('isInternal'), array('Acme\\Mypkg\\Command\\MockBCommandController', 'FuncB')); - $this->command2->_set('objectManager', $this->objectManager); - $this->command2->_set('reflectionService', $this->objectManager->get('TYPO3\CMS\Extbase\Reflection\ReflectionService')); + $this->command2 = $this->getMock('TYPO3\CMS\Extbase\Mvc\Cli\Command', array('isInternal'), array('Acme\\Mypkg\\Command\\MockBCommandController', 'FuncB')); + $this->command2->injectObjectManager($this->objectManager); + $this->command2->injectReflectionService($this->objectManager->get('TYPO3\CMS\Extbase\Reflection\ReflectionService')); $this->command2->expects($this->any())->method('isInternal')->will($this->returnValue(FALSE)); - $this->command3 = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Cli\Command', array('isInternal'), array('Tx_Extbase_Command_MockCCommandController', 'FuncC')); - $this->command3->_set('objectManager', $this->objectManager); - $this->command3->_set('reflectionService', $this->objectManager->get('TYPO3\CMS\Extbase\Reflection\ReflectionService')); + $this->command3 = $this->getMock('TYPO3\CMS\Extbase\Mvc\Cli\Command', array('isInternal'), array('Tx_Extbase_Command_MockCCommandController', 'FuncC')); + $this->command3->injectObjectManager($this->objectManager); + $this->command3->injectReflectionService($this->objectManager->get('TYPO3\CMS\Extbase\Reflection\ReflectionService')); $this->command3->expects($this->any())->method('isInternal')->will($this->returnValue(FALSE)); $this->commandManager->expects($this->any())->method('getAvailableCommands')->will($this->returnValue(array($this->command1, $this->command2, $this->command3))); diff --git a/typo3/sysext/extbase/Tests/Unit/Scheduler/TaskExecuterTest.php b/typo3/sysext/extbase/Tests/Unit/Scheduler/TaskExecuterTest.php index 38bf6ba24d8e2a86c8b346f903f52223ab7f30a8..b0febc11e71d4c0bc60c1ee73111355876e30e0d 100644 --- a/typo3/sysext/extbase/Tests/Unit/Scheduler/TaskExecuterTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Scheduler/TaskExecuterTest.php @@ -66,8 +66,8 @@ class TaskExecutorTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { public function setUp() { $this->controller = $this->getAccessibleMock('TYPO3\CMS\Extbase\Tests\MockACommandController', array('dummy')); - $this->controller->_set('reflectionService', $this->objectManager->get('TYPO3\CMS\Extbase\Reflection\ReflectionService')); - $this->controller->_set('objectManager', $this->objectManager); + $this->controller->injectReflectionService($this->objectManager->get('TYPO3\CMS\Extbase\Reflection\ReflectionService')); + $this->controller->injectObjectManager($this->objectManager); $command = new \TYPO3\CMS\Extbase\Mvc\Cli\Command('TYPO3\CMS\Extbase\Tests\MockACommandController', 'funcA'); $nullBackend = new \TYPO3\CMS\Core\Cache\Backend\NullBackend('production'); @@ -98,15 +98,15 @@ class TaskExecutorTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { * @author Alexander Schnitzler <alex.schnitzler@typovision.de> */ public function executeDispatchesTheRightCommandControllerAndCommandAction() { - $dispatcher = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Dispatcher', array('resolveController'), array($this->objectManager)); + $dispatcher = $this->getMock('TYPO3\CMS\Extbase\Mvc\Dispatcher', array('resolveController'), array($this->objectManager)); $dispatcher->expects($this->any())->method('resolveController')->will($this->returnValue($this->controller)); - $dispatcher->_set('signalSlotDispatcher', $this->objectManager->get('TYPO3\CMS\Extbase\SignalSlot\Dispatcher')); + $dispatcher->injectSignalSlotDispatcher($this->objectManager->get('TYPO3\CMS\Extbase\SignalSlot\Dispatcher')); $this->taskExecuter = $this->getAccessibleMock('TYPO3\CMS\Extbase\Scheduler\TaskExecutor', array('dummy', 'shutdown', 'getDispatcher')); $this->taskExecuter->expects($this->any())->method('getDispatcher')->will($this->returnValue($dispatcher)); - $this->taskExecuter->_set('objectManager', $this->objectManager); - $this->taskExecuter->_set('commandManager', $this->commandManager); - $this->taskExecuter->_set('configurationManager', $this->configurationManager); + $this->taskExecuter->injectObjectManager($this->objectManager); + $this->taskExecuter->injectCommandManager($this->commandManager); + $this->taskExecuter->injectConfigurationManager($this->configurationManager); $this->taskExecuter->initializeObject(); /** @var $task \TYPO3\CMS\Extbase\Scheduler\Task|\PHPUnit_Framework_MockObject_MockObject */ diff --git a/typo3/sysext/extbase/Tests/Unit/Service/ExtensionServiceTest.php b/typo3/sysext/extbase/Tests/Unit/Service/ExtensionServiceTest.php index 41212354a0eea2099ca43daa758f5373d792ea8c..564d33749d6d532749f62baedc5bbf7392935cc9 100644 --- a/typo3/sysext/extbase/Tests/Unit/Service/ExtensionServiceTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Service/ExtensionServiceTest.php @@ -47,9 +47,9 @@ class ExtensionServiceTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $this->typo3DbBackup = $GLOBALS['TYPO3_DB']; $GLOBALS['TYPO3_DB'] = $this->getMock('TYPO3\\CMS\\Core\\Database\\DatabaseConnection', array('fullQuoteStr', 'exec_SELECTgetRows')); $GLOBALS['TSFE'] = new \stdClass(); - $this->extensionService = $this->getAccessibleMock('TYPO3\CMS\Extbase\Service\ExtensionService', array('dummy')); + $this->extensionService = new \TYPO3\CMS\Extbase\Service\ExtensionService(); $this->mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface'); - $this->extensionService->_set('configurationManager', $this->mockConfigurationManager); + $this->extensionService->injectConfigurationManager($this->mockConfigurationManager); $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions'] = array( 'ExtensionName' => array( 'plugins' => array( diff --git a/typo3/sysext/extbase/Tests/Unit/Validation/ValidatorResolverTest.php b/typo3/sysext/extbase/Tests/Unit/Validation/ValidatorResolverTest.php index 182df9c4189edf2e958c4e582e6a598df828be57..f3cc41bc08da5188cceb6ed888134fa2fa09b953 100644 --- a/typo3/sysext/extbase/Tests/Unit/Validation/ValidatorResolverTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Validation/ValidatorResolverTest.php @@ -45,7 +45,7 @@ class ValidatorResolverTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { public function setUp() { $this->validatorResolver = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array('dummy')); $this->mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManager'); - $this->validatorResolver->_set('objectManager', $this->mockObjectManager); + $this->validatorResolver->injectObjectManager($this->mockObjectManager); } /****************/ @@ -162,7 +162,7 @@ class ValidatorResolverTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $mockValidator->expects($this->once())->method('setOptions')->with(array('foo' => 'bar')); $this->mockObjectManager->expects($this->any())->method('get')->with($className)->will($this->returnValue($mockValidator)); $validatorResolver = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array('resolveValidatorObjectName')); - $validatorResolver->_set('objectManager', $this->mockObjectManager); + $validatorResolver->injectObjectManager($this->mockObjectManager); $validatorResolver->expects($this->once())->method('resolveValidatorObjectName')->with($className)->will($this->returnValue($className)); $validator = $validatorResolver->createValidator($className, array('foo' => 'bar')); $this->assertSame($mockValidator, $validator); @@ -201,8 +201,8 @@ class ValidatorResolverTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $methodParameters = array(); $mockReflectionService = $this->getMock('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService', array(), array(), '', FALSE); $mockReflectionService->expects($this->once())->method('getMethodParameters')->with(get_class($mockController), 'fooAction')->will($this->returnValue($methodParameters)); - $validatorResolver = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array('createValidator')); - $validatorResolver->_set('reflectionService', $mockReflectionService); + $validatorResolver = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array('createValidator')); + $validatorResolver->injectReflectionService($mockReflectionService); $result = $validatorResolver->buildMethodArgumentsValidatorConjunctions(get_class($mockController), 'fooAction'); $this->assertSame(array(), $result); } @@ -250,7 +250,7 @@ class ValidatorResolverTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $mockArguments = new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments(); $mockArguments->addArgument(new \TYPO3\CMS\Extbase\Mvc\Controller\Argument('arg1', 'dummyValue')); $mockArguments->addArgument(new \TYPO3\CMS\Extbase\Mvc\Controller\Argument('arg2', 'dummyValue')); - $validatorResolver = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array('createValidator')); + $validatorResolver = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array('createValidator')); $validatorResolver->expects($this->at(0))->method('createValidator')->with('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ConjunctionValidator')->will($this->returnValue($conjunction1)); $validatorResolver->expects($this->at(1))->method('createValidator')->with('string')->will($this->returnValue($mockStringValidator)); $validatorResolver->expects($this->at(2))->method('createValidator')->with('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ConjunctionValidator')->will($this->returnValue($conjunction2)); @@ -258,7 +258,7 @@ class ValidatorResolverTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $validatorResolver->expects($this->at(4))->method('createValidator')->with('Foo', array('bar' => 'baz'))->will($this->returnValue($mockFooValidator)); $validatorResolver->expects($this->at(5))->method('createValidator')->with('Bar')->will($this->returnValue($mockBarValidator)); $validatorResolver->expects($this->at(6))->method('createValidator')->with('VENDOR\\ModelCollection\\Domain\\Model\\Model')->will($this->returnValue($mockQuuxValidator)); - $validatorResolver->_set('reflectionService', $mockReflectionService); + $validatorResolver->injectReflectionService($mockReflectionService); $result = $validatorResolver->buildMethodArgumentsValidatorConjunctions(get_class($mockObject), 'fooAction'); $this->assertEquals(array('arg1' => $conjunction1, 'arg2' => $conjunction2), $result); } @@ -290,11 +290,11 @@ class ValidatorResolverTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $mockQuuxValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface', array(), array(), '', FALSE); $conjunction1 = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ConjunctionValidator', array(), array(), '', FALSE); $conjunction1->expects($this->at(0))->method('addValidator')->with($mockStringValidator); - $validatorResolver = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array('createValidator')); + $validatorResolver = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array('createValidator')); $validatorResolver->expects($this->at(0))->method('createValidator')->with('TYPO3\\CMS\\Extbase\\Validation\\Validator\\ConjunctionValidator')->will($this->returnValue($conjunction1)); $validatorResolver->expects($this->at(1))->method('createValidator')->with('string')->will($this->returnValue($mockStringValidator)); $validatorResolver->expects($this->at(2))->method('createValidator')->with('VENDOR\\ModelCollection\\Domain\\Model\\Model')->will($this->returnValue($mockQuuxValidator)); - $validatorResolver->_set('reflectionService', $mockReflectionService); + $validatorResolver->injectReflectionService($mockReflectionService); $validatorResolver->buildMethodArgumentsValidatorConjunctions(get_class($mockObject), 'fooAction'); } @@ -330,8 +330,8 @@ class ValidatorResolverTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface', array(), array(), '', FALSE); $mockObjectManager->expects($this->at(0))->method('get')->with('TYPO3\\CMS\\Extbase\\Validation\\Validator\\GenericObjectValidator')->will($this->returnValue($mockObjectValidator)); $validatorResolver = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array('resolveValidatorObjectName', 'createValidator')); - $validatorResolver->_set('reflectionService', $mockReflectionService); - $validatorResolver->_set('objectManager', $mockObjectManager); + $validatorResolver->injectReflectionService($mockReflectionService); + $validatorResolver->injectObjectManager($mockObjectManager); $validatorResolver->expects($this->at(0))->method('createValidator')->with('Foo', array('bar' => 'baz'))->will($this->returnValue($mockObjectValidator)); $validatorResolver->expects($this->at(1))->method('createValidator')->with('Bar')->will($this->returnValue($mockObjectValidator)); $validatorResolver->expects($this->at(2))->method('createValidator')->with('Baz')->will($this->returnValue($mockObjectValidator)); @@ -362,7 +362,7 @@ class ValidatorResolverTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase { public function buildBaseValidatorConjunctionCreatesValidatorFromClassName($modelClassName, $validatorClassName) { $mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface', array(), array(), '', FALSE); $validatorResolver = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver', array('resolveValidatorObjectName', 'createValidator')); - $validatorResolver->_set('objectManager', $mockObjectManager); + $validatorResolver->injectObjectManager($mockObjectManager); $validatorResolver->expects($this->once())->method('createValidator')->with($validatorClassName)->will($this->returnValue(NULL)); $validatorResolver->_call('buildBaseValidatorConjunction', $modelClassName, $modelClassName); } diff --git a/typo3/sysext/fluid/Tests/Unit/Core/Widget/AbstractWidgetControllerTest.php b/typo3/sysext/fluid/Tests/Unit/Core/Widget/AbstractWidgetControllerTest.php index e9cea3f44f761c6c67478216c8968fee5f699f1d..1b56c40d5c596b2e55e70dca3f27fb3d0a756159 100644 --- a/typo3/sysext/fluid/Tests/Unit/Core/Widget/AbstractWidgetControllerTest.php +++ b/typo3/sysext/fluid/Tests/Unit/Core/Widget/AbstractWidgetControllerTest.php @@ -49,7 +49,7 @@ class AbstractWidgetControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTes $objectManager->expects($this->any())->method('get')->with('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder')->will($this->returnValue($mockUriBuilder)); $configurationService = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\MvcPropertyMappingConfigurationService'); - $abstractWidgetController->_set('mvcPropertyMappingConfigurationService', $configurationService); + $abstractWidgetController->injectMvcPropertyMappingConfigurationService($configurationService); $abstractWidgetController->_set('arguments', new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments()); $abstractWidgetController->_set('objectManager', $objectManager); @@ -79,7 +79,7 @@ class AbstractWidgetControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTes $configurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($frameworkConfiguration)); $view = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('dummy')); $abstractWidgetController = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\AbstractWidgetController', array('dummy')); - $abstractWidgetController->_set('configurationManager', $configurationManager); + $abstractWidgetController->injectConfigurationManager($configurationManager); $abstractWidgetController->_set('request', $request); $abstractWidgetController->_call('setViewConfiguration', $view); $this->assertEquals(\TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName('EXT:fluid/Resources/Private/DummyTestTemplates'), $view->_call('getTemplateRootPath')); diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/FormViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/FormViewHelperTest.php index 85dccd1195007988b32de359cf48a8df129c2bd0..f66eace87e98ed523b4db3ee3d535c463eb388a7 100644 --- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/FormViewHelperTest.php +++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/FormViewHelperTest.php @@ -48,10 +48,10 @@ class FormViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHel * @return void */ protected function injectDependenciesIntoViewHelper(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper $viewHelper) { - $viewHelper->_set('configurationManager', $this->mockConfigurationManager); + $viewHelper->injectConfigurationManager($this->mockConfigurationManager); parent::injectDependenciesIntoViewHelper($viewHelper); - $this->mvcPropertyMapperConfigurationService->_set('hashService', new \TYPO3\CMS\Extbase\Security\Cryptography\HashService()); - $viewHelper->_set('mvcPropertyMapperConfigurationService', $this->mvcPropertyMapperConfigurationService); + $this->mvcPropertyMapperConfigurationService->injectHashService(new \TYPO3\CMS\Extbase\Security\Cryptography\HashService()); + $viewHelper->injectMvcPropertyMapperConfigurationService($this->mvcPropertyMapperConfigurationService); } /** @@ -132,12 +132,12 @@ class FormViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHel * @test */ public function renderWrapsHiddenFieldsWithDivForXhtmlCompatibilityWithOldPropertyMapper() { - $viewHelper = $this->getAccessibleMock($this->buildAccessibleProxy('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper'), array('renderChildren', 'renderHiddenIdentityField', 'renderAdditionalIdentityFields', 'renderHiddenReferrerFields', 'renderRequestHashField'), array(), '', FALSE); + $viewHelper = $this->getMock($this->buildAccessibleProxy('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper'), array('renderChildren', 'renderHiddenIdentityField', 'renderAdditionalIdentityFields', 'renderHiddenReferrerFields', 'renderRequestHashField'), array(), '', FALSE); $configurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager', array('isFeatureEnabled')); $configurationManager->expects($this->once())->method('isFeatureEnabled')->with('rewrittenPropertyMapper')->will($this->returnValue(FALSE)); - $viewHelper->_set('configurationManager', $configurationManager); - $this->mvcPropertyMapperConfigurationService->_set('hashService', new \TYPO3\CMS\Extbase\Security\Cryptography\HashService()); - $viewHelper->_set('mvcPropertyMapperConfigurationService', $this->mvcPropertyMapperConfigurationService); + $viewHelper->injectConfigurationManager($configurationManager); + $this->mvcPropertyMapperConfigurationService->injectHashService(new \TYPO3\CMS\Extbase\Security\Cryptography\HashService()); + $viewHelper->injectMvcPropertyMapperConfigurationService($this->mvcPropertyMapperConfigurationService); parent::injectDependenciesIntoViewHelper($viewHelper); $viewHelper->expects($this->once())->method('renderHiddenIdentityField')->will($this->returnValue('hiddenIdentityField')); $viewHelper->expects($this->once())->method('renderAdditionalIdentityFields')->will($this->returnValue('additionalIdentityFields')); @@ -153,12 +153,12 @@ class FormViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHel * @test */ public function renderWrapsHiddenFieldsWithDivForXhtmlCompatibilityWithRewrittenPropertyMapper() { - $viewHelper = $this->getAccessibleMock($this->buildAccessibleProxy('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper'), array('renderChildren', 'renderHiddenIdentityField', 'renderAdditionalIdentityFields', 'renderHiddenReferrerFields', 'renderTrustedPropertiesField'), array(), '', FALSE); + $viewHelper = $this->getMock($this->buildAccessibleProxy('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper'), array('renderChildren', 'renderHiddenIdentityField', 'renderAdditionalIdentityFields', 'renderHiddenReferrerFields', 'renderTrustedPropertiesField'), array(), '', FALSE); $configurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager', array('isFeatureEnabled')); $configurationManager->expects($this->once())->method('isFeatureEnabled')->with('rewrittenPropertyMapper')->will($this->returnValue(TRUE)); - $viewHelper->_set('configurationManager', $configurationManager); - $this->mvcPropertyMapperConfigurationService->_set('hashService', new \TYPO3\CMS\Extbase\Security\Cryptography\HashService()); - $viewHelper->_set('mvcPropertyMapperConfigurationService', $this->mvcPropertyMapperConfigurationService); + $viewHelper->injectConfigurationManager($configurationManager); + $this->mvcPropertyMapperConfigurationService->injectHashService(new \TYPO3\CMS\Extbase\Security\Cryptography\HashService()); + $viewHelper->injectMvcPropertyMapperConfigurationService($this->mvcPropertyMapperConfigurationService); parent::injectDependenciesIntoViewHelper($viewHelper); $viewHelper->expects($this->once())->method('renderHiddenIdentityField')->will($this->returnValue('hiddenIdentityField')); $viewHelper->expects($this->once())->method('renderAdditionalIdentityFields')->will($this->returnValue('additionalIdentityFields')); @@ -176,9 +176,9 @@ class FormViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHel $viewHelper = $this->getMock($this->buildAccessibleProxy('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper'), array('renderChildren', 'renderHiddenIdentityField', 'renderAdditionalIdentityFields', 'renderHiddenReferrerFields', 'renderTrustedPropertiesField'), array(), '', FALSE); $configurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager', array('isFeatureEnabled')); $configurationManager->expects($this->once())->method('isFeatureEnabled')->with('rewrittenPropertyMapper')->will($this->returnValue(TRUE)); - $viewHelper->_set('configurationManager', $configurationManager); - $this->mvcPropertyMapperConfigurationService->_set('hashService', new \TYPO3\CMS\Extbase\Security\Cryptography\HashService()); - $viewHelper->_set('mvcPropertyMapperConfigurationService', $this->mvcPropertyMapperConfigurationService); + $viewHelper->injectConfigurationManager($configurationManager); + $this->mvcPropertyMapperConfigurationService->injectHashService(new \TYPO3\CMS\Extbase\Security\Cryptography\HashService()); + $viewHelper->injectMvcPropertyMapperConfigurationService($this->mvcPropertyMapperConfigurationService); parent::injectDependenciesIntoViewHelper($viewHelper); $viewHelper->expects($this->once())->method('renderHiddenIdentityField')->will($this->returnValue('hiddenIdentityField')); $viewHelper->expects($this->once())->method('renderAdditionalIdentityFields')->will($this->returnValue('additionalIdentityFields')); @@ -242,7 +242,7 @@ class FormViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\ViewHel $expectedPrefix = 'tx_someextension_someplugin'; $viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', array('renderChildren', 'renderHiddenIdentityField', 'renderHiddenReferrerFields', 'renderRequestHashField', 'addFormFieldNamesToViewHelperVariableContainer', 'removeFormFieldNamesFromViewHelperVariableContainer', 'renderTrustedPropertiesField'), array(), '', FALSE); $this->mockExtensionService->expects($this->once())->method('getPluginNamespace')->with('SomeExtension', 'SomePlugin')->will($this->returnValue('tx_someextension_someplugin')); - $viewHelper->_set('extensionService', $this->mockExtensionService); + $viewHelper->injectExtensionService($this->mockExtensionService); $this->injectDependenciesIntoViewHelper($viewHelper); $viewHelper->setArguments(array('extensionName' => 'SomeExtension', 'pluginName' => 'SomePlugin')); $this->viewHelperVariableContainer->expects($this->once())->method('add')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'fieldNamePrefix', $expectedPrefix); diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/ViewHelperBaseTestcase.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/ViewHelperBaseTestcase.php index 87c731c842b2889ffbfc3c04f5e06b930b89d60c..640b0bf1991612a158f961f9ecf7025a9012b66a 100644 --- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/ViewHelperBaseTestcase.php +++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/ViewHelperBaseTestcase.php @@ -90,7 +90,7 @@ abstract class ViewHelperBaseTestcase extends \TYPO3\CMS\Extbase\Tests\Unit\Base $this->renderingContext->injectTemplateVariableContainer($this->templateVariableContainer); $this->renderingContext->injectViewHelperVariableContainer($this->viewHelperVariableContainer); $this->renderingContext->setControllerContext($this->controllerContext); - $this->mvcPropertyMapperConfigurationService = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService', array('dummy')); + $this->mvcPropertyMapperConfigurationService = new \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService; } /**