DataWizard/tests/unit/Application/Model/ExportRenderer/ExportRendererTest.php

67 lines
1.9 KiB
PHP
Raw Normal View History

2021-11-25 23:42:41 +01:00
<?php
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
namespace D3\DataWizard\tests\unit\Application\Model\ExportRenderer;
use D3\DataWizard\Application\Model\ExportRenderer\RendererInterface;
use D3\ModCfg\Tests\unit\d3ModCfgUnitTestCase;
2021-12-20 13:41:24 +01:00
use ReflectionException;
2021-11-25 23:42:41 +01:00
abstract class ExportRendererTest extends d3ModCfgUnitTestCase
{
/** @var RendererInterface */
protected $_oModel;
2022-01-17 10:59:18 +01:00
public function tearDown(): void
2021-11-25 23:42:41 +01:00
{
parent::tearDown();
unset($this->_oModel);
}
/**
* @covers \D3\DataWizard\Application\Model\ExportRenderer\Csv::getFileExtension
* @covers \D3\DataWizard\Application\Model\ExportRenderer\Json::getFileExtension
* @covers \D3\DataWizard\Application\Model\ExportRenderer\Pretty::getFileExtension
* @test
2021-12-20 13:41:24 +01:00
* @throws ReflectionException
2021-11-25 23:42:41 +01:00
*/
public function canGetFileExtension()
{
2024-05-10 12:18:33 +02:00
$this->assertMatchesRegularExpression(
2021-11-25 23:42:41 +01:00
"/^[a-z0-9._-]*$/i",
$this->callMethod(
$this->_oModel,
'getFileExtension'
)
);
}
/**
* @covers \D3\DataWizard\Application\Model\ExportRenderer\Csv::getTitleTranslationId
* @covers \D3\DataWizard\Application\Model\ExportRenderer\Json::getTitleTranslationId
* @covers \D3\DataWizard\Application\Model\ExportRenderer\Pretty::getTitleTranslationId
* @test
2021-12-20 13:41:24 +01:00
* @throws ReflectionException
2021-11-25 23:42:41 +01:00
*/
public function canGetTitleTranslationId()
{
$this->assertIsString(
$this->callMethod(
$this->_oModel,
'getTitleTranslationId'
)
);
}
2022-01-17 10:59:18 +01:00
}