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,46 @@
<?php
namespace FluidTYPO3\Vhs\Tests\Unit\ViewHelpers\Extension;
/*
* 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\ExtensionManagementUtility;
/**
* @protection on
* @author Claus Due <claus@namelesscoder.net>
* @package Vhs
* @subpackage ViewHelpers\Extension
*/
class IconViewHelperTest extends AbstractViewHelperTest {
/**
* @test
*/
public function rendersUsingArgument() {
$test = $this->executeViewHelper(array('extensionName' => 'Vhs'));
$this->assertSame(ExtensionManagementUtility::extPath('vhs', 'ext_icon.gif'), $test);
}
/**
* @test
*/
public function rendersUsingControllerContext() {
$test = $this->executeViewHelper(array(), array(), NULL, 'Vhs');
$this->assertSame(ExtensionManagementUtility::extPath('vhs', 'ext_icon.gif'), $test);
}
/**
* @test
*/
public function throwsErrorWhenUnableToDetectExtensionName() {
$this->setExpectedException('RuntimeException', NULL, 1364167519);
$this->executeViewHelper(array(), array(), NULL, NULL, 'FakePlugin');
}
}

View File

@@ -0,0 +1,53 @@
<?php
namespace FluidTYPO3\Vhs\Tests\Unit\ViewHelpers\Extension;
/*
* 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
* @subpackage ViewHelpers\Extension
*/
class LoadedViewHelperTest extends AbstractViewHelperTest {
/**
* @test
*/
public function rendersThenChildIfExtensionIsLoaded() {
$arguments = array(
'extensionName' => 'Vhs',
'then' => 1, '
else' => 0
);
$result = $this->executeViewHelper($arguments);
$this->assertSame(1, $result);
$staticResult = $this->executeViewHelperStatic($arguments);
$this->assertEquals($result, $staticResult, 'The regular viewHelper output doesn\'t match the static output!');
}
/**
* @test
*/
public function rendersElseChildIfExtensionIsNotLoaded() {
$arguments = array(
'extensionName' => 'Void',
'then' => 1,
'else' => 0
);
$result = $this->executeViewHelper($arguments);
$this->assertSame(0, $result);
$staticResult = $this->executeViewHelperStatic($arguments);
$this->assertEquals($result, $staticResult, 'The regular viewHelper output doesn\'t match the static output!');
}
}

View File

@@ -0,0 +1,46 @@
<?php
namespace FluidTYPO3\Vhs\Tests\Unit\ViewHelpers\Extension\Path;
/*
* 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\ExtensionManagementUtility;
/**
* @protection on
* @author Claus Due <claus@namelesscoder.net>
* @package Vhs
* @subpackage ViewHelpers\Extension\Path
*/
class AbsoluteViewHelperTest extends AbstractViewHelperTest {
/**
* @test
*/
public function rendersUsingArgument() {
$test = $this->executeViewHelper(array('extensionName' => 'Vhs'));
$this->assertSame(ExtensionManagementUtility::extPath('vhs'), $test);
}
/**
* @test
*/
public function rendersUsingControllerContext() {
$test = $this->executeViewHelper(array(), array(), NULL, 'Vhs');
$this->assertSame(ExtensionManagementUtility::extPath('vhs'), $test);
}
/**
* @test
*/
public function throwsErrorWhenUnableToDetectExtensionName() {
$this->setExpectedException('RuntimeException', NULL, 1364167519);
$this->executeViewHelper(array(), array(), NULL, NULL, 'FakePlugin');
}
}

View File

@@ -0,0 +1,46 @@
<?php
namespace FluidTYPO3\Vhs\Tests\Unit\ViewHelpers\Extension\Path;
/*
* 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\ExtensionManagementUtility;
/**
* @protection on
* @author Claus Due <claus@namelesscoder.net>
* @package Vhs
* @subpackage ViewHelpers\Extension\Path
*/
class RelativeViewHelperTest extends AbstractViewHelperTest {
/**
* @test
*/
public function rendersUsingArgument() {
$test = $this->executeViewHelper(array('extensionName' => 'Vhs'));
$this->assertSame(ExtensionManagementUtility::extRelPath('vhs'), $test);
}
/**
* @test
*/
public function rendersUsingControllerContext() {
$test = $this->executeViewHelper(array(), array(), NULL, 'Vhs');
$this->assertSame(ExtensionManagementUtility::extRelPath('vhs'), $test);
}
/**
* @test
*/
public function throwsErrorWhenUnableToDetectExtensionName() {
$this->setExpectedException('RuntimeException', NULL, 1364167519);
$this->executeViewHelper(array(), array(), NULL, NULL, 'FakePlugin');
}
}

View File

@@ -0,0 +1,46 @@
<?php
namespace FluidTYPO3\Vhs\Tests\Unit\ViewHelpers\Extension\Path;
/*
* 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\ExtensionManagementUtility;
/**
* @protection on
* @author Claus Due <claus@namelesscoder.net>
* @package Vhs
* @subpackage ViewHelpers\Extension\Path
*/
class ResourcesViewHelperTest extends AbstractViewHelperTest {
/**
* @test
*/
public function rendersUsingArgument() {
$test = $this->executeViewHelper(array('extensionName' => 'Vhs', 'path' => 'ext_icon.gif'));
$this->assertSame(ExtensionManagementUtility::extRelPath('vhs') . 'Resources/Public/ext_icon.gif', $test);
}
/**
* @test
*/
public function rendersUsingControllerContext() {
$test = $this->executeViewHelper(array('path' => 'ext_icon.gif'), array(), NULL, 'Vhs');
$this->assertSame(ExtensionManagementUtility::extRelPath('vhs') . 'Resources/Public/ext_icon.gif', $test);
}
/**
* @test
*/
public function throwsErrorWhenUnableToDetectExtensionName() {
$this->setExpectedException('RuntimeException', NULL, 1364167519);
$this->executeViewHelper(array(), array(), NULL, NULL, 'FakePlugin');
}
}

View File

@@ -0,0 +1,46 @@
<?php
namespace FluidTYPO3\Vhs\Tests\Unit\ViewHelpers\Extension\Path;
/*
* 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\ExtensionManagementUtility;
/**
* @protection on
* @author Claus Due <claus@namelesscoder.net>
* @package Vhs
* @subpackage ViewHelpers\Extension\Path
*/
class SiteRelativeViewHelperTest extends AbstractViewHelperTest {
/**
* @test
*/
public function rendersUsingArgument() {
$test = $this->executeViewHelper(array('extensionName' => 'Vhs'));
$this->assertSame(ExtensionManagementUtility::siteRelPath('vhs'), $test);
}
/**
* @test
*/
public function rendersUsingControllerContext() {
$test = $this->executeViewHelper(array(), array(), NULL, 'Vhs');
$this->assertSame(ExtensionManagementUtility::siteRelPath('vhs'), $test);
}
/**
* @test
*/
public function throwsErrorWhenUnableToDetectExtensionName() {
$this->setExpectedException('RuntimeException', NULL, 1364167519);
$this->executeViewHelper(array(), array(), NULL, NULL, 'FakePlugin');
}
}