[TASK] EXT:lang unit tests
authorChristian Kuhn <lolli@schwarzbu.ch>
Wed, 19 Sep 2012 19:32:03 +0000 (21:32 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 19 Sep 2012 19:37:52 +0000 (21:37 +0200)
* Minor test cleanups
* Activate in travis testsuite

Change-Id: I6eccff9a35198479e0932779b261f2ec364e0393
Resolves: #41080
Releases: 6.0
Reviewed-on: http://review.typo3.org/14741
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/core/Build/UnitTests.xml
typo3/sysext/lang/Tests/Domain/Model/ExtensionTest.php [deleted file]
typo3/sysext/lang/Tests/Domain/Model/LanguageSelectionFormTest.php [deleted file]
typo3/sysext/lang/Tests/Domain/Model/LanguageTest.php [deleted file]
typo3/sysext/lang/Tests/Domain/Model/UpdateTranslationFormTest.php [deleted file]
typo3/sysext/lang/Tests/Unit/Domain/Model/ExtensionTest.php [new file with mode: 0644]
typo3/sysext/lang/Tests/Unit/Domain/Model/LanguageSelectionFormTest.php [new file with mode: 0644]
typo3/sysext/lang/Tests/Unit/Domain/Model/LanguageTest.php [new file with mode: 0644]
typo3/sysext/lang/Tests/Unit/Domain/Model/UpdateTranslationFormTest.php [new file with mode: 0644]

index ce8154b..cade77f 100644 (file)
@@ -49,6 +49,9 @@
                <testsuite name="EXT:indexed_search tests">
                        <directory>../../../../typo3/sysext/indexed_search/Tests/Unit/</directory>
                </testsuite>
+               <testsuite name="EXT:lang tests">
+                       <directory>../../../../typo3/sysext/lang/Tests/Unit/</directory>
+               </testsuite>
                <testsuite name="EXT:scheduler tests">
                        <directory>../../../../typo3/sysext/scheduler/Tests/Unit/</directory>
                </testsuite>
diff --git a/typo3/sysext/lang/Tests/Domain/Model/ExtensionTest.php b/typo3/sysext/lang/Tests/Domain/Model/ExtensionTest.php
deleted file mode 100644 (file)
index d662e4b..0000000
+++ /dev/null
@@ -1,224 +0,0 @@
-<?php\r
-namespace TYPO3\CMS\Lang\Tests\Unit\Domain\Model;\r
-/***************************************************************\r
- *  Copyright notice\r
- *\r
- *  (c) 2012 Wouter Wolters <typo3@wouterwolters.nl>\r
- *  All rights reserved\r
- *\r
- *  This script is part of the TYPO3 project. The TYPO3 project is\r
- *  free software; you can redistribute it and/or modify\r
- *  it under the terms of the GNU General Public License as published by\r
- *  the Free Software Foundation; either version 2 of the License, or\r
- *  (at your option) any later version.\r
- *\r
- *  The GNU General Public License can be found at\r
- *  http://www.gnu.org/copyleft/gpl.html.\r
- *  A copy is found in the textfile GPL.txt and important notices to the license\r
- *  from the author is found in LICENSE.txt distributed with these scripts.\r
- *\r
- *  This script is distributed in the hope that it will be useful,\r
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- *  GNU General Public License for more details.\r
- *\r
- *  This copyright notice MUST APPEAR in all copies of the script!\r
- ***************************************************************/\r
-\r
-/**\r
- * Test case for class \TYPO3\CMS\Lang\Domain\Model\Extension\r
- *\r
- * @author Wouter Wolters <typo3@wouterwolters.nl>\r
- * @package TYPO3\r
- * @subpackage lang\r
- */\r
-class ExtensionTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {\r
-\r
-       /**\r
-        * @var \TYPO3\CMS\Lang\Domain\Model\Extension\r
-        */\r
-       protected $fixture = NULL;\r
-\r
-       public function setUp() {\r
-               $this->fixture = new \TYPO3\CMS\Lang\Domain\Model\Extension();\r
-       }\r
-\r
-       public function tearDown() {\r
-               unset($this->fixture);\r
-       }\r
-\r
-       /**\r
-        * @test\r
-        */\r
-       public function getKeyInitiallyReturnsEmptyString() {\r
-               $this->assertSame(\r
-                       '',\r
-                       $this->fixture->getKey()\r
-               );\r
-       }\r
-\r
-       /**\r
-        * @test\r
-        */\r
-       public function getKeyInitiallyReturnsGivenKeyFromConstruct() {\r
-               $key = 'foo bar';\r
-               $this->fixture = new \TYPO3\CMS\Lang\Domain\Model\Extension($key);\r
-\r
-               $this->assertSame(\r
-                       $key,\r
-                       $this->fixture->getKey()\r
-               );\r
-       }\r
-\r
-       /**\r
-        * @test\r
-        */\r
-       public function setKeySetsKey() {\r
-               $key = 'foo bar';\r
-               $this->fixture->setKey($key);\r
-\r
-               $this->assertSame(\r
-                       $key,\r
-                       $this->fixture->getKey()\r
-               );\r
-       }\r
-\r
-       /**\r
-        * @test\r
-        */\r
-       public function getTitleInitiallyReturnsEmptyString() {\r
-               $this->assertSame(\r
-                       '',\r
-                       $this->fixture->getTitle()\r
-               );\r
-       }\r
-\r
-       /**\r
-        * @test\r
-        */\r
-       public function getTitleInitiallyReturnsGivenTitleFromConstruct() {\r
-               $title = 'foo bar';\r
-               $this->fixture = new \TYPO3\CMS\Lang\Domain\Model\Extension('', $title);\r
-\r
-               $this->assertSame(\r
-                       $title,\r
-                       $this->fixture->getTitle()\r
-               );\r
-       }\r
-\r
-       /**\r
-        * @test\r
-        */\r
-       public function setTitleSetsTitle() {\r
-               $title = 'foo bar';\r
-               $this->fixture->setTitle($title);\r
-\r
-               $this->assertSame(\r
-                       $title,\r
-                       $this->fixture->getTitle()\r
-               );\r
-       }\r
-\r
-       /**\r
-        * @test\r
-        */\r
-       public function getIconInitiallyReturnsEmptyString() {\r
-               $this->assertSame(\r
-                       '',\r
-                       $this->fixture->getIcon()\r
-               );\r
-       }\r
-\r
-       /**\r
-        * @test\r
-        */\r
-       public function getIconInitiallyReturnsGivenIconFromConstruct() {\r
-               $icon = 'foo bar';\r
-               $this->fixture = new \TYPO3\CMS\Lang\Domain\Model\Extension('', '', $icon);\r
-\r
-               $this->assertSame(\r
-                       $icon,\r
-                       $this->fixture->getIcon()\r
-               );\r
-       }\r
-\r
-       /**\r
-        * @test\r
-        */\r
-       public function setIconSetsIcon() {\r
-               $icon = 'foo bar';\r
-               $this->fixture->setIcon($icon);\r
-\r
-               $this->assertSame(\r
-                       $icon,\r
-                       $this->fixture->getIcon()\r
-               );\r
-       }\r
-\r
-       /**\r
-        * @test\r
-        */\r
-       public function getVersionInitiallyReturnsEmptyString() {\r
-               $this->assertSame(\r
-                       '',\r
-                       $this->fixture->getVersion()\r
-               );\r
-       }\r
-\r
-       /**\r
-        * @test\r
-        */\r
-       public function setVersionSetsVersion() {\r
-               $version = 10;\r
-               $this->fixture->setVersion($version);\r
-\r
-               $this->assertSame(\r
-                       $version,\r
-                       $this->fixture->getVersion()\r
-               );\r
-       }\r
-\r
-       /**\r
-        * @test\r
-        */\r
-       public function setVersionSetsVersionFromString() {\r
-               $version = 4012003;\r
-               $this->fixture->setVersionFromString('4.12.3');\r
-\r
-               $this->assertSame(\r
-                       $version,\r
-                       $this->fixture->getVersion()\r
-               );\r
-       }\r
-\r
-       /**\r
-        * @test\r
-        */\r
-       public function getUpdateResultInitiallyReturnsEmptyArray() {\r
-               $this->assertSame(\r
-                       array(),\r
-                       $this->fixture->getUpdateResult()\r
-               );\r
-       }\r
-\r
-       /**\r
-        * @test\r
-        */\r
-       public function setUpdateResultSetsUpdateResult() {\r
-               $updateResult = array(\r
-                       'nl' => array(\r
-                               'icon' => '<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-info">&nbsp;</span>',\r
-                               'message' => 'translation_n_a'\r
-                       ),\r
-               );\r
-\r
-               $this->fixture->setUpdateResult($updateResult);\r
-\r
-               $this->assertSame(\r
-                       $updateResult,\r
-                       $this->fixture->getUpdateResult()\r
-               );\r
-       }\r
-\r
-}\r
-?>
\ No newline at end of file
diff --git a/typo3/sysext/lang/Tests/Domain/Model/LanguageSelectionFormTest.php b/typo3/sysext/lang/Tests/Domain/Model/LanguageSelectionFormTest.php
deleted file mode 100644 (file)
index fda3518..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-<?php\r
-namespace TYPO3\CMS\Lang\Tests\Unit\Domain\Model;\r
-/***************************************************************\r
- *  Copyright notice\r
- *\r
- *  (c) 2012 Wouter Wolters <typo3@wouterwolters.nl>\r
- *  All rights reserved\r
- *\r
- *  This script is part of the TYPO3 project. The TYPO3 project is\r
- *  free software; you can redistribute it and/or modify\r
- *  it under the terms of the GNU General Public License as published by\r
- *  the Free Software Foundation; either version 2 of the License, or\r
- *  (at your option) any later version.\r
- *\r
- *  The GNU General Public License can be found at\r
- *  http://www.gnu.org/copyleft/gpl.html.\r
- *  A copy is found in the textfile GPL.txt and important notices to the license\r
- *  from the author is found in LICENSE.txt distributed with these scripts.\r
- *\r
- *  This script is distributed in the hope that it will be useful,\r
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- *  GNU General Public License for more details.\r
- *\r
- *  This copyright notice MUST APPEAR in all copies of the script!\r
- ***************************************************************/\r
-\r
-/**\r
- * Test case for class \TYPO3\CMS\Lang\Domain\Model\LanguageSelectionForm\r
- *\r
- * @author Wouter Wolters <typo3@wouterwolters.nl>\r
- * @package TYPO3\r
- * @subpackage lang\r
- */\r
-class LanguageSelectionFormTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {\r
-\r
-       /**\r
-        * @var \TYPO3\CMS\Lang\Domain\Model\LanguageSelectionForm\r
-        */\r
-       protected $fixture = NULL;\r
-\r
-       public function setUp() {\r
-               $this->fixture = new \TYPO3\CMS\Lang\Domain\Model\LanguageSelectionForm();\r
-       }\r
-\r
-       public function tearDown() {\r
-               unset($this->fixture);\r
-       }\r
-\r
-       /**\r
-        * @test\r
-        */\r
-       public function getLocaleInitiallyReturnsEmptyArray() {\r
-               $this->assertSame(\r
-                       array(),\r
-                       $this->fixture->getLocale()\r
-               );\r
-       }\r
-\r
-       /**\r
-        * @test\r
-        */\r
-       public function setLocaleSetsLocale() {\r
-               $locale = array(\r
-                       'nl' => '1',\r
-                       'de' => '0',\r
-               );\r
-               $this->fixture->setLocale($locale);\r
-\r
-               $this->assertSame(\r
-                       $locale,\r
-                       $this->fixture->getLocale()\r
-               );\r
-       }\r
-}\r
-?>
\ No newline at end of file
diff --git a/typo3/sysext/lang/Tests/Domain/Model/LanguageTest.php b/typo3/sysext/lang/Tests/Domain/Model/LanguageTest.php
deleted file mode 100644 (file)
index 19be416..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-<?php\r
-namespace TYPO3\CMS\Lang\Tests\Unit\Domain\Model;\r
-/***************************************************************\r
- *  Copyright notice\r
- *\r
- *  (c) 2012 Wouter Wolters <typo3@wouterwolters.nl>\r
- *  All rights reserved\r
- *\r
- *  This script is part of the TYPO3 project. The TYPO3 project is\r
- *  free software; you can redistribute it and/or modify\r
- *  it under the terms of the GNU General Public License as published by\r
- *  the Free Software Foundation; either version 2 of the License, or\r
- *  (at your option) any later version.\r
- *\r
- *  The GNU General Public License can be found at\r
- *  http://www.gnu.org/copyleft/gpl.html.\r
- *  A copy is found in the textfile GPL.txt and important notices to the license\r
- *  from the author is found in LICENSE.txt distributed with these scripts.\r
- *\r
- *  This script is distributed in the hope that it will be useful,\r
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- *  GNU General Public License for more details.\r
- *\r
- *  This copyright notice MUST APPEAR in all copies of the script!\r
- ***************************************************************/\r
-\r
-/**\r
- * Test case for class \TYPO3\CMS\Lang\Domain\Model\Language\r
- *\r
- * @author Wouter Wolters <typo3@wouterwolters.nl>\r
- * @package TYPO3\r
- * @subpackage lang\r
- */\r
-class LanguageTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {\r
-\r
-       /**\r
-        * @var \TYPO3\CMS\Lang\Domain\Model\Language\r
-        */\r
-       protected $fixture = NULL;\r
-\r
-       public function setUp() {\r
-               $this->fixture = new \TYPO3\CMS\Lang\Domain\Model\Language();\r
-       }\r
-\r
-       public function tearDown() {\r
-               unset($this->fixture);\r
-       }\r
-\r
-       /**\r
-        * @test\r
-        */\r
-       public function getLocaleInitiallyReturnsEmptyString() {\r
-               $this->assertSame(\r
-                       '',\r
-                       $this->fixture->getLocale()\r
-               );\r
-       }\r
-\r
-       /**\r
-        * @test\r
-        */\r
-       public function getLocaleInitiallyReturnsGivenLocaleFromConstruct() {\r
-               $locale = 'nl';\r
-               $this->fixture = new \TYPO3\CMS\Lang\Domain\Model\Language($locale);\r
-\r
-               $this->assertSame(\r
-                       $locale,\r
-                       $this->fixture->getLocale()\r
-               );\r
-       }\r
-\r
-       /**\r
-        * @test\r
-        */\r
-       public function setLocaleSetsLocale() {\r
-               $locale = 'nl';\r
-               $this->fixture->setLocale($locale);\r
-\r
-               $this->assertSame(\r
-                       $locale,\r
-                       $this->fixture->getLocale()\r
-               );\r
-       }\r
-\r
-       /**\r
-        * @test\r
-        */\r
-       public function getLanguageInitiallyReturnsEmptyString() {\r
-               $this->assertSame(\r
-                       '',\r
-                       $this->fixture->getLanguage()\r
-               );\r
-       }\r
-\r
-       /**\r
-        * @test\r
-        */\r
-       public function getLanguageInitiallyReturnsGivenLanguageFromConstruct() {\r
-               $language = 'nl';\r
-               $this->fixture = new \TYPO3\CMS\Lang\Domain\Model\Language('', $language);\r
-\r
-               $this->assertSame(\r
-                       $language,\r
-                       $this->fixture->getLanguage()\r
-               );\r
-       }\r
-\r
-       /**\r
-        * @test\r
-        */\r
-       public function setLanguageSetsLanguage() {\r
-               $language = 'nl';\r
-               $this->fixture->setLanguage($language);\r
-\r
-               $this->assertSame(\r
-                       $language,\r
-                       $this->fixture->getLanguage()\r
-               );\r
-       }\r
-\r
-       /**\r
-        * @test\r
-        */\r
-       public function getSelectedInitiallyReturnsFalse() {\r
-               $this->assertSame(\r
-                       FALSE,\r
-                       $this->fixture->getSelected()\r
-               );\r
-       }\r
-\r
-       /**\r
-        * @test\r
-        */\r
-       public function getSelectedInitiallyReturnsGivenSelectedFromConstruct() {\r
-               $selected = FALSE;\r
-               $this->fixture = new \TYPO3\CMS\Lang\Domain\Model\Language('', '', FALSE);\r
-\r
-               $this->assertSame(\r
-                       $selected,\r
-                       $this->fixture->getSelected()\r
-               );\r
-       }\r
-\r
-       /**\r
-        * @test\r
-        */\r
-       public function setSelectedSetsSelected() {\r
-               $selected = TRUE;\r
-               $this->fixture->setSelected($selected);\r
-\r
-               $this->assertSame(\r
-                       $selected,\r
-                       $this->fixture->getSelected()\r
-               );\r
-       }\r
-\r
-}\r
-?>
\ No newline at end of file
diff --git a/typo3/sysext/lang/Tests/Domain/Model/UpdateTranslationFormTest.php b/typo3/sysext/lang/Tests/Domain/Model/UpdateTranslationFormTest.php
deleted file mode 100644 (file)
index cf78fc1..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-<?php\r
-namespace TYPO3\CMS\Lang\Tests\Unit\Domain\Model;\r
-/***************************************************************\r
- *  Copyright notice\r
- *\r
- *  (c) 2012 Wouter Wolters <typo3@wouterwolters.nl>\r
- *  All rights reserved\r
- *\r
- *  This script is part of the TYPO3 project. The TYPO3 project is\r
- *  free software; you can redistribute it and/or modify\r
- *  it under the terms of the GNU General Public License as published by\r
- *  the Free Software Foundation; either version 2 of the License, or\r
- *  (at your option) any later version.\r
- *\r
- *  The GNU General Public License can be found at\r
- *  http://www.gnu.org/copyleft/gpl.html.\r
- *  A copy is found in the textfile GPL.txt and important notices to the license\r
- *  from the author is found in LICENSE.txt distributed with these scripts.\r
- *\r
- *  This script is distributed in the hope that it will be useful,\r
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- *  GNU General Public License for more details.\r
- *\r
- *  This copyright notice MUST APPEAR in all copies of the script!\r
- ***************************************************************/\r
-\r
-/**\r
- * Test case for class \TYPO3\CMS\Lang\Domain\Model\UpdateTranslationForm\r
- *\r
- * @author Wouter Wolters <typo3@wouterwolters.nl>\r
- * @package TYPO3\r
- * @subpackage lang\r
- */\r
-class UpdateTranslationFormTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {\r
-\r
-       /**\r
-        * @var \TYPO3\CMS\Lang\Domain\Model\UpdateTranslationForm\r
-        */\r
-       protected $fixture = NULL;\r
-\r
-       public function setUp() {\r
-               $this->fixture = new \TYPO3\CMS\Lang\Domain\Model\UpdateTranslationForm();\r
-       }\r
-\r
-       public function tearDown() {\r
-               unset($this->fixture);\r
-       }\r
-\r
-       /**\r
-        * @test\r
-        */\r
-       public function getSelectedLanguagesInitiallyReturnsEmptyArray() {\r
-               $this->assertSame(\r
-                       array(),\r
-                       $this->fixture->getSelectedLanguages()\r
-               );\r
-       }\r
-\r
-       /**\r
-        * @test\r
-        */\r
-       public function setSelectedLanguagesSetsSelectedLanguages() {\r
-               $languages = array(\r
-                       'nl',\r
-                       'de',\r
-               );\r
-               $this->fixture->setSelectedLanguages($languages);\r
-\r
-               $this->assertSame(\r
-                       $languages,\r
-                       $this->fixture->getSelectedLanguages()\r
-               );\r
-       }\r
-\r
-       /**\r
-        * @test\r
-        */\r
-       public function getExtensionsInitiallyReturnsEmptyArray() {\r
-               $this->assertSame(\r
-                       array(),\r
-                       $this->fixture->getExtensions()\r
-               );\r
-       }\r
-\r
-       /**\r
-        * @test\r
-        */\r
-       public function setExtensionsSetsExtensions() {\r
-               $extensions = array(\r
-                       1 => 'about',\r
-                       2 => 'aboutmodules',\r
-                       3 => 'adodb',\r
-               );\r
-               $this->fixture->setExtensions($extensions);\r
-\r
-               $this->assertSame(\r
-                       $extensions,\r
-                       $this->fixture->getExtensions()\r
-               );\r
-       }\r
-}\r
-?>
\ No newline at end of file
diff --git a/typo3/sysext/lang/Tests/Unit/Domain/Model/ExtensionTest.php b/typo3/sysext/lang/Tests/Unit/Domain/Model/ExtensionTest.php
new file mode 100644 (file)
index 0000000..5bf7473
--- /dev/null
@@ -0,0 +1,231 @@
+<?php\r
+namespace TYPO3\CMS\Lang\Tests\Unit\Domain\Model;\r
+\r
+/***************************************************************\r
+ *  Copyright notice\r
+ *\r
+ *  (c) 2012 Wouter Wolters <typo3@wouterwolters.nl>\r
+ *  All rights reserved\r
+ *\r
+ *  This script is part of the TYPO3 project. The TYPO3 project is\r
+ *  free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU General Public License as published by\r
+ *  the Free Software Foundation; either version 2 of the License, or\r
+ *  (at your option) any later version.\r
+ *\r
+ *  The GNU General Public License can be found at\r
+ *  http://www.gnu.org/copyleft/gpl.html.\r
+ *  A copy is found in the textfile GPL.txt and important notices to the license\r
+ *  from the author is found in LICENSE.txt distributed with these scripts.\r
+ *\r
+ *  This script is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU General Public License for more details.\r
+ *\r
+ *  This copyright notice MUST APPEAR in all copies of the script!\r
+ ***************************************************************/\r
+\r
+/**\r
+ * Testcase for Extension\r
+ *\r
+ * @author Wouter Wolters <typo3@wouterwolters.nl>\r
+ * @package TYPO3\r
+ * @subpackage lang\r
+ */\r
+class ExtensionTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {\r
+\r
+       /**\r
+        * @var \TYPO3\CMS\Lang\Domain\Model\Extension\r
+        */\r
+       protected $fixture = NULL;\r
+\r
+       /**\r
+        * Set up\r
+        */\r
+       public function setUp() {\r
+               $this->fixture = new \TYPO3\CMS\Lang\Domain\Model\Extension();\r
+       }\r
+\r
+       /**\r
+        * Tear down\r
+        */\r
+       public function tearDown() {\r
+               $this->fixture = NULL;\r
+       }\r
+\r
+       /**\r
+        * @test\r
+        */\r
+       public function getKeyInitiallyReturnsEmptyString() {\r
+               $this->assertSame(\r
+                       '',\r
+                       $this->fixture->getKey()\r
+               );\r
+       }\r
+\r
+       /**\r
+        * @test\r
+        */\r
+       public function getKeyInitiallyReturnsGivenKeyFromConstruct() {\r
+               $key = 'foo bar';\r
+               $this->fixture = new \TYPO3\CMS\Lang\Domain\Model\Extension($key);\r
+\r
+               $this->assertSame(\r
+                       $key,\r
+                       $this->fixture->getKey()\r
+               );\r
+       }\r
+\r
+       /**\r
+        * @test\r
+        */\r
+       public function setKeySetsKey() {\r
+               $key = 'foo bar';\r
+               $this->fixture->setKey($key);\r
+\r
+               $this->assertSame(\r
+                       $key,\r
+                       $this->fixture->getKey()\r
+               );\r
+       }\r
+\r
+       /**\r
+        * @test\r
+        */\r
+       public function getTitleInitiallyReturnsEmptyString() {\r
+               $this->assertSame(\r
+                       '',\r
+                       $this->fixture->getTitle()\r
+               );\r
+       }\r
+\r
+       /**\r
+        * @test\r
+        */\r
+       public function getTitleInitiallyReturnsGivenTitleFromConstruct() {\r
+               $title = 'foo bar';\r
+               $this->fixture = new \TYPO3\CMS\Lang\Domain\Model\Extension('', $title);\r
+\r
+               $this->assertSame(\r
+                       $title,\r
+                       $this->fixture->getTitle()\r
+               );\r
+       }\r
+\r
+       /**\r
+        * @test\r
+        */\r
+       public function setTitleSetsTitle() {\r
+               $title = 'foo bar';\r
+               $this->fixture->setTitle($title);\r
+\r
+               $this->assertSame(\r
+                       $title,\r
+                       $this->fixture->getTitle()\r
+               );\r
+       }\r
+\r
+       /**\r
+        * @test\r
+        */\r
+       public function getIconInitiallyReturnsEmptyString() {\r
+               $this->assertSame(\r
+                       '',\r
+                       $this->fixture->getIcon()\r
+               );\r
+       }\r
+\r
+       /**\r
+        * @test\r
+        */\r
+       public function getIconInitiallyReturnsGivenIconFromConstruct() {\r
+               $icon = 'foo bar';\r
+               $this->fixture = new \TYPO3\CMS\Lang\Domain\Model\Extension('', '', $icon);\r
+\r
+               $this->assertSame(\r
+                       $icon,\r
+                       $this->fixture->getIcon()\r
+               );\r
+       }\r
+\r
+       /**\r
+        * @test\r
+        */\r
+       public function setIconSetsIcon() {\r
+               $icon = 'foo bar';\r
+               $this->fixture->setIcon($icon);\r
+\r
+               $this->assertSame(\r
+                       $icon,\r
+                       $this->fixture->getIcon()\r
+               );\r
+       }\r
+\r
+       /**\r
+        * @test\r
+        */\r
+       public function getVersionInitiallyReturnsEmptyString() {\r
+               $this->assertSame(\r
+                       '',\r
+                       $this->fixture->getVersion()\r
+               );\r
+       }\r
+\r
+       /**\r
+        * @test\r
+        */\r
+       public function setVersionSetsVersion() {\r
+               $version = 10;\r
+               $this->fixture->setVersion($version);\r
+\r
+               $this->assertSame(\r
+                       $version,\r
+                       $this->fixture->getVersion()\r
+               );\r
+       }\r
+\r
+       /**\r
+        * @test\r
+        */\r
+       public function setVersionSetsVersionFromString() {\r
+               $version = 4012003;\r
+               $this->fixture->setVersionFromString('4.12.3');\r
+\r
+               $this->assertSame(\r
+                       $version,\r
+                       $this->fixture->getVersion()\r
+               );\r
+       }\r
+\r
+       /**\r
+        * @test\r
+        */\r
+       public function getUpdateResultInitiallyReturnsEmptyArray() {\r
+               $this->assertSame(\r
+                       array(),\r
+                       $this->fixture->getUpdateResult()\r
+               );\r
+       }\r
+\r
+       /**\r
+        * @test\r
+        */\r
+       public function setUpdateResultSetsUpdateResult() {\r
+               $updateResult = array(\r
+                       'nl' => array(\r
+                               'icon' => '<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-info">&nbsp;</span>',\r
+                               'message' => 'translation_n_a'\r
+                       ),\r
+               );\r
+\r
+               $this->fixture->setUpdateResult($updateResult);\r
+\r
+               $this->assertSame(\r
+                       $updateResult,\r
+                       $this->fixture->getUpdateResult()\r
+               );\r
+       }\r
+\r
+}\r
+?>
\ No newline at end of file
diff --git a/typo3/sysext/lang/Tests/Unit/Domain/Model/LanguageSelectionFormTest.php b/typo3/sysext/lang/Tests/Unit/Domain/Model/LanguageSelectionFormTest.php
new file mode 100644 (file)
index 0000000..42ed443
--- /dev/null
@@ -0,0 +1,108 @@
+<?php\r
+namespace TYPO3\CMS\Lang\Tests\Unit\Domain\Model;\r
+/***************************************************************\r
+ *  Copyright notice\r
+ *\r
+ *  (c) 2012 Wouter Wolters <typo3@wouterwolters.nl>\r
+ *  All rights reserved\r
+ *\r
+ *  This script is part of the TYPO3 project. The TYPO3 project is\r
+ *  free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU General Public License as published by\r
+ *  the Free Software Foundation; either version 2 of the License, or\r
+ *  (at your option) any later version.\r
+ *\r
+ *  The GNU General Public License can be found at\r
+ *  http://www.gnu.org/copyleft/gpl.html.\r
+ *  A copy is found in the textfile GPL.txt and important notices to the license\r
+ *  from the author is found in LICENSE.txt distributed with these scripts.\r
+ *\r
+ *  This script is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU General Public License for more details.\r
+ *\r
+ *  This copyright notice MUST APPEAR in all copies of the script!\r
+ ***************************************************************/\r
+\r
+/**\r
+ * Testcase LanguageSelectionForm\r
+ *\r
+ * @author Wouter Wolters <typo3@wouterwolters.nl>\r
+ * @package TYPO3\r
+ * @subpackage lang\r
+ */\r
+class LanguageSelectionFormTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {\r
+\r
+       /**\r
+        * @var \TYPO3\CMS\Lang\Domain\Model\LanguageSelectionForm\r
+        */\r
+       protected $fixture = NULL;\r
+\r
+       /**\r
+        * Set up\r
+        */\r
+       public function setUp() {\r
+               $this->fixture = new \TYPO3\CMS\Lang\Domain\Model\LanguageSelectionForm();\r
+       }\r
+\r
+       /**\r
+        * Tear down\r
+        */\r
+       public function tearDown() {\r
+               $this->fixture = NULL;\r
+       }\r
+\r
+       /**\r
+        * @test\r
+        */\r
+       public function getLanguagesInitiallyReturnsEmptyArray() {\r
+               $this->assertSame(\r
+                       array(),\r
+                       $this->fixture->getLanguages()\r
+               );\r
+       }\r
+\r
+       /**\r
+        * @test\r
+        */\r
+       public function setLanguagesSetsLanguage() {\r
+               $language = array(\r
+                       'nl' => '1',\r
+                       'de' => '0',\r
+               );\r
+               $this->fixture->setLanguages($language);\r
+\r
+               $this->assertSame(\r
+                       $language,\r
+                       $this->fixture->getLanguages()\r
+               );\r
+       }\r
+\r
+       /**\r
+        * @test\r
+        */\r
+       public function getSelectedLanguagesInitiallyReturnsEmptyArray() {\r
+               $this->assertSame(\r
+                       array(),\r
+                       $this->fixture->getSelectedLanguages()\r
+               );\r
+       }\r
+\r
+       /**\r
+        * @test\r
+        */\r
+       public function setSelectedLanguagesSetsSelectedLanguages() {\r
+               $selectedLanguages = array(\r
+                       'nl' => '1',\r
+                       'de' => '0',\r
+               );\r
+               $this->fixture->setSelectedLanguages($selectedLanguages);\r
+\r
+               $this->assertSame(\r
+                       $selectedLanguages,\r
+                       $this->fixture->getSelectedLanguages()\r
+               );\r
+       }\r
+}\r
+?>
\ No newline at end of file
diff --git a/typo3/sysext/lang/Tests/Unit/Domain/Model/LanguageTest.php b/typo3/sysext/lang/Tests/Unit/Domain/Model/LanguageTest.php
new file mode 100644 (file)
index 0000000..e42c4a8
--- /dev/null
@@ -0,0 +1,166 @@
+<?php\r
+namespace TYPO3\CMS\Lang\Tests\Unit\Domain\Model;\r
+\r
+/***************************************************************\r
+ *  Copyright notice\r
+ *\r
+ *  (c) 2012 Wouter Wolters <typo3@wouterwolters.nl>\r
+ *  All rights reserved\r
+ *\r
+ *  This script is part of the TYPO3 project. The TYPO3 project is\r
+ *  free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU General Public License as published by\r
+ *  the Free Software Foundation; either version 2 of the License, or\r
+ *  (at your option) any later version.\r
+ *\r
+ *  The GNU General Public License can be found at\r
+ *  http://www.gnu.org/copyleft/gpl.html.\r
+ *  A copy is found in the textfile GPL.txt and important notices to the license\r
+ *  from the author is found in LICENSE.txt distributed with these scripts.\r
+ *\r
+ *  This script is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU General Public License for more details.\r
+ *\r
+ *  This copyright notice MUST APPEAR in all copies of the script!\r
+ ***************************************************************/\r
+\r
+/**\r
+ * Testcase for Language\r
+ *\r
+ * @author Wouter Wolters <typo3@wouterwolters.nl>\r
+ * @package TYPO3\r
+ * @subpackage lang\r
+ */\r
+class LanguageTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {\r
+\r
+       /**\r
+        * @var \TYPO3\CMS\Lang\Domain\Model\Language\r
+        */\r
+       protected $fixture = NULL;\r
+\r
+       /**\r
+        * Set up\r
+        */\r
+       public function setUp() {\r
+               $this->fixture = new \TYPO3\CMS\Lang\Domain\Model\Language();\r
+       }\r
+\r
+       /**\r
+        * Tear down\r
+        */\r
+       public function tearDown() {\r
+               $this->fixture = NULL;\r
+       }\r
+\r
+       /**\r
+        * @test\r
+        */\r
+       public function getLocaleInitiallyReturnsEmptyString() {\r
+               $this->assertSame(\r
+                       '',\r
+                       $this->fixture->getLocale()\r
+               );\r
+       }\r
+\r
+       /**\r
+        * @test\r
+        */\r
+       public function getLocaleInitiallyReturnsGivenLocaleFromConstruct() {\r
+               $locale = 'nl';\r
+               $this->fixture = new \TYPO3\CMS\Lang\Domain\Model\Language($locale);\r
+\r
+               $this->assertSame(\r
+                       $locale,\r
+                       $this->fixture->getLocale()\r
+               );\r
+       }\r
+\r
+       /**\r
+        * @test\r
+        */\r
+       public function setLocaleSetsLocale() {\r
+               $locale = 'nl';\r
+               $this->fixture->setLocale($locale);\r
+\r
+               $this->assertSame(\r
+                       $locale,\r
+                       $this->fixture->getLocale()\r
+               );\r
+       }\r
+\r
+       /**\r
+        * @test\r
+        */\r
+       public function getLanguageInitiallyReturnsEmptyString() {\r
+               $this->assertSame(\r
+                       '',\r
+                       $this->fixture->getLanguage()\r
+               );\r
+       }\r
+\r
+       /**\r
+        * @test\r
+        */\r
+       public function getLanguageInitiallyReturnsGivenLanguageFromConstruct() {\r
+               $language = 'nl';\r
+               $this->fixture = new \TYPO3\CMS\Lang\Domain\Model\Language('', $language);\r
+\r
+               $this->assertSame(\r
+                       $language,\r
+                       $this->fixture->getLanguage()\r
+               );\r
+       }\r
+\r
+       /**\r
+        * @test\r
+        */\r
+       public function setLanguageSetsLanguage() {\r
+               $language = 'nl';\r
+               $this->fixture->setLanguage($language);\r
+\r
+               $this->assertSame(\r
+                       $language,\r
+                       $this->fixture->getLanguage()\r
+               );\r
+       }\r
+\r
+       /**\r
+        * @test\r
+        */\r
+       public function getSelectedInitiallyReturnsFalse() {\r
+               $this->assertSame(\r
+                       FALSE,\r
+                       $this->fixture->getSelected()\r
+               );\r
+       }\r
+\r
+       /**\r
+        * @test\r
+        */\r
+       public function getSelectedInitiallyReturnsGivenSelectedFromConstruct() {\r
+               $selected = FALSE;\r
+               $this->fixture = new \TYPO3\CMS\Lang\Domain\Model\Language('', '', FALSE);\r
+\r
+               $this->assertSame(\r
+                       $selected,\r
+                       $this->fixture->getSelected()\r
+               );\r
+       }\r
+\r
+       /**\r
+        * @test\r
+        */\r
+       public function setSelectedSetsSelected() {\r
+               $selected = TRUE;\r
+               $this->fixture->setSelected($selected);\r
+\r
+               $this->assertSame(\r
+                       $selected,\r
+                       $this->fixture->getSelected()\r
+               );\r
+       }\r
+\r
+}\r
+?>
\ No newline at end of file
diff --git a/typo3/sysext/lang/Tests/Unit/Domain/Model/UpdateTranslationFormTest.php b/typo3/sysext/lang/Tests/Unit/Domain/Model/UpdateTranslationFormTest.php
new file mode 100644 (file)
index 0000000..fda5eff
--- /dev/null
@@ -0,0 +1,104 @@
+<?php\r
+namespace TYPO3\CMS\Lang\Tests\Unit\Domain\Model;\r
+\r
+/***************************************************************\r
+ *  Copyright notice\r
+ *\r
+ *  (c) 2012 Wouter Wolters <typo3@wouterwolters.nl>\r
+ *  All rights reserved\r
+ *\r
+ *  This script is part of the TYPO3 project. The TYPO3 project is\r
+ *  free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU General Public License as published by\r
+ *  the Free Software Foundation; either version 2 of the License, or\r
+ *  (at your option) any later version.\r
+ *\r
+ *  The GNU General Public License can be found at\r
+ *  http://www.gnu.org/copyleft/gpl.html.\r
+ *  A copy is found in the textfile GPL.txt and important notices to the license\r
+ *  from the author is found in LICENSE.txt distributed with these scripts.\r
+ *\r
+ *  This script is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU General Public License for more details.\r
+ *\r
+ *  This copyright notice MUST APPEAR in all copies of the script!\r
+ ***************************************************************/\r
+\r
+/**\r
+ * Testcase for UpdateTranslationForm\r
+ *\r
+ * @author Wouter Wolters <typo3@wouterwolters.nl>\r
+ * @package TYPO3\r
+ * @subpackage lang\r
+ */\r
+class UpdateTranslationFormTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {\r
+\r
+       /**\r
+        * @var \TYPO3\CMS\Lang\Domain\Model\UpdateTranslationForm\r
+        */\r
+       protected $fixture = NULL;\r
+\r
+       public function setUp() {\r
+               $this->fixture = new \TYPO3\CMS\Lang\Domain\Model\UpdateTranslationForm();\r
+       }\r
+\r
+       public function tearDown() {\r
+               unset($this->fixture);\r
+       }\r
+\r
+       /**\r
+        * @test\r
+        */\r
+       public function getSelectedLanguagesInitiallyReturnsEmptyArray() {\r
+               $this->assertSame(\r
+                       array(),\r
+                       $this->fixture->getSelectedLanguages()\r
+               );\r
+       }\r
+\r
+       /**\r
+        * @test\r
+        */\r
+       public function setSelectedLanguagesSetsSelectedLanguages() {\r
+               $languages = array(\r
+                       'nl',\r
+                       'de',\r
+               );\r
+               $this->fixture->setSelectedLanguages($languages);\r
+\r
+               $this->assertSame(\r
+                       $languages,\r
+                       $this->fixture->getSelectedLanguages()\r
+               );\r
+       }\r
+\r
+       /**\r
+        * @test\r
+        */\r
+       public function getExtensionsInitiallyReturnsEmptyArray() {\r
+               $this->assertSame(\r
+                       array(),\r
+                       $this->fixture->getExtensions()\r
+               );\r
+       }\r
+\r
+       /**\r
+        * @test\r
+        */\r
+       public function setExtensionsSetsExtensions() {\r
+               $extensions = array(\r
+                       1 => 'about',\r
+                       2 => 'aboutmodules',\r
+                       3 => 'adodb',\r
+               );\r
+               $this->fixture->setExtensions($extensions);\r
+\r
+               $this->assertSame(\r
+                       $extensions,\r
+                       $this->fixture->getExtensions()\r
+               );\r
+       }\r
+}\r
+?>
\ No newline at end of file