cf78fc1903ca9d2dfbbb23fc39d31dcf46272985
[Packages/TYPO3.CMS.git] / typo3 / sysext / lang / Tests / Domain / Model / UpdateTranslationFormTest.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\UpdateTranslationForm
30 *
31 * @author Wouter Wolters <typo3@wouterwolters.nl>
32 * @package TYPO3
33 * @subpackage lang
34 */
35 class UpdateTranslationFormTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
36
37 /**
38 * @var \TYPO3\CMS\Lang\Domain\Model\UpdateTranslationForm
39 */
40 protected $fixture = NULL;
41
42 public function setUp() {
43 $this->fixture = new \TYPO3\CMS\Lang\Domain\Model\UpdateTranslationForm();
44 }
45
46 public function tearDown() {
47 unset($this->fixture);
48 }
49
50 /**
51 * @test
52 */
53 public function getSelectedLanguagesInitiallyReturnsEmptyArray() {
54 $this->assertSame(
55 array(),
56 $this->fixture->getSelectedLanguages()
57 );
58 }
59
60 /**
61 * @test
62 */
63 public function setSelectedLanguagesSetsSelectedLanguages() {
64 $languages = array(
65 'nl',
66 'de',
67 );
68 $this->fixture->setSelectedLanguages($languages);
69
70 $this->assertSame(
71 $languages,
72 $this->fixture->getSelectedLanguages()
73 );
74 }
75
76 /**
77 * @test
78 */
79 public function getExtensionsInitiallyReturnsEmptyArray() {
80 $this->assertSame(
81 array(),
82 $this->fixture->getExtensions()
83 );
84 }
85
86 /**
87 * @test
88 */
89 public function setExtensionsSetsExtensions() {
90 $extensions = array(
91 1 => 'about',
92 2 => 'aboutmodules',
93 3 => 'adodb',
94 );
95 $this->fixture->setExtensions($extensions);
96
97 $this->assertSame(
98 $extensions,
99 $this->fixture->getExtensions()
100 );
101 }
102 }
103 ?>