[BUGFIX][EM] TER repository page fails 97/19497/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Mon, 1 Apr 2013 16:13:40 +0000 (18:13 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 1 Apr 2013 16:21:52 +0000 (18:21 +0200)
After the persistence patch in extbase was reverted, em needs an
adaption to make the Repository tab work again.

Change-Id: If88f9c2e52fdeed344955a62568835b3968db5e2
Fixes: #46844
Related: #46837
Releases: 6.1
Reviewed-on: https://review.typo3.org/19497
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/extensionmanager/Classes/Controller/UpdateFromTerController.php
typo3/sysext/extensionmanager/Tests/Unit/Controller/UpdateFromTerControllerTest.php

index e533d1d..b7114ab 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->findByIdentifier((int)$this->settings['repositoryUid']);
+               $repository = $this->repositoryRepository->findByUid((int)$this->settings['repositoryUid']);
                $this->view->assign('updated', $updated)
                                ->assign('repository', $repository)
                                ->assign('errorMessage', $errorMessage);
index bae3d66..6c9c441 100644 (file)
@@ -36,13 +36,13 @@ class UpdateFromTerControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTest
         */
        public function updateExtensionListFromTerCallsUpdateExtListIfExtensionListIsEmpty() {
                $controllerMock = $this->getAccessibleMock('TYPO3\\CMS\\Extensionmanager\\Controller\\UpdateFromTerController', array('dummy'));
-               $repositoryRepositoryMock = $this->getMock('TYPO3\\CMS\\Extensionmanager\\Domain\\Repository\\RepositoryRepository', array('findByIdentifier'));
+               $repositoryRepositoryMock = $this->getMock('TYPO3\\CMS\\Extensionmanager\\Domain\\Repository\\RepositoryRepository', array('findByUid'));
                $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('findByIdentifier')->with(1)->will($this->returnValue($repositoryModelMock));
+               $repositoryRepositoryMock->expects($this->once())->method('findByUid')->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));
@@ -62,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->getMock('TYPO3\\CMS\\Extensionmanager\\Domain\\Repository\\RepositoryRepository', array('findByIdentifier'));
+               $repositoryRepositoryMock = $this->getMock('TYPO3\\CMS\\Extensionmanager\\Domain\\Repository\\RepositoryRepository', array('findByUid'));
                $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('findByIdentifier')->with(1)->will($this->returnValue($repositoryModelMock));
+               $repositoryRepositoryMock->expects($this->once())->method('findByUid')->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));
@@ -88,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->getMock('TYPO3\\CMS\\Extensionmanager\\Domain\\Repository\\RepositoryRepository', array('findByIdentifier'));
+               $repositoryRepositoryMock = $this->getMock('TYPO3\\CMS\\Extensionmanager\\Domain\\Repository\\RepositoryRepository', array('findByUid'));
                $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('findByIdentifier')->with(1)->will($this->returnValue($repositoryModelMock));
+               $repositoryRepositoryMock->expects($this->once())->method('findByUid')->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));