[~FEATURE] Fluid (ViewHelpers): Adjusted AbstractFormViewHelper to be able to namespa...
[Packages/TYPO3.CMS.git] / typo3 / sysext / fluid / Tests / ViewHelpers / BaseViewHelperTest_testcase.php
1 <?php
2
3 /* *
4 * This script belongs to the FLOW3 package "Fluid". *
5 * *
6 * It is free software; you can redistribute it and/or modify it under *
7 * the terms of the GNU General Public License as published by the Free *
8 * Software Foundation, either version 3 of the License, or (at your *
9 * option) any later version. *
10 * *
11 * This script is distributed in the hope that it will be useful, but *
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- *
13 * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
14 * Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with the script. *
18 * If not, see http://www.gnu.org/licenses/gpl.html *
19 * *
20 * The TYPO3 project - inspiring people to share! *
21 * */
22
23 require_once(dirname(__FILE__) . '/ViewHelperBaseTestcase.php');
24 /**
25 * @version $Id: BaseViewHelperTest.php 2813 2009-07-16 14:02:34Z k-fish $
26 */
27 require_once(t3lib_extMgm::extPath('extbase', 'Tests/Base_testcase.php'));
28 class Tx_Fluid_ViewHelpers_BaseViewHelperTest_testcase extends Tx_Fluid_ViewHelpers_ViewHelperBaseTestcase {
29 /**
30 * @test
31 * @author Sebastian Kurf├╝rst <sebastian@typo3.org>
32 */
33 public function renderTakesBaseURIFromControllerContext() {
34 $baseURI = 'http://typo3.org/';
35
36 $this->request = $this->getMock('Tx_Extbase_MVC_Web_Request');
37 $this->request->expects($this->any())->method('getBaseURI')->will($this->returnValue($baseURI));
38
39 $this->controllerContext = $this->getMock('Tx_Extbase_MVC_Controller_ControllerContext');
40 $this->controllerContext->expects($this->any())->method('getRequest')->will($this->returnValue($this->request));
41
42 $viewHelper = new Tx_Fluid_ViewHelpers_BaseViewHelper();
43 $this->injectDependenciesIntoViewHelper($viewHelper);
44
45 $expected = '<base href="http://typo3.org/"></base>';
46 $actual = $viewHelper->render();
47 $this->assertSame($expected, $actual);
48 }
49 }
50 ?>