2 /***************************************************************
5 * (c) 2009 Christian M�ller <christian@kitsunet.de>
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
17 * This script is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * This copyright notice MUST APPEAR in all copies of the script!
23 ***************************************************************/
27 * Testcase for class Tx_Extbase_Utility_TypoScript
33 class Tx_Extbase_Utility_TypoScript_testcase
extends tx_phpunit_testcase
{
38 public function convertTypoScriptArrayToPlainArrayRemovesTrailingDots() {
39 $typoScriptSettings = array(
42 'value' => 'Hello World!',
48 $expectedSettings = array(
50 'value' => 'Hello World!',
54 '_typoScriptNodeValue' => 'TEXT',
57 $processedSettings = Tx_Extbase_Utility_TypoScript
::convertTypoScriptArrayToPlainArray($typoScriptSettings);
59 $this->assertEquals($expectedSettings, $processedSettings);
65 public function convertTypoScriptArrayToPlainArrayRemovesTrailingDotsWithChangedOrderInTheTypoScriptArray() {
66 $typoScriptSettings = array(
68 'value' => 'Hello World!',
73 '10' => 'TEXT', // This line was moved down
75 $expectedSettings = array(
77 'value' => 'Hello World!',
81 '_typoScriptNodeValue' => 'TEXT',
84 $processedSettings = Tx_Extbase_Utility_TypoScript
::convertTypoScriptArrayToPlainArray($typoScriptSettings);
86 $this->assertEquals($expectedSettings, $processedSettings);
92 public function convertPlainArrayToTypoScriptArrayAddsNodeValueAndTrailingDots() {
96 '_typoScriptNodeValue' => 'TEXT'
107 $converted = Tx_Extbase_Utility_TypoScript
::convertPlainArrayToTypoScriptArray($extbaseTS);
109 $this->assertEquals($converted, $classic);