Initial commit

This commit is contained in:
2018-04-02 08:07:38 +02:00
commit 7330c1ed3e
2054 changed files with 405203 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
<?php
namespace FluidTYPO3\Vhs\Tests\Unit\ViewHelpers\Uri;
/*
* This file is part of the FluidTYPO3/Vhs project under GPLv2 or later.
*
* For the full copyright and license information, please read the
* LICENSE.md file that was distributed with this source code.
*/
use FluidTYPO3\Vhs\Tests\Unit\ViewHelpers\AbstractViewHelperTest;
/**
* @protection off
* @author Juan Manuel Vergés Solanas <juanmanuel@vergessolanas.es>
* @package Vhs
* @subpackage ViewHelpers\Uri
*/
class GravatarViewHelperTest extends AbstractViewHelperTest {
/**
* @var array
*/
protected $arguments = array(
'email' => 'juanmanuel.vergessolanas@gmail.com',
'secure' => FALSE,
);
/**
* @test
*/
public function generatesExpectedUriForEmailAddress() {
$expectedSource = 'http://www.gravatar.com/avatar/b1b0eddcbc4468db89f355ebb9cc3007';
$this->assertSame($expectedSource, $this->executeViewHelper($this->arguments));
$expectedSource = 'https://secure.gravatar.com/avatar/b1b0eddcbc4468db89f355ebb9cc3007?s=160&d=404&r=pg';
$this->arguments = array(
'email' => 'juanmanuel.vergessolanas@gmail.com',
'size' => 160,
'imageSet' => '404',
'maximumRating' => 'pg',
'secure' => TRUE,
);
$this->assertSame($expectedSource, $this->executeViewHelper($this->arguments));
}
}

View File

@@ -0,0 +1,31 @@
<?php
namespace FluidTYPO3\Vhs\Tests\Unit\ViewHelpers\Uri;
/*
* This file is part of the FluidTYPO3/Vhs project under GPLv2 or later.
*
* For the full copyright and license information, please read the
* LICENSE.md file that was distributed with this source code.
*/
use FluidTYPO3\Vhs\Tests\Unit\ViewHelpers\AbstractViewHelperTest;
/**
* @protection off
* @author Claus Due <claus@namelesscoder.net>
* @package Vhs
*/
class ImageViewHelperTest extends AbstractViewHelperTest {
/**
* @test
*/
public function callsExpectedMethodSequence() {
$mock = $this->getMock($this->getViewHelperClassName(), array('preprocessImage', 'preprocessSourceUri'));
$mock->expects($this->at(0))->method('preprocessImage');
$mock->expects($this->at(1))->method('preprocessSourceUri')->will($this->returnValue('foobar'));
$result = $this->callInaccessibleMethod($mock, 'render');
$this->assertEquals('foobar', $result);
}
}

View File

@@ -0,0 +1,29 @@
<?php
namespace FluidTYPO3\Vhs\Tests\Unit\ViewHelpers\Uri;
/*
* This file is part of the FluidTYPO3/Vhs project under GPLv2 or later.
*
* For the full copyright and license information, please read the
* LICENSE.md file that was distributed with this source code.
*/
use FluidTYPO3\Vhs\Tests\Unit\ViewHelpers\AbstractViewHelperTest;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* @protection off
* @author Claus Due <claus@namelesscoder.net>
* @package Vhs
*/
class RequestViewHelperTest extends AbstractViewHelperTest {
/**
* @test
*/
public function rendersUrl() {
$test = $this->executeViewHelper();
$this->assertSame(GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'), $test);
}
}

View File

@@ -0,0 +1,34 @@
<?php
namespace FluidTYPO3\Vhs\Tests\Unit\ViewHelpers\Uri;
/*
* This file is part of the FluidTYPO3/Vhs project under GPLv2 or later.
*
* For the full copyright and license information, please read the
* LICENSE.md file that was distributed with this source code.
*/
use FluidTYPO3\Vhs\Tests\Unit\ViewHelpers\AbstractViewHelperTest;
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
/**
* @protection on
* @package Vhs
*/
class TypolinkViewHelperTest extends AbstractViewHelperTest {
/**
* @test
*/
public function renderCallsTypoLinkFunctionOnContentObject() {
$class = $this->getViewHelperClassName();
$mock = new $class();
$mock->setArguments(array('configuration' => array('foo' => 'bar')));
$GLOBALS['TSFE'] = new TypoScriptFrontendController(array(), 1, 0);
$GLOBALS['TSFE']->cObj = $this->getMock('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer', array('typoLink_URL'));
$GLOBALS['TSFE']->cObj->expects($this->once())->method('typoLink_URL')->with(array('foo' => 'bar'))->will($this->returnValue('foobar'));
$result = $this->callInaccessibleMethod($mock, 'render');
$this->assertEquals('foobar', $result);
}
}