TYPO3 CMS  TYPO3_6-2
CommandUtilityTest.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
17 
22 
28  public function getConfiguredAppsDataProvider() {
29  $defaultExpected = array(
30  'perl' => array(
31  'app' => 'perl',
32  'path' => '/usr/bin/',
33  'valid' => TRUE
34  ),
35  'unzip' => array(
36  'app' => 'unzip',
37  'path' => '/usr/local/bin/',
38  'valid' => TRUE
39  ),
40  );
41  return array(
42  'returns empty array for empty string' => array(
43  '',
44  array()
45  ),
46  'separated by comma' => array(
47  'perl=/usr/bin/perl,unzip=/usr/local/bin/unzip',
48  $defaultExpected
49  ),
50  'separated by new line' => array(
51  'perl=/usr/bin/perl ' . LF . ' unzip=/usr/local/bin/unzip',
52  $defaultExpected
53  ),
54  'separated by new line with spaces' => array(
55  'perl = /usr/bin/perl ' . LF . ' unzip = /usr/local/bin/unzip',
56  $defaultExpected
57  ),
58  'separated by new line with spaces and empty rows' => array(
59  LF . 'perl = /usr/bin/perl ' . LF . LF . ' unzip = /usr/local/bin/unzip' . LF,
60  $defaultExpected
61  ),
62  'separated by char(10)' => array(
63  'perl=/usr/bin/perl' . '\'.chr(10).\'' . 'unzip=/usr/local/bin/unzip',
64  $defaultExpected
65  ),
66  'separated by LF as string' => array(
67  'perl=/usr/bin/perl' . '\' . LF . \'' . 'unzip=/usr/local/bin/unzip',
68  $defaultExpected
69  )
70  );
71  }
72 
79  public function getConfiguredApps($globalsBinSetup, $expected) {
80  $GLOBALS['TYPO3_CONF_VARS']['SYS']['binSetup'] = $globalsBinSetup;
81  $commandUtilityMock = $this->getAccessibleMock('TYPO3\\CMS\\Core\\Utility\\CommandUtility', array('dummy'));
82  $result = $commandUtilityMock->_call('getConfiguredApps');
83  $this->assertSame($expected, $result);
84  }
85 
86 }
getAccessibleMock( $originalClassName, array $methods=array(), array $arguments=array(), $mockClassName='', $callOriginalConstructor=TRUE, $callOriginalClone=TRUE, $callAutoload=TRUE)
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren&#39;t numeric.
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]