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,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')
);
}
}

View File

@@ -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 {
}

View File

@@ -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 {
}

View File

@@ -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);
}
}

View File

@@ -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 {
}

View File

@@ -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()));
}
}

View File

@@ -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 {
}