[TASK] EXT:lang unit tests
[Packages/TYPO3.CMS.git] / typo3 / sysext / lang / Tests / Unit / Domain / Model / UpdateTranslationFormTest.php
1 <?php
2 namespace TYPO3\CMS\Lang\Tests\Unit\Domain\Model;
3
4 /***************************************************************
5 * Copyright notice
6 *
7 * (c) 2012 Wouter Wolters <typo3@wouterwolters.nl>
8 * All rights reserved
9 *
10 * This script is part of the TYPO3 project. The TYPO3 project is
11 * free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * The GNU General Public License can be found at
17 * http://www.gnu.org/copyleft/gpl.html.
18 * A copy is found in the textfile GPL.txt and important notices to the license
19 * from the author is found in LICENSE.txt distributed with these scripts.
20 *
21 * This script is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * This copyright notice MUST APPEAR in all copies of the script!
27 ***************************************************************/
28
29 /**
30 * Testcase for UpdateTranslationForm
31 *
32 * @author Wouter Wolters <typo3@wouterwolters.nl>
33 * @package TYPO3
34 * @subpackage lang
35 */
36 class UpdateTranslationFormTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
37
38 /**
39 * @var \TYPO3\CMS\Lang\Domain\Model\UpdateTranslationForm
40 */
41 protected $fixture = NULL;
42
43 public function setUp() {
44 $this->fixture = new \TYPO3\CMS\Lang\Domain\Model\UpdateTranslationForm();
45 }
46
47 public function tearDown() {
48 unset($this->fixture);
49 }
50
51 /**
52 * @test
53 */
54 public function getSelectedLanguagesInitiallyReturnsEmptyArray() {
55 $this->assertSame(
56 array(),
57 $this->fixture->getSelectedLanguages()
58 );
59 }
60
61 /**
62 * @test
63 */
64 public function setSelectedLanguagesSetsSelectedLanguages() {
65 $languages = array(
66 'nl',
67 'de',
68 );
69 $this->fixture->setSelectedLanguages($languages);
70
71 $this->assertSame(
72 $languages,
73 $this->fixture->getSelectedLanguages()
74 );
75 }
76
77 /**
78 * @test
79 */
80 public function getExtensionsInitiallyReturnsEmptyArray() {
81 $this->assertSame(
82 array(),
83 $this->fixture->getExtensions()
84 );
85 }
86
87 /**
88 * @test
89 */
90 public function setExtensionsSetsExtensions() {
91 $extensions = array(
92 1 => 'about',
93 2 => 'aboutmodules',
94 3 => 'adodb',
95 );
96 $this->fixture->setExtensions($extensions);
97
98 $this->assertSame(
99 $extensions,
100 $this->fixture->getExtensions()
101 );
102 }
103 }
104 ?>