TYPO3 API  SVNRelease
LocalizationTest.php
Go to the documentation of this file.
00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 2011 Extbase Team
00006 *  All rights reserved
00007 *
00008 *  This script is part of the TYPO3 project. The TYPO3 project is
00009 *  free software; you can redistribute it and/or modify
00010 *  it under the terms of the GNU General Public License as published by
00011 *  the Free Software Foundation; either version 2 of the License, or
00012 *  (at your option) any later version.
00013 *
00014 *  The GNU General Public License can be found at
00015 *  http://www.gnu.org/copyleft/gpl.html.
00016 *
00017 *  This script is distributed in the hope that it will be useful,
00018 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00019 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020 *  GNU General Public License for more details.
00021 *
00022 *  This copyright notice MUST APPEAR in all copies of the script!
00023 ***************************************************************/
00024 
00025 /**
00026  * Testcase for class Tx_Extbase_Utility_Localization
00027  *
00028  * @package Extbase
00029  * @subpackage Utility
00030  */
00031 class Tx_Extbase_Tests_Unit_Utility_LocalizationTest extends Tx_Extbase_BaseTestCase {
00032 
00033     /**
00034      * @var Tx_Extbase_Utility_Localization
00035      */
00036     protected $localization;
00037 
00038     public function setUp() {
00039         $this->localization = $this->getAccessibleMock('Tx_Extbase_Utility_Localization', array('dummy'));
00040     }
00041 
00042     public function tearDown() {
00043         $this->localization = NULL;
00044     }
00045 
00046     /**
00047      * @test
00048      * @author Sebastian Kurfürst <sebastian@typo3.org>
00049      */
00050     public function implodeTypoScriptLabelArrayWorks() {
00051         $expected = array(
00052             'key1' => 'value1',
00053             'key2' => 'value2',
00054             'key3.subkey1' => 'subvalue1',
00055             'key3.subkey2.subsubkey' => 'val'
00056         );
00057         $actual = $this->localization->_call('flattenTypoScriptLabelArray', array(
00058             'key1' => 'value1',
00059             'key2' => 'value2',
00060             'key3' => array(
00061                 'subkey1' => 'subvalue1',
00062                 'subkey2' => array(
00063                     'subsubkey' => 'val'
00064                 )
00065             )
00066         ));
00067         $this->assertEquals($expected, $actual);
00068     }
00069 }
00070 ?>