‪TYPO3CMS  10.4
SpecialLanguagesTest.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 
21 
26 {
27  protected function ‪setUp(): void
28  {
29  parent::setUp();
30  $this->backendUser->workspace = 0;
31  }
32 
40  public function ‪allowedLanguagesAreAssignedToBackendUserGroup($value, $expected)
41  {
42  $this->actionService->createNewRecord('be_groups', 0, [
43  'title' => 'Testing Group',
44  'allowed_languages' => $value,
45  ]);
46 
47  $statement = $this->getConnectionPool()
48  ->getQueryBuilderForTable('be_groups')
49  ->select('allowed_languages')
50  ->from('be_groups')
51  ->orderBy('uid', 'DESC')
52  ->setMaxResults(1)
53  ->execute();
54  self::assertEquals($expected, $statement->fetchColumn(0));
55  }
56 
61  {
62  return [
63  'valid languages' => ['1,2', '1,2'],
64  'default language' => ['0', '0'],
65  'empty value' => ['', ''],
66  'invalid integer' => ['not-an-integer', ''],
67  ];
68  }
69 }
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\DataHandler
Definition: DefaultValuesTest.php:18
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase
Definition: AbstractDataHandlerActionTestCase.php:37
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\DataHandler\SpecialLanguagesTest\allowedLanguagesAreAssignedToBackendUserGroup
‪allowedLanguagesAreAssignedToBackendUserGroup($value, $expected)
Definition: SpecialLanguagesTest.php:40
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\DataHandler\SpecialLanguagesTest\setUp
‪setUp()
Definition: SpecialLanguagesTest.php:27
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\DataHandler\SpecialLanguagesTest\allowedLanguagesAreAssignedToBackendUserGroupDataProvider
‪array allowedLanguagesAreAssignedToBackendUserGroupDataProvider()
Definition: SpecialLanguagesTest.php:60
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\DataHandler\SpecialLanguagesTest
Definition: SpecialLanguagesTest.php:26