TYPO3 CMS  TYPO3_7-6
SpecialLanguagesTest.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
18 
23 {
24  protected function setUp()
25  {
26  parent::setUp();
27  $this->backendUser->workspace = 0;
28  }
29 
37  public function allowedLanguagesAreAssignedToBackendUserGroup($value, $expected)
38  {
39  $this->actionService->createNewRecord('be_groups', 0, [
40  'title' => 'Testing Group',
41  'allowed_languages' => $value,
42  ]);
43 
44  $row = $this->getDatabaseConnection()
45  ->exec_SELECTgetSingleRow(
46  'allowed_languages',
47  'be_groups',
48  'uid=1'
49  );
50  $this->assertEquals($expected, $row['allowed_languages']);
51  }
52 
57  {
58  return [
59  'valid languages' => ['1,2', '1,2'],
60  'default language' => ['0', '0'],
61  'empty value' => ['', ''],
62  'invalid integer' => ['not-an-integer', ''],
63  ];
64  }
65 }