fda3518466446f466151bf3fc756a126491a644d
[Packages/TYPO3.CMS.git] / typo3 / sysext / lang / Tests / Domain / Model / LanguageSelectionFormTest.php
1 <?php
2 namespace TYPO3\CMS\Lang\Tests\Unit\Domain\Model;
3 /***************************************************************
4 * Copyright notice
5 *
6 * (c) 2012 Wouter Wolters <typo3@wouterwolters.nl>
7 * All rights reserved
8 *
9 * This script is part of the TYPO3 project. The TYPO3 project is
10 * free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * The GNU General Public License can be found at
16 * http://www.gnu.org/copyleft/gpl.html.
17 * A copy is found in the textfile GPL.txt and important notices to the license
18 * from the author is found in LICENSE.txt distributed with these scripts.
19 *
20 * This script is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
27
28 /**
29 * Test case for class \TYPO3\CMS\Lang\Domain\Model\LanguageSelectionForm
30 *
31 * @author Wouter Wolters <typo3@wouterwolters.nl>
32 * @package TYPO3
33 * @subpackage lang
34 */
35 class LanguageSelectionFormTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
36
37 /**
38 * @var \TYPO3\CMS\Lang\Domain\Model\LanguageSelectionForm
39 */
40 protected $fixture = NULL;
41
42 public function setUp() {
43 $this->fixture = new \TYPO3\CMS\Lang\Domain\Model\LanguageSelectionForm();
44 }
45
46 public function tearDown() {
47 unset($this->fixture);
48 }
49
50 /**
51 * @test
52 */
53 public function getLocaleInitiallyReturnsEmptyArray() {
54 $this->assertSame(
55 array(),
56 $this->fixture->getLocale()
57 );
58 }
59
60 /**
61 * @test
62 */
63 public function setLocaleSetsLocale() {
64 $locale = array(
65 'nl' => '1',
66 'de' => '0',
67 );
68 $this->fixture->setLocale($locale);
69
70 $this->assertSame(
71 $locale,
72 $this->fixture->getLocale()
73 );
74 }
75 }
76 ?>