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,24 @@
<?php
namespace FluidTYPO3\Vhs\Tests\Unit\ViewHelpers\Resource;
/*
* 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 on
* @author Claus Due <claus@namelesscoder.net>
* @package Vhs
*/
class CollectionViewHelperTest extends AbstractViewHelperTest {
public function testRender() {
$this->assertEmpty($this->executeViewHelper());
}
}

View File

@@ -0,0 +1,24 @@
<?php
namespace FluidTYPO3\Vhs\Tests\Unit\ViewHelpers\Resource;
/*
* 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 on
* @author Claus Due <claus@namelesscoder.net>
* @package Vhs
*/
class FileViewHelperTest extends AbstractViewHelperTest {
public function testRender() {
$this->assertEmpty($this->executeViewHelper());
}
}

View File

@@ -0,0 +1,24 @@
<?php
namespace FluidTYPO3\Vhs\Tests\Unit\ViewHelpers\Resource;
/*
* 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 on
* @author Claus Due <claus@namelesscoder.net>
* @package Vhs
*/
class ImageViewHelperTest extends AbstractViewHelperTest {
public function testRender() {
$this->assertEmpty($this->executeViewHelper());
}
}

View File

@@ -0,0 +1,28 @@
<?php
namespace FluidTYPO3\Vhs\Tests\Unit\ViewHelpers\Resource;
/*
* 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 on
* @author Claus Due <claus@namelesscoder.net>
* @package Vhs
*/
class LanguageViewHelperTest extends AbstractViewHelperTest {
/**
* @test
*/
public function testRenderFailsWhenUnableToResolveExtensionName() {
$this->setExpectedException('TYPO3\CMS\Fluid\Core\ViewHelper\Exception', 'Unable to read extension name from ControllerContext and value not manually specified');
$this->executeViewHelper();
}
}

View File

@@ -0,0 +1,70 @@
<?php
namespace FluidTYPO3\Vhs\Tests\Unit\ViewHelpers\Resource\Record;
/*
* 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\Fluid\Core\Parser\SyntaxTree\ViewHelperNode;
/**
* @protection on
* @author Marc Neuhaus <mneuhaus@famelo.com>
* @package Vhs
*/
class FalViewHelperTest extends AbstractViewHelperTest {
/**
* @test
*/
public function testFalViewhHelperWorkspaceHandling() {
$GLOBALS['TYPO3_DB'] = $this->getMock(\TYPO3\CMS\Core\Database\DatabaseConnection::class);
$GLOBALS['TYPO3_DB']->expects($this->once())
->method('exec_SELECTgetRows')
->with(
'uid',
'sys_file_reference',
'tablenames=' .
' AND uid_foreign=0' .
' AND fieldname='
. 'AND sys_file_reference.deleted=0 AND (sys_file_reference.t3ver_wsid=0 OR sys_file_reference.t3ver_wsid=1234) AND sys_file_reference.pid<>-1',
'',
'sorting_foreign',
'',
'uid'
)
->will($this->returnValue(array('foo')));
$viewHelper = $this->createInstance();
$viewHelperNode = new ViewHelperNode($viewHelper, array());
$GLOBALS['BE_USER']->workspaceRec['uid'] = 1234;
$result = $this->executeViewHelper(array('table' => 'pages', 'field' => 'media'), array(), $viewHelperNode);
}
/**
* @test
*/
public function testFalViewhHelperWithoutWorkspaces() {
$GLOBALS['TYPO3_DB'] = $this->getMock(\TYPO3\CMS\Core\Database\DatabaseConnection::class);
$GLOBALS['TYPO3_DB']->expects($this->once())
->method('exec_SELECTgetRows')
->with(
'uid',
'sys_file_reference',
'tablenames=' .
' AND uid_foreign=0' .
' AND fieldname='
. 'AND sys_file_reference.deleted=0 AND sys_file_reference.t3ver_state<=0 AND sys_file_reference.pid<>-1 AND sys_file_reference.hidden=0',
'',
'sorting_foreign',
'',
'uid'
)
->will($this->returnValue(array('foo')));
$viewHelper = $this->createInstance();
$viewHelperNode = new ViewHelperNode($viewHelper, array());
$result = $this->executeViewHelper(array('table' => 'pages', 'field' => 'media'), array(), $viewHelperNode);
}
}

View File

@@ -0,0 +1,28 @@
<?php
namespace FluidTYPO3\Vhs\Tests\Unit\ViewHelpers\Resource;
/*
* 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 on
* @author Claus Due <claus@namelesscoder.net>
* @package Vhs
*/
class RecordViewHelperTest extends AbstractViewHelperTest {
/**
* @test
*/
public function testRenderFailsWithoutFieldArgument() {
$this->setExpectedException('TYPO3\CMS\Fluid\Core\ViewHelper\Exception', 'The "field" argument must be specified');
$this->executeViewHelper();
}
}