TYPO3 CMS  TYPO3_6-2
AbstractPluginTest.php
Go to the documentation of this file.
1 <?php
3 
22 
26  protected $abstractPlugin;
27 
31  protected $defaultPiVars;
32 
36  public function setUp() {
37  parent::setUp();
38 
39  // Allow objects until 100 levels deep when executing the stdWrap
40  $GLOBALS['TSFE'] = new \stdClass();
41  $GLOBALS['TSFE']->cObjectDepthCounter = 100;
42 
43  $this->abstractPlugin = new \TYPO3\CMS\Frontend\Plugin\AbstractPlugin();
44  $this->abstractPlugin->cObj = new \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer();
45  $this->defaultPiVars = $this->abstractPlugin->piVars;
46  }
47 
54  return array(
55  'stdWrap on conf, non-recursive, stdWrap 1 level deep' => array(
56  array(
57  'abc' => 'DEF',
58  'abc.' => array(
59  'stdWrap.' => array(
60  'wrap' => 'test | test'
61  ),
62  ),
63  ),
64  array(
65  'abc' => 'testDEFtest',
66  'pointer' => '',
67  'mode' => '',
68  'sword' => '',
69  'sort' => '',
70  ),
71  ),
72  'stdWrap on conf, non-recursive, stdWrap 2 levels deep' => array(
73  array(
74  'xyz.' => array(
75  'stdWrap.' => array(
76  'cObject' => 'TEXT',
77  'cObject.' => array(
78  'data' => 'date:U',
79  'strftime' => '%Y',
80  ),
81  ),
82  ),
83  ),
84  array(
85  'xyz' => date('Y'),
86  'pointer' => '',
87  'mode' => '',
88  'sword' => '',
89  'sort' => '',
90  ),
91  ),
92  'stdWrap on conf, recursive' => array(
93  array(
94  'abc.' => array(
95  'def' => 'DEF',
96  'def.' => array(
97  'ghi' => '123',
98  'stdWrap.' => array(
99  'wrap' => 'test | test'
100  ),
101  ),
102  ),
103  ),
104  array(
105  'abc.' => array(
106  'def' => 'testDEFtest',
107  'def.' => array(
108  'ghi' => '123',
109  ),
110  ),
111  'pointer' => '',
112  'mode' => '',
113  'sword' => '',
114  'sort' => '',
115  ),
116  ),
117  );
118  }
119 
124  public function piSetPiVarDefaultsStdWrap($input, $expected) {
125  $this->abstractPlugin->piVars = $this->defaultPiVars;
126 
127  $this->abstractPlugin->conf['_DEFAULT_PI_VARS.'] = $input;
128  $this->abstractPlugin->pi_setPiVarDefaults();
129  $this->assertEquals($expected, $this->abstractPlugin->piVars);
130  }
131 
132 }
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]