Initial commit
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user