[BUGFIX][EM] Fix failing unit tests 08/19208/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Sat, 23 Mar 2013 11:00:16 +0000 (12:00 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 23 Mar 2013 11:20:10 +0000 (12:20 +0100)
Change-Id: I2a100ba46e4b3c3177848ed554ea74f2d2b8dc52
Fixes: #46588
Related: #46573
Releases: 6.1
Reviewed-on: https://review.typo3.org/19208
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/extensionmanager/Classes/Controller/UpdateFromTerController.php
typo3/sysext/extensionmanager/Tests/Unit/Controller/UpdateFromTerControllerTest.php

index b7114ab..e533d1d 100644 (file)
@@ -109,7 +109,7 @@ class UpdateFromTerController extends \TYPO3\CMS\Extensionmanager\Controller\Abs
                        }
                }
                /** @var $repository \TYPO3\CMS\Extensionmanager\Domain\Model\Repository */
-               $repository = $this->repositoryRepository->findByUid((int)$this->settings['repositoryUid']);
+               $repository = $this->repositoryRepository->findByIdentifier((int)$this->settings['repositoryUid']);
                $this->view->assign('updated', $updated)
                                ->assign('repository', $repository)
                                ->assign('errorMessage', $errorMessage);
index 254a37f..bae3d66 100644 (file)
@@ -31,25 +31,18 @@ namespace TYPO3\CMS\Extensionmanager\Tests\Unit\Controller;
 class UpdateFromTerControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
 
        /**
-        * Enable backup of global and system variables
-        *
-        * @var boolean
-        */
-       protected $backupGlobals = TRUE;
-
-       /**
         * @test
         * @return void
         */
        public function updateExtensionListFromTerCallsUpdateExtListIfExtensionListIsEmpty() {
                $controllerMock = $this->getAccessibleMock('TYPO3\\CMS\\Extensionmanager\\Controller\\UpdateFromTerController', array('dummy'));
-               $repositoryRepositoryMock = $this->getAccessibleMock('TYPO3\\CMS\\Extensionmanager\\Domain\\Repository\\RepositoryRepository', array('findOneByUid'));
+               $repositoryRepositoryMock = $this->getMock('TYPO3\\CMS\\Extensionmanager\\Domain\\Repository\\RepositoryRepository', array('findByIdentifier'));
                $repositoryModelMock = $this->getAccessibleMock('TYPO3\\CMS\\Extensionmanager\\Domain\\Model\\Repository', array('getLastUpdate'));
                $repositoryHelperMock = $this->getAccessibleMock('TYPO3\\CMS\\Extensionmanager\\Utility\\Repository\\Helper', array('updateExtList'));
                $viewMock = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('assign'));
                $requestMock = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Request', array('hasArgument', 'getArgument'));
                $viewMock->expects($this->any())->method('assign')->will($this->returnValue($viewMock));
-               $repositoryRepositoryMock->expects($this->once())->method('findOneByUid')->with(1)->will($this->returnValue($repositoryModelMock));
+               $repositoryRepositoryMock->expects($this->once())->method('findByIdentifier')->with(1)->will($this->returnValue($repositoryModelMock));
                $repositoryHelperMock->expects($this->once())->method('updateExtList');
                $extensionRepositoryMock = $this->getAccessibleMock('TYPO3\\CMS\\Extensionmanager\\Domain\\Repository\\ExtensionRepository');
                $extensionRepositoryMock->expects($this->once())->method('countAll')->will($this->returnValue(0));
@@ -69,13 +62,13 @@ class UpdateFromTerControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTest
         */
        public function updateExtensionListFromTerDoesNotCallsUpdateExtListIfExtensionListIsNotEmpty() {
                $controllerMock = $this->getAccessibleMock('TYPO3\\CMS\\Extensionmanager\\Controller\\UpdateFromTerController', array('dummy'));
-               $repositoryRepositoryMock = $this->getAccessibleMock('TYPO3\\CMS\\Extensionmanager\\Domain\\Repository\\RepositoryRepository', array('findOneByUid'));
+               $repositoryRepositoryMock = $this->getMock('TYPO3\\CMS\\Extensionmanager\\Domain\\Repository\\RepositoryRepository', array('findByIdentifier'));
                $repositoryModelMock = $this->getAccessibleMock('TYPO3\\CMS\\Extensionmanager\\Domain\\Model\\Repository', array('getLastUpdate'));
                $repositoryHelperMock = $this->getAccessibleMock('TYPO3\\CMS\\Extensionmanager\\Utility\\Repository\\Helper', array('updateExtList'));
                $viewMock = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('assign'));
                $requestMock = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Request', array('hasArgument', 'getArgument'));
                $viewMock->expects($this->any())->method('assign')->will($this->returnValue($viewMock));
-               $repositoryRepositoryMock->expects($this->once())->method('findOneByUid')->with(1)->will($this->returnValue($repositoryModelMock));
+               $repositoryRepositoryMock->expects($this->once())->method('findByIdentifier')->with(1)->will($this->returnValue($repositoryModelMock));
                $repositoryHelperMock->expects($this->never())->method('updateExtList');
                $extensionRepositoryMock = $this->getAccessibleMock('TYPO3\\CMS\\Extensionmanager\\Domain\\Repository\\ExtensionRepository');
                $extensionRepositoryMock->expects($this->once())->method('countAll')->will($this->returnValue(100));
@@ -95,13 +88,13 @@ class UpdateFromTerControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTest
         */
        public function updateExtensionListFromTerCallsUpdateExtListIfForceUpdateCheckIsSet() {
                $controllerMock = $this->getAccessibleMock('TYPO3\\CMS\\Extensionmanager\\Controller\\UpdateFromTerController', array('dummy'));
-               $repositoryRepositoryMock = $this->getAccessibleMock('TYPO3\\CMS\\Extensionmanager\\Domain\\Repository\\RepositoryRepository', array('findOneByUid'));
+               $repositoryRepositoryMock = $this->getMock('TYPO3\\CMS\\Extensionmanager\\Domain\\Repository\\RepositoryRepository', array('findByIdentifier'));
                $repositoryModelMock = $this->getAccessibleMock('TYPO3\\CMS\\Extensionmanager\\Domain\\Model\\Repository', array('getLastUpdate'));
                $repositoryHelperMock = $this->getAccessibleMock('TYPO3\\CMS\\Extensionmanager\\Utility\\Repository\\Helper', array('updateExtList'));
                $viewMock = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('assign'));
                $requestMock = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Request', array('hasArgument', 'getArgument'));
                $viewMock->expects($this->any())->method('assign')->will($this->returnValue($viewMock));
-               $repositoryRepositoryMock->expects($this->once())->method('findOneByUid')->with(1)->will($this->returnValue($repositoryModelMock));
+               $repositoryRepositoryMock->expects($this->once())->method('findByIdentifier')->with(1)->will($this->returnValue($repositoryModelMock));
                $repositoryHelperMock->expects($this->once())->method('updateExtList');
                $extensionRepositoryMock = $this->getAccessibleMock('TYPO3\\CMS\\Extensionmanager\\Domain\\Repository\\ExtensionRepository');
                $extensionRepositoryMock->expects($this->once())->method('countAll')->will($this->returnValue(100));