‪TYPO3CMS  10.4
FrontendUserGroupRepositoryTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
24 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
25 
26 class ‪FrontendUserGroupRepositoryTest extends FunctionalTestCase
27 {
31  protected ‪$coreExtensionsToLoad = ['extbase', 'felogin'];
32 
36  protected ‪$repository;
37 
38  protected function ‪setUp(): void
39  {
40  parent::setUp();
41 
42  ‪$GLOBALS['TSFE'] = static::getMockBuilder(TypoScriptFrontendController::class)
43  ->disableOriginalConstructor()
44  ->getMock()
45  ;
46 
47  ‪$GLOBALS['TSFE']->fe_user = new ‪FrontendUserAuthentication();
48 
49  $this->repository = new ‪FrontendUserGroupRepository(
50  new ‪UserService()
51  );
52 
53  $this->importDataSet(__DIR__ . '/../../Fixtures/fe_groups.xml');
54  }
55 
59  public function ‪getTable()
60  {
61  self::assertSame('fe_groups', $this->repository->getTable());
62  }
63 
67  public function ‪findRedirectPageIdByGroupId()
68  {
69  self::assertNull($this->repository->findRedirectPageIdByGroupId(99));
70  self::assertSame(10, $this->repository->findRedirectPageIdByGroupId(1));
71  }
72 }
‪TYPO3\CMS\FrontendLogin\Tests\Functional\Domain\Repository\FrontendUserGroupRepositoryTest\getTable
‪getTable()
Definition: FrontendUserGroupRepositoryTest.php:57
‪TYPO3\CMS\FrontendLogin\Tests\Functional\Domain\Repository\FrontendUserGroupRepositoryTest\setUp
‪setUp()
Definition: FrontendUserGroupRepositoryTest.php:36
‪TYPO3\CMS\FrontendLogin\Tests\Functional\Domain\Repository\FrontendUserGroupRepositoryTest\$coreExtensionsToLoad
‪array $coreExtensionsToLoad
Definition: FrontendUserGroupRepositoryTest.php:30
‪TYPO3\CMS\FrontendLogin\Tests\Functional\Domain\Repository\FrontendUserGroupRepositoryTest\$repository
‪FrontendUserGroupRepository $repository
Definition: FrontendUserGroupRepositoryTest.php:34
‪TYPO3\CMS\FrontendLogin\Service\UserService
Definition: UserService.php:26
‪TYPO3\CMS\FrontendLogin\Tests\Functional\Domain\Repository\FrontendUserGroupRepositoryTest\findRedirectPageIdByGroupId
‪findRedirectPageIdByGroupId()
Definition: FrontendUserGroupRepositoryTest.php:65
‪TYPO3\CMS\FrontendLogin\Tests\Functional\Domain\Repository\FrontendUserGroupRepositoryTest
Definition: FrontendUserGroupRepositoryTest.php:27
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
Definition: TypoScriptFrontendController.php:98
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication
Definition: FrontendUserAuthentication.php:30
‪TYPO3\CMS\FrontendLogin\Tests\Functional\Domain\Repository
Definition: FrontendUserGroupRepositoryTest.php:18
‪TYPO3\CMS\FrontendLogin\Domain\Repository\FrontendUserGroupRepository
Definition: FrontendUserGroupRepository.php:29