Initial commit
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
namespace FluidTYPO3\Vhs\Tests\Unit\ViewHelpers\Render;
|
||||
|
||||
/*
|
||||
* 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 AsciiViewHelperTest extends AbstractViewHelperTest {
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @dataProvider getTestRenderValues
|
||||
* @param integer $ascii
|
||||
* @param string $expected
|
||||
*/
|
||||
public function testRender($ascii, $expected) {
|
||||
$result = $this->executeViewHelper(array('ascii' => $ascii));
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getTestRenderValues() {
|
||||
return array(
|
||||
array(10, "\n"),
|
||||
array(32, ' '),
|
||||
array(64, '@'),
|
||||
array(array(65, 66, 67), 'ABC'),
|
||||
array(new \ArrayIterator(array(67, 66, 65)), 'CBA')
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
namespace FluidTYPO3\Vhs\Tests\Unit\ViewHelpers\Render;
|
||||
|
||||
/*
|
||||
* 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 CacheViewHelperTest extends AbstractViewHelperTest {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
namespace FluidTYPO3\Vhs\Tests\Unit\ViewHelpers\Render;
|
||||
|
||||
/*
|
||||
* 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 InlineViewHelperTest extends AbstractViewHelperTest {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
namespace FluidTYPO3\Vhs\Tests\Unit\ViewHelpers\Render;
|
||||
|
||||
/*
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* Class RecordViewHelperTest
|
||||
*/
|
||||
class RecordViewHelperTest extends AbstractViewHelperTest {
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function requiresUid() {
|
||||
$record = array('hasnouid' => 1);
|
||||
$mock = $this->getMock($this->getViewHelperClassName(), array('renderRecord'));
|
||||
$mock->expects($this->never())->method('renderRecord');
|
||||
$result = $mock->render($record);
|
||||
$this->assertNull($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function delegatesToRenderRecord() {
|
||||
$record = array('uid' => 1);
|
||||
$mock = $this->getMock($this->getViewHelperClassName(), array('renderRecord'));
|
||||
$mock->expects($this->once())->method('renderRecord')->with($record)->willReturn('rendered');
|
||||
$result = $mock->render($record);
|
||||
$this->assertEquals('rendered', $result);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
namespace FluidTYPO3\Vhs\Tests\Unit\ViewHelpers\Render;
|
||||
|
||||
/*
|
||||
* 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 RequestViewHelperTest extends AbstractViewHelperTest {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
namespace FluidTYPO3\Vhs\Tests\Unit\ViewHelpers\Render;
|
||||
|
||||
/*
|
||||
* 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 TemplateViewHelperTest extends AbstractViewHelperTest {
|
||||
|
||||
public function testRenderThrowsExceptionWithoutTemplatePath() {
|
||||
$this->setExpectedException('TYPO3\\CMS\\Fluid\\View\\Exception\\InvalidTemplateResourceException');
|
||||
$this->executeViewHelper(array('variables' => array()));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
namespace FluidTYPO3\Vhs\Tests\Unit\ViewHelpers\Render;
|
||||
|
||||
/*
|
||||
* 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 UncacheViewHelperTest extends AbstractViewHelperTest {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user