TYPO3  7.6
Uri/ExternalViewHelperTest.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Uri;
3 
4 /* *
5  * This script is backported from the TYPO3 Flow package "TYPO3.Fluid". *
6  * *
7  * It is free software; you can redistribute it and/or modify it under *
8  * the terms of the GNU Lesser General Public License, either version 3 *
9  * of the License, or (at your option) any later version. *
10  * *
11  * The TYPO3 project - inspiring people to share! *
12  * */
15 
20 {
24  protected $viewHelper;
25 
26  protected function setUp()
27  {
28  parent::setUp();
29  $this->viewHelper = new ExternalViewHelper();
30  $this->injectDependenciesIntoViewHelper($this->viewHelper);
31  $this->viewHelper->initializeArguments();
32  }
33 
37  public function renderReturnsSpecifiedUri()
38  {
39  $this->viewHelper->initialize();
40  $actualResult = $this->viewHelper->render('http://www.some-domain.tld');
41 
42  $this->assertEquals('http://www.some-domain.tld', $actualResult);
43  }
44 
49  {
50  $this->viewHelper->initialize();
51  $actualResult = $this->viewHelper->render('www.some-domain.tld');
52 
53  $this->assertEquals('http://www.some-domain.tld', $actualResult);
54  }
55 
60  {
61  $this->viewHelper->initialize();
62  $actualResult = $this->viewHelper->render('some-domain.tld', 'ftp');
63 
64  $this->assertEquals('ftp://some-domain.tld', $actualResult);
65  }
66 
70  public function renderDoesNotAddEmptyScheme()
71  {
72  $this->viewHelper->initialize();
73  $actualResult = $this->viewHelper->render('some-domain.tld', '');
74 
75  $this->assertEquals('some-domain.tld', $actualResult);
76  }
77 }