TYPO3 CMS  TYPO3_8-7
SpecialLanguagesTest.php
Go to the documentation of this file.
1 <?php
2 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 {
25  protected function setUp()
26  {
27  parent::setUp();
28  $this->backendUser->workspace = 0;
29  }
30 
38  public function allowedLanguagesAreAssignedToBackendUserGroup($value, $expected)
39  {
40  $this->actionService->createNewRecord('be_groups', 0, [
41  'title' => 'Testing Group',
42  'allowed_languages' => $value,
43  ]);
44 
45  $statement = $this->getConnectionPool()
46  ->getQueryBuilderForTable('be_groups')
47  ->select('allowed_languages')
48  ->from('be_groups')
49  ->orderBy('uid', 'DESC')
50  ->setMaxResults(1)
51  ->execute();
52  $this->assertEquals($expected, $statement->fetchColumn(0));
53  }
54 
59  {
60  return [
61  'valid languages' => ['1,2', '1,2'],
62  'default language' => ['0', '0'],
63  'empty value' => ['', ''],
64  'invalid integer' => ['not-an-integer', ''],
65  ];
66  }
67 }