[BUGFIX] Ensure Extbase translation tests fulfill expectations 53/57053/2
authorNicole Cordes <typo3@cordes.co>
Fri, 25 May 2018 10:14:15 +0000 (12:14 +0200)
committerNicole Cordes <typo3@cordes.co>
Fri, 25 May 2018 13:16:32 +0000 (15:16 +0200)
Ensure the test is executed as expected.

Resolves: #85082
Releases: master, 8.7
Change-Id: Ia0dfbdc12eeefbb28996f69dade4298b1464afa6
Reviewed-on: https://review.typo3.org/57053
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
typo3/sysext/extbase/Tests/Functional/Persistence/TranslationTest.php

index 0bb2644..dd36a26 100644 (file)
@@ -61,10 +61,10 @@ class TranslationTest extends \TYPO3\TestingFramework\Core\Functional\Functional
         $this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/blogs.xml');
         $this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/translated-posts.xml');
 
         $this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/blogs.xml');
         $this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/translated-posts.xml');
 
+        $this->setUpBasicFrontendEnvironment();
+
         $this->objectManager = GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
         $this->postRepository = $this->objectManager->get(\ExtbaseTeam\BlogExample\Domain\Repository\PostRepository::class);
         $this->objectManager = GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
         $this->postRepository = $this->objectManager->get(\ExtbaseTeam\BlogExample\Domain\Repository\PostRepository::class);
-
-        $this->setUpBasicFrontendEnvironment();
     }
 
     /**
     }
 
     /**
@@ -74,7 +74,7 @@ class TranslationTest extends \TYPO3\TestingFramework\Core\Functional\Functional
     {
         $environmentServiceMock = $this->createMock(\TYPO3\CMS\Extbase\Service\EnvironmentService::class);
         $environmentServiceMock
     {
         $environmentServiceMock = $this->createMock(\TYPO3\CMS\Extbase\Service\EnvironmentService::class);
         $environmentServiceMock
-            ->expects($this->any())
+            ->expects($this->atLeast(1))
             ->method('isEnvironmentInFrontendMode')
             ->willReturn(true);
         GeneralUtility::setSingletonInstance(\TYPO3\CMS\Extbase\Service\EnvironmentService::class, $environmentServiceMock);
             ->method('isEnvironmentInFrontendMode')
             ->willReturn(true);
         GeneralUtility::setSingletonInstance(\TYPO3\CMS\Extbase\Service\EnvironmentService::class, $environmentServiceMock);