TYPO3 CMS  TYPO3_8-7
LanguageTest.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 
20 class LanguageTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
21 {
25  protected $subject = null;
26 
30  protected function setUp()
31  {
32  $this->subject = new \TYPO3\CMS\Lang\Domain\Model\Language();
33  }
34 
39  {
40  $this->assertSame(
41  '',
42  $this->subject->getLocale()
43  );
44  }
45 
50  {
51  $locale = 'nl';
52  $this->subject = new \TYPO3\CMS\Lang\Domain\Model\Language($locale);
53 
54  $this->assertSame(
55  $locale,
56  $this->subject->getLocale()
57  );
58  }
59 
63  public function setLocaleSetsLocale()
64  {
65  $locale = 'nl';
66  $this->subject->setLocale($locale);
67 
68  $this->assertSame(
69  $locale,
70  $this->subject->getLocale()
71  );
72  }
73 
78  {
79  $this->assertSame(
80  '',
81  $this->subject->getLabel()
82  );
83  }
84 
89  {
90  $language = 'nl';
91  $this->subject = new \TYPO3\CMS\Lang\Domain\Model\Language('', $language);
92 
93  $this->assertSame(
94  $language,
95  $this->subject->getLabel()
96  );
97  }
98 
102  public function setLanguageSetsLanguage()
103  {
104  $language = 'nl';
105  $this->subject->setLabel($language);
106 
107  $this->assertSame(
108  $language,
109  $this->subject->getLabel()
110  );
111  }
112 
117  {
118  $this->assertSame(
119  false,
120  $this->subject->getSelected()
121  );
122  }
123 
128  {
129  $selected = false;
130  $this->subject = new \TYPO3\CMS\Lang\Domain\Model\Language('', '', false);
131 
132  $this->assertSame(
133  $selected,
134  $this->subject->getSelected()
135  );
136  }
137 
141  public function setSelectedSetsSelected()
142  {
143  $selected = true;
144  $this->subject->setSelected($selected);
145 
146  $this->assertSame(
147  $selected,
148  $this->subject->getSelected()
149  );
150  }
151 }