[TASK] Disable scheduler-tests if EXT:scheduler not loaded
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Tests / Unit / Scheduler / TaskExecuterTest.php
index b0febc1..b40e706 100644 (file)
@@ -65,9 +65,12 @@ class TaskExecutorTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        protected $taskExecuter;
 
        public function setUp() {
+               if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('scheduler')) {
+                       $this->markTestSkipped('Tests need EXT:scheduler loaded.');
+               }
                $this->controller = $this->getAccessibleMock('TYPO3\CMS\Extbase\Tests\MockACommandController', array('dummy'));
-               $this->controller->injectReflectionService($this->objectManager->get('TYPO3\CMS\Extbase\Reflection\ReflectionService'));
-               $this->controller->injectObjectManager($this->objectManager);
+               $this->controller->_set('reflectionService', $this->objectManager->get('TYPO3\CMS\Extbase\Reflection\ReflectionService'));
+               $this->controller->_set('objectManager', $this->objectManager);
 
                $command = new \TYPO3\CMS\Extbase\Mvc\Cli\Command('TYPO3\CMS\Extbase\Tests\MockACommandController', 'funcA');
                $nullBackend = new \TYPO3\CMS\Core\Cache\Backend\NullBackend('production');
@@ -98,15 +101,15 @@ class TaskExecutorTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
         * @author Alexander Schnitzler <alex.schnitzler@typovision.de>
         */
        public function executeDispatchesTheRightCommandControllerAndCommandAction() {
-               $dispatcher = $this->getMock('TYPO3\CMS\Extbase\Mvc\Dispatcher', array('resolveController'), array($this->objectManager));
+               $dispatcher = $this->getAccessibleMock('TYPO3\CMS\Extbase\Mvc\Dispatcher', array('resolveController'), array($this->objectManager));
                $dispatcher->expects($this->any())->method('resolveController')->will($this->returnValue($this->controller));
-               $dispatcher->injectSignalSlotDispatcher($this->objectManager->get('TYPO3\CMS\Extbase\SignalSlot\Dispatcher'));
+               $dispatcher->_set('signalSlotDispatcher', $this->objectManager->get('TYPO3\CMS\Extbase\SignalSlot\Dispatcher'));
 
                $this->taskExecuter = $this->getAccessibleMock('TYPO3\CMS\Extbase\Scheduler\TaskExecutor', array('dummy', 'shutdown', 'getDispatcher'));
                $this->taskExecuter->expects($this->any())->method('getDispatcher')->will($this->returnValue($dispatcher));
-               $this->taskExecuter->injectObjectManager($this->objectManager);
-               $this->taskExecuter->injectCommandManager($this->commandManager);
-               $this->taskExecuter->injectConfigurationManager($this->configurationManager);
+               $this->taskExecuter->_set('objectManager', $this->objectManager);
+               $this->taskExecuter->_set('commandManager', $this->commandManager);
+               $this->taskExecuter->_set('configurationManager', $this->configurationManager);
                $this->taskExecuter->initializeObject();
 
                /** @var $task \TYPO3\CMS\Extbase\Scheduler\Task|\PHPUnit_Framework_MockObject_MockObject */