27 Commits

Author SHA1 Message Date
cf6dd76aa9 adjust documentation 2023-03-22 16:00:53 +01:00
0213f2e6b3 fix cascaded HTML elements to prevent form issues 2023-03-22 15:58:02 +01:00
1fd00635f9 define code coverage exclusions 2022-12-24 23:39:45 +01:00
640152b6a6 adjust version informations 2022-12-24 23:28:33 +01:00
7d8ed628eb make installable in OXID 6.5.1 2022-12-19 11:22:50 +01:00
8356ff3a62 make installable in OXID 6.5 (CE 6.12) 2022-08-30 00:23:18 +02:00
7c479d02c8 improve changelog 2022-07-28 11:08:54 +02:00
b1e3bd98f0 Merge branch 'rel_2.x' of git.d3data.de:D3Public/DataWizard into rel_2.x 2022-07-13 13:46:17 +02:00
72478c06e7 fix typo 2022-07-13 13:45:55 +02:00
bd4dfaf36c 0010966 execute action after confirmation 2022-02-27 22:56:00 +01:00
7e1e65cb37 prevent commiting CS-Fixer cache file 2022-01-17 11:09:16 +01:00
0c0d564554 add CS-fixed files 2022-01-17 10:59:18 +01:00
51642b57c7 add CS-Fixer configuration 2022-01-17 10:58:46 +01:00
d0464d4a20 enhance README file 2021-12-29 23:41:51 +01:00
6aa028fb8c improve package description 2021-12-23 14:46:43 +01:00
143173be2f set Modcfg as dependency 2021-12-22 15:10:24 +01:00
f3b80607b0 adjust version informations 2021-12-21 13:50:40 +01:00
e05278da19 extract content rendering into separate method 2021-12-21 13:38:53 +01:00
69bf942608 remove outdated version from form manager dependency 2021-12-20 14:09:57 +01:00
bcd91cf709 remove unused dev dependency 2021-12-20 13:54:55 +01:00
e604b84849 improve code 2021-12-20 13:41:24 +01:00
67c462ccda Merge branch 'dev_2.x_PHP73' of git.d3data.de:D3Public/DataWizard into dev_2.x_PHP73 2021-12-20 12:06:15 +01:00
2549003c71 adjust version informations 2021-12-20 12:05:55 +01:00
f86e3a9daf make installable in OXID 6.4 2021-12-20 11:53:55 +01:00
91b18a9196 Merge branch 'rel_1.x' into dev_2.x_PHP73 2021-11-28 23:09:15 +01:00
e0bd9f02b6 Merge branch 'rel_1.x' into dev_2.x_PHP73 2021-11-11 11:18:16 +01:00
5251490b74 handle JSON exception 2021-11-11 09:41:36 +01:00
49 changed files with 411 additions and 316 deletions

5
.gitattributes vendored Normal file
View File

@ -0,0 +1,5 @@
* text=auto
/.gitattributes export-ignore
/.gitignore export-ignore
/.php-cs-fixer.php export-ignore

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.php-cs-fixer.cache

13
.php-cs-fixer.php Normal file
View File

@ -0,0 +1,13 @@
<?php
$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
;
$config = new PhpCsFixer\Config();
return $config->setRules([
'@PHP73Migration' => true,
'@PSR12' => true
])
->setFinder($finder)
;

View File

@ -3,7 +3,7 @@
/**
* 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)
@ -19,14 +19,11 @@ use D3\DataWizard\Application\Model\Configuration;
use D3\DataWizard\Application\Model\Exceptions\DataWizardException;
use D3\DataWizard\Application\Model\Exceptions\DebugException;
use D3\ModCfg\Application\Model\d3database;
use D3\ModCfg\Application\Model\Exception\d3_cfg_mod_exception;
use D3\ModCfg\Application\Model\Exception\d3ShopCompatibilityAdapterException;
use Doctrine\DBAL\DBALException;
use OxidEsales\Eshop\Application\Controller\Admin\AdminDetailsController;
use OxidEsales\Eshop\Core\Config;
use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException;
use OxidEsales\Eshop\Core\Exception\DatabaseErrorException;
use OxidEsales\Eshop\Core\Exception\StandardException;
use OxidEsales\Eshop\Core\Registry;
class d3ActionWizard extends AdminDetailsController
@ -43,7 +40,7 @@ class d3ActionWizard extends AdminDetailsController
$this->configuration = oxNew(Configuration::class);
}
public function getGroups()
public function getGroups(): array
{
return $this->configuration->getActionGroups();
}
@ -55,9 +52,6 @@ class d3ActionWizard extends AdminDetailsController
/**
* @throws DatabaseConnectionException
* @throws StandardException
* @throws d3ShopCompatibilityAdapterException
* @throws d3_cfg_mod_exception
*/
public function runTask()
{
@ -93,7 +87,7 @@ class d3ActionWizard extends AdminDetailsController
/**
* @return Config
*/
public function d3GetConfig()
public function d3GetConfig(): Config
{
return Registry::getConfig();
}
@ -107,4 +101,4 @@ class d3ActionWizard extends AdminDetailsController
{
return null;
}
}
}

View File

@ -3,7 +3,7 @@
/**
* 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)
@ -45,7 +45,7 @@ class d3ExportWizard extends AdminDetailsController
$this->configuration = oxNew(Configuration::class);
}
public function getGroups()
public function getGroups(): array
{
return $this->configuration->getExportGroups();
}
@ -101,7 +101,7 @@ class d3ExportWizard extends AdminDetailsController
/**
* @return Config
*/
public function d3GetConfig()
public function d3GetConfig(): Config
{
return Registry::getConfig();
}
@ -115,4 +115,4 @@ class d3ExportWizard extends AdminDetailsController
{
return null;
}
}
}

View File

@ -3,7 +3,7 @@
/**
* 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)
@ -33,7 +33,7 @@ abstract class ActionBase implements QueryBase
* Ensure that the translations are equally available in the frontend and the backend
* @return string
*/
public function getDescription() : string
public function getDescription(): string
{
return '';
}
@ -53,7 +53,7 @@ abstract class ActionBase implements QueryBase
}
}
$this->executeAction( $this->getQuery() );
$this->executeAction($this->getQuery());
}
/**
@ -63,21 +63,21 @@ abstract class ActionBase implements QueryBase
* @throws DatabaseConnectionException
* @throws DatabaseErrorException
*/
public function executeAction( array $query ): int
public function executeAction(array $query): int
{
[ $queryString, $parameters ] = $query;
$queryString = trim($queryString);
if ( strtolower( substr( $queryString, 0, 6 ) ) === 'select' ) {
if (strtolower(substr($queryString, 0, 6)) === 'select') {
throw oxNew(
Exceptions\TaskException::class,
$this,
Registry::getLang()->translateString( 'D3_DATAWIZARD_ERR_ACTIONSELECT' )
Registry::getLang()->translateString('D3_DATAWIZARD_ERR_ACTIONSELECT')
);
}
$affected = $this->d3GetDb()->execute( $queryString, $parameters );
$affected = $this->d3GetDb()->execute($queryString, $parameters);
throw oxNew(
Exceptions\TaskException::class,
@ -95,15 +95,15 @@ abstract class ActionBase implements QueryBase
* @return DatabaseInterface|null
* @throws DatabaseConnectionException
*/
public function d3GetDb()
public function d3GetDb(): ?DatabaseInterface
{
return DatabaseProvider::getDb( DatabaseProvider::FETCH_MODE_ASSOC );
return DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC);
}
/**
* @return string
*/
public function getButtonText() : string
public function getButtonText(): string
{
return "D3_DATAWIZARD_ACTION_SUBMIT";
}
@ -138,4 +138,4 @@ abstract class ActionBase implements QueryBase
{
return $this->formElements;
}
}
}

View File

@ -3,7 +3,7 @@
/**
* 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)
@ -15,21 +15,17 @@ declare(strict_types=1);
namespace D3\DataWizard\Application\Model;
use D3\DataWizard\Application\Model\Actions\FixArtextendsItems;
use D3\DataWizard\Application\Model\Exceptions\DataWizardException;
use D3\DataWizard\Application\Model\Exports\InactiveCategories;
use D3\DataWizard\Application\Model\Exports\KeyFigures;
use OxidEsales\Eshop\Core\Registry;
class Configuration
{
const GROUP_SHOP = 'D3_DATAWIZARD_GROUP_SHOP';
const GROUP_CATEGORY = 'D3_DATAWIZARD_GROUP_CATEGORIES';
const GROUP_ARTICLES = 'D3_DATAWIZARD_GROUP_ARTICLES';
const GROUP_USERS = 'D3_DATAWIZARD_GROUP_USERS';
const GROUP_ORDERS = 'D3_DATAWIZARD_GROUP_ORDERS';
const GROUP_REMARKS = 'D3_DATAWIZARD_GROUP_REMARKS';
const GROUP_CMS = 'D3_DATAWIZARD_GROUP_CMS';
public const GROUP_SHOP = 'D3_DATAWIZARD_GROUP_SHOP';
public const GROUP_CATEGORY = 'D3_DATAWIZARD_GROUP_CATEGORIES';
public const GROUP_ARTICLES = 'D3_DATAWIZARD_GROUP_ARTICLES';
public const GROUP_USERS = 'D3_DATAWIZARD_GROUP_USERS';
public const GROUP_ORDERS = 'D3_DATAWIZARD_GROUP_ORDERS';
public const GROUP_REMARKS = 'D3_DATAWIZARD_GROUP_REMARKS';
public const GROUP_CMS = 'D3_DATAWIZARD_GROUP_CMS';
protected $actions = [];
protected $exports = [];
@ -117,7 +113,7 @@ class Configuration
/**
* @return array
*/
public function getAllActions() : array
public function getAllActions(): array
{
$all = [];
@ -131,7 +127,7 @@ class Configuration
/**
* @return array
*/
public function getAllExports() : array
public function getAllExports(): array
{
$all = [];
@ -147,7 +143,7 @@ class Configuration
*
* @return ActionBase
*/
public function getActionById($id) : ActionBase
public function getActionById($id): ActionBase
{
$allActions = $this->getAllActions();
@ -163,7 +159,7 @@ class Configuration
*
* @return ExportBase
*/
public function getExportById($id) : ExportBase
public function getExportById($id): ExportBase
{
$allExports = $this->getAllExports();

View File

@ -3,7 +3,7 @@
/**
* 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)
@ -19,4 +19,4 @@ use OxidEsales\Eshop\Core\Exception\StandardException;
class DataWizardException extends StandardException
{
}
}

View File

@ -3,7 +3,7 @@
/**
* 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)
@ -20,13 +20,13 @@ use OxidEsales\Eshop\Core\Registry;
class DebugException extends DataWizardException
{
public function __construct($sMessage = "not set", $iCode = 0, Exception $previous = null )
public function __construct($sMessage = "not set", $iCode = 0, Exception $previous = null)
{
$sMessage = sprintf(
Registry::getLang()->translateString('D3_DATAWIZARD_DEBUG'),
$sMessage
);
parent::__construct($sMessage, $iCode, $previous );
parent::__construct($sMessage, $iCode, $previous);
}
}
}

View File

@ -3,7 +3,7 @@
/**
* 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)
@ -20,13 +20,13 @@ use OxidEsales\Eshop\Core\Registry;
class ExportFileException extends DataWizardException
{
public function __construct($sMessage = "not set", $iCode = 0, Exception $previous = null )
public function __construct($sMessage = "not set", $iCode = 0, Exception $previous = null)
{
$sMessage = sprintf(
Registry::getLang()->translateString('D3_DATAWIZARD_ERR_EXPORTFILEERROR'),
$sMessage
);
parent::__construct($sMessage, $iCode, $previous );
parent::__construct($sMessage, $iCode, $previous);
}
}
}

View File

@ -3,7 +3,7 @@
/**
* 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)
@ -32,7 +32,7 @@ class InputUnvalidException extends DataWizardException
* @param Exception|null $previous
* @throws Exception
*/
public function __construct( QueryBase $task, Input $inputElement, $iCode = 0, Exception $previous = null )
public function __construct(QueryBase $task, Input $inputElement, $iCode = 0, Exception $previous = null)
{
$messages = [];
foreach ($inputElement->getError()->getIterator() as $item) {
@ -43,11 +43,11 @@ class InputUnvalidException extends DataWizardException
' - ',
[
$task->getTitle(),
implode(', ', $messages)
implode(', ', $messages),
]
);
parent::__construct( $sMessage, $iCode, $previous );
parent::__construct($sMessage, $iCode, $previous);
$this->task = $task;
}
}
}

View File

@ -3,7 +3,7 @@
/**
* 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)
@ -20,13 +20,13 @@ use OxidEsales\Eshop\Core\Registry;
class NoSuitableRendererException extends DataWizardException
{
public function __construct($sMessage = "not set", $iCode = 0, Exception $previous = null )
public function __construct($sMessage = "not set", $iCode = 0, Exception $previous = null)
{
$sMessage = sprintf(
Registry::getLang()->translateString('D3_DATAWIZARD_ERR_NOSUITABLERENDERER'),
$sMessage
);
parent::__construct($sMessage, $iCode, $previous );
parent::__construct($sMessage, $iCode, $previous);
}
}
}

View File

@ -3,7 +3,7 @@
/**
* 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)
@ -17,4 +17,4 @@ namespace D3\DataWizard\Application\Model\Exceptions;
class RenderException extends DataWizardException
{
}
}

View File

@ -3,7 +3,7 @@
/**
* 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)
@ -23,17 +23,17 @@ class TaskException extends DataWizardException
/** @var QueryBase */
public $task;
public function __construct( QueryBase $task, $sMessage = "not set", $iCode = 0, Exception $previous = null )
public function __construct(QueryBase $task, $sMessage = "not set", $iCode = 0, Exception $previous = null)
{
$sMessage = implode(
' - ',
[
$task->getTitle(),
$sMessage
$sMessage,
]
);
parent::__construct( $sMessage, $iCode, $previous );
parent::__construct($sMessage, $iCode, $previous);
$this->task = $task;
}
}
}

View File

@ -3,7 +3,7 @@
/**
* 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)
@ -25,6 +25,7 @@ use Doctrine\DBAL\DBALException;
use FormManager\Inputs\Checkbox;
use FormManager\Inputs\Input;
use FormManager\Inputs\Radio;
use OxidEsales\Eshop\Core\Database\Adapter\DatabaseInterface;
use OxidEsales\Eshop\Core\DatabaseProvider;
use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException;
use OxidEsales\Eshop\Core\Exception\DatabaseErrorException;
@ -39,11 +40,11 @@ abstract class ExportBase implements QueryBase
* Ensure that the translations are equally available in the frontend and the backend
* @return string
*/
public function getDescription() : string
public function getDescription(): string
{
return '';
}
/**
* @param string $format
* @param $path
@ -58,7 +59,7 @@ abstract class ExportBase implements QueryBase
* @throws d3_cfg_mod_exception
* @return string
*/
public function run( string $format = RendererBridge::FORMAT_CSV, $path = null): string
public function run(string $format = RendererBridge::FORMAT_CSV, $path = null): string
{
if ($this->hasFormElements()) {
/** @var Input $element */
@ -75,7 +76,7 @@ abstract class ExportBase implements QueryBase
/**
* @return string
*/
public function getButtonText() : string
public function getButtonText(): string
{
return "D3_DATAWIZARD_EXPORT_SUBMIT";
}
@ -94,7 +95,7 @@ abstract class ExportBase implements QueryBase
/**
* @return RendererBridge
*/
public function getRendererBridge()
public function getRendererBridge(): RendererBridge
{
return oxNew(RendererBridge::class);
}
@ -127,7 +128,7 @@ abstract class ExportBase implements QueryBase
/**
* @return string
*/
public function getExportFilenameBase() : string
public function getExportFilenameBase(): string
{
return $this->getTitle();
}
@ -138,7 +139,7 @@ abstract class ExportBase implements QueryBase
* @return string
* @throws Exceptions\NoSuitableRendererException
*/
public function getExportFileName($format) : string
public function getExportFileName($format): string
{
return $this->getExportFilenameBase().'_'.date('Y-m-d_H-i-s').'.'.$this->getFileExtension($format);
}
@ -150,31 +151,31 @@ abstract class ExportBase implements QueryBase
* @throws DatabaseConnectionException
* @throws DatabaseErrorException
*/
public function getExportData( array $query ): array
public function getExportData(array $query): array
{
[ $queryString, $parameters ] = $query;
$queryString = trim($queryString);
if ( strtolower( substr( $queryString, 0, 6 ) ) !== 'select' ) {
if (strtolower(substr($queryString, 0, 6)) !== 'select') {
throw oxNew(
Exceptions\TaskException::class,
$this,
Registry::getLang()->translateString( 'D3_DATAWIZARD_ERR_NOEXPORTSELECT' )
Registry::getLang()->translateString('D3_DATAWIZARD_ERR_NOEXPORTSELECT')
);
}
$rows = $this->d3GetDb()->getAll( $queryString, $parameters );
$rows = $this->d3GetDb()->getAll($queryString, $parameters);
if ( count( $rows ) <= 0 ) {
if (count($rows) <= 0) {
throw oxNew(
Exceptions\TaskException::class,
$this,
Registry::getLang()->translateString( 'D3_DATAWIZARD_ERR_NOEXPORTCONTENT', null, true )
Registry::getLang()->translateString('D3_DATAWIZARD_ERR_NOEXPORTCONTENT', null, true)
);
}
$fieldNames = array_keys( $rows[0] );
$fieldNames = array_keys($rows[0]);
return [ $rows, $fieldNames ];
}
@ -224,7 +225,7 @@ abstract class ExportBase implements QueryBase
*/
protected function executeExport(string $format, $path): string
{
$content = $this->getContent( $format );
$content = $this->getContent($format);
/** @var $oFS d3filesystem */
$oFS = $this->getFileSystem();
@ -242,10 +243,10 @@ abstract class ExportBase implements QueryBase
}
/**
* @return \OxidEsales\Eshop\Core\Database\Adapter\DatabaseInterface|null
* @return DatabaseInterface|null
* @throws DatabaseConnectionException
*/
protected function d3GetDb(): ?\OxidEsales\Eshop\Core\Database\Adapter\DatabaseInterface
protected function d3GetDb(): ?DatabaseInterface
{
return DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC);
}
@ -266,12 +267,12 @@ abstract class ExportBase implements QueryBase
* @throws DatabaseErrorException
* @throws Exceptions\NoSuitableRendererException
*/
public function getContent( string $format ): string
public function getContent(string $format): string
{
[ $rows, $fieldNames ] = $this->getExportData( $this->getQuery() );
[ $rows, $fieldNames ] = $this->getExportData($this->getQuery());
$content = $this->renderContent( $rows, $fieldNames, $format );
$content = $this->renderContent($rows, $fieldNames, $format);
return $content;
}
}
}

View File

@ -3,7 +3,7 @@
/**
* 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)
@ -35,12 +35,12 @@ class Csv implements RendererInterface
{
try {
$csv = $this->getCsv();
$csv->insertOne( $fieldNames );
$csv->insertAll( $rows );
return method_exists($csv, 'getContent') ? $csv->getContent() : (string) $csv;
$csv->insertOne($fieldNames);
$csv->insertAll($rows);
return (string) $csv;
} catch (Exception $e) {
/** @var RenderException $newException */
$newException = oxNew(RenderException::class, $e->getMessage(), $e->getCode(), $e );
$newException = oxNew(RenderException::class, $e->getMessage(), $e->getCode(), $e);
throw $newException;
}
}
@ -86,8 +86,8 @@ class Csv implements RendererInterface
/**
* @return Config
*/
public function d3GetConfig()
public function d3GetConfig(): Config
{
return Registry::getConfig();
}
}
}

View File

@ -3,7 +3,7 @@
/**
* 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)
@ -16,6 +16,7 @@ declare(strict_types=1);
namespace D3\DataWizard\Application\Model\ExportRenderer;
use D3\DataWizard\Application\Model\Exceptions\RenderException;
use JsonException;
class Json implements RendererInterface
{
@ -28,12 +29,15 @@ class Json implements RendererInterface
*/
public function getContent($rows, $fieldNames): string
{
$flags = JSON_PRETTY_PRINT;
$json = json_encode( $rows, $flags );
if ( $json === false ) {
throw oxNew( RenderException::class, json_last_error_msg(), json_last_error());
try {
$flags = JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR;
$json = json_encode($rows, $flags);
return $json;
} catch (JsonException $e) {
/** @var RenderException $newException */
$newException = oxNew(RenderException::class, $e->getMessage(), $e->getCode(), $e);
throw $newException;
}
return $json;
}
public function getFileExtension(): string
@ -48,4 +52,4 @@ class Json implements RendererInterface
{
return "D3_DATAWIZARD_EXPORT_FORMAT_JSON";
}
}
}

View File

@ -3,7 +3,7 @@
/**
* 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)
@ -25,7 +25,7 @@ class Pretty implements RendererInterface
*
* @return string
*/
public function getContent($rows, $fieldNames) : string
public function getContent($rows, $fieldNames): string
{
$renderer = $this->getArrayToTextTableInstance($rows);
return $renderer->getTable();
@ -35,7 +35,7 @@ class Pretty implements RendererInterface
* @param $rows
* @return ArrayToTextTable
*/
public function getArrayToTextTableInstance($rows)
public function getArrayToTextTableInstance($rows): ArrayToTextTable
{
return oxNew(ArrayToTextTable::class, $rows);
}
@ -55,4 +55,4 @@ class Pretty implements RendererInterface
{
return "D3_DATAWIZARD_EXPORT_FORMAT_PRETTY";
}
}
}

View File

@ -3,7 +3,7 @@
/**
* 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)
@ -19,9 +19,9 @@ use D3\DataWizard\Application\Model\Exceptions\NoSuitableRendererException;
class RendererBridge
{
const FORMAT_CSV = 'CSV';
const FORMAT_PRETTY = 'Pretty';
const FORMAT_JSON = 'JSON';
public const FORMAT_CSV = 'CSV';
public const FORMAT_PRETTY = 'Pretty';
public const FORMAT_JSON = 'JSON';
/**
* @return array
@ -31,11 +31,11 @@ class RendererBridge
return [
self::FORMAT_CSV => oxNew(Csv::class),
self::FORMAT_PRETTY => oxNew(Pretty::class),
self::FORMAT_JSON => oxNew(Json::class)
self::FORMAT_JSON => oxNew(Json::class),
];
}
public function getTranslatedRendererIdList()
public function getTranslatedRendererIdList(): array
{
$rendererList = $this->getRendererList();
array_walk($rendererList, [$this, 'translateRendererId']);
@ -71,4 +71,4 @@ class RendererBridge
$e = oxNew(NoSuitableRendererException::class, $format);
throw $e;
}
}
}

View File

@ -3,7 +3,7 @@
/**
* 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)
@ -23,15 +23,15 @@ interface RendererInterface
*
* @return string
*/
public function getContent($rows, $fieldNames) : string;
public function getContent($rows, $fieldNames): string;
/**
* @return string
*/
public function getFileExtension() : string;
public function getFileExtension(): string;
/**
* @return string
*/
public function getTitleTranslationId() : string;
}
public function getTitleTranslationId(): string;
}

View File

@ -3,7 +3,7 @@
/**
* 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)
@ -25,23 +25,23 @@ interface QueryBase
* Ensure that the translations are equally available in the frontend and the backend
* @return string
*/
public function getTitle() : string;
public function getTitle(): string;
/**
* Ensure that the translations are equally available in the frontend and the backend
* @return string
*/
public function getDescription() : string;
public function getDescription(): string;
/**
* @return string
*/
public function getButtonText() : string;
public function getButtonText(): string;
/**
* @return array [string $query, array $parameters]
*/
public function getQuery() : array;
public function getQuery(): array;
/**
* @param Input $input
@ -57,4 +57,4 @@ interface QueryBase
* @return array
*/
public function getFormElements(): array;
}
}

View File

@ -3,7 +3,7 @@
/**
* 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)
@ -11,13 +11,14 @@
* @link https://www.oxidmodule.com
*/
// @codeCoverageIgnoreStart
declare(strict_types=1);
$sLangName = "Deutsch";
// -------------------------------
// RESOURCE IDENTITFIER = STRING
// -------------------------------
$aLang = array(
$aLang = [
//Navigation
'charset' => 'UTF-8',
@ -42,6 +43,7 @@ $aLang = array(
'D3_DATAWIZARD_EXPORT_FORMAT_JSON' => 'JSON-Format',
'D3_DATAWIZARD_ACTION_SUBMIT' => 'Aktion starten',
'D3_DATAWIZARD_ACTION_SUBMIT_CONFIRM' => 'Soll die Aktion gestartet werden?',
'D3_DATAWIZARD_DEBUG' => 'Debug: %1$s',
@ -55,4 +57,5 @@ $aLang = array(
'D3_DATAWIZARD_ERR_NOACTION_INSTALLED' => 'Es sind keine Aktionen installiert oder aktiviert.',
'D3_DATAWIZARD_ERR_ACTIONRESULT' => '%1$s Eintrag verändert',
'D3_DATAWIZARD_ERR_ACTIONRESULTS' => '%1$s Einträge verändert',
);
];
// @codeCoverageIgnoreEnd

View File

@ -3,7 +3,7 @@
/**
* 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)
@ -11,13 +11,14 @@
* @link https://www.oxidmodule.com
*/
// @codeCoverageIgnoreStart
declare(strict_types=1);
$sLangName = "English";
// -------------------------------
// RESOURCE IDENTITFIER = STRING
// -------------------------------
$aLang = array(
$aLang = [
//Navigation
'charset' => 'UTF-8',
@ -42,6 +43,7 @@ $aLang = array(
'D3_DATAWIZARD_EXPORT_FORMAT_JSON' => 'JSON format',
'D3_DATAWIZARD_ACTION_SUBMIT' => 'run action',
'D3_DATAWIZARD_ACTION_SUBMIT_CONFIRM' => 'Should the action be executed?',
'D3_DATAWIZARD_DEBUG' => 'Debug: %1$s',
@ -55,4 +57,5 @@ $aLang = array(
'D3_DATAWIZARD_ERR_NOACTION_INSTALLED' => 'No actions are installed or activated.',
'D3_DATAWIZARD_ERR_ACTIONRESULT' => '%1$s entry changed',
'D3_DATAWIZARD_ERR_ACTIONRESULTS' => '%1$s entries changed',
);
];
// @codeCoverageIgnoreEnd

View File

@ -1,6 +1,6 @@
[{block name="submitElements"}]
<div class="btn-group">
<button type="button" class="btn btn-primary" onclick="startTask('[{$id}]')">
<button type="button" class="btn btn-primary" onclick="if (confirm('[{oxmultilang ident="D3_DATAWIZARD_ACTION_SUBMIT_CONFIRM"}]') === true) {startTask('[{$id}]')}">
<i class="fas fa-fw fa-magic"></i>
[{oxmultilang ident=$item->getButtonText()}]
</button>

View File

@ -1,61 +1,69 @@
# Changelog
All notable changes to this project will be documented in this file.
## 1.5.0.1 (2023-03-22)
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased](https://git.d3data.de/D3Public/DataWizard/compare/2.1.1.1...rel_2.x)
## [2.1.1.0](https://git.d3data.de/D3Public/DataWizard/compare/2.1.1.0...2.1.1.1) - 2023-03-22
### Fixed
- wrong cascaded HTML elements
## 1.5.0.0 (2021-12-21)
## [2.1.1.0](https://git.d3data.de/D3Public/DataWizard/compare/2.1.0.0...2.1.1.0) - 2022-12-24
### Added
- installable in OXID 6.5.0 and 6.5.1
- request confirmation before execute action
#### Added
- add tests
### Changed
- documentation extended
#### Changed
## [2.1.0.0](https://git.d3data.de/D3Public/DataWizard/compare/2.0.0.0...2.1.0.0) - 2021-12-21
### Changed
- adjust to CLI extension which can export to STDOUT
- restrict dependencies to OXID 6.2, use 2.x for newer installations
---
## [2.0.0.0](https://git.d3data.de/D3Public/DataWizard/compare/1.4.0.0...2.0.0.0) - 2021-12-20
### Added
- add tests
- make installable in OXID 6.4
## 1.4.0.0 (2021-11-11)
### Changed
- adjust code to PHP 7.3 and up
#### Added
## [1.4.0.0](https://git.d3data.de/D3Public/DataWizard/compare/1.3.1.0...1.4.0.0) - 2021-11-11
### Added
- add JSON export renderer
- add tpl block for easier extension
- enable controller based exception handling
#### Changed
### Changed
- change deprecated CSV export code
- show registered export renderers in admin submit without required tpl block extension
- force get translations from admin
---
## 1.3.1.0 (2021-09-10)
## [1.3.1.0](https://git.d3data.de/D3Public/DataWizard/compare/1.2.0.0...1.3.0.0) - 2021-09-10
### Added
- installable in OXID 6.3.1
---
## 1.3.0.0 (2021-07-29)
## [1.3.0.0](https://git.d3data.de/D3Public/DataWizard/compare/1.2.0.0...1.3.0.0) - 2021-07-29
### Changed
- can handle long task description text
- has more generic admin controller templates
---
## 1.2.0.0 (2021-07-27)
## [1.2.0.0](https://git.d3data.de/D3Public/DataWizard/compare/1.1.0.0...1.2.0.0) - 2021-07-27
### Added
- adjustments for CLI extension
### Fixed
- fix OXID 6.1 incompatibilities
---
## 1.1.0.0 (2021-06-25)
## [1.1.0.0](https://git.d3data.de/D3Public/DataWizard/compare/1.0.0.0...1.1.0.0) - 2021-06-25
### Added
- implement form builder
### Fixed
- fix key figures export
---
## 1.0.0.0 (2021-06-22)
## [1.0.0.0](https://git.d3data.de/D3Public/DataWizard/releases/tag/1.0.0.0) - 2021-06-22
### Added
- initial implementation

View File

@ -9,20 +9,39 @@ The exports are defined via database queries or ready-made data lists. Various e
All exports and tasks are grouped together for better clarity.
Sample exports are included in the package d3/datawizardtasks. These are intended to serve as an implementation reference for individual exports.
Sample exports are included in the package `d3/datawizardtasks`. These are intended to serve as an implementation reference for individual exports.
![administration area](assets/administration_exports.jpg "administration area")
## Table of content
- [Installation](#installation)
- [Usage](#usage)
- [Extensibility](#extensibility)
- [Extension packages](#extension-packages)
- [Changelog](#changelog)
- [Contributing](#contributing)
- [License](#license)
- [Further licences and terms of use](#further-licences-and-terms-of-use)
## Installation
In the console in the shop root (above source and vendor), execute the following command:
This package requires an Composer installed OXID eShop as defined in [composer.json](composer.json).
Open a command line interface and navigate to the shop root directory (parent of source and vendor). Execute the following command. Adapt the paths to your environment.
```bash
php composer require d3/datawizard:^1.0
php composer require d3/datawizard:^2.0
```
Activate the module in the admin area of the shop in "Extensions -> Modules".
## Usage
These package doesn't contain any export or action items. See [Extension packages](#extension_packages) for installable example items.
Log in to the admin area of your shop and navigate to "DÂł Modules -> Data Wizard". Go to "Exports" or "Actions" (as desired). Choose your desired item and export or execute it.
## Extensibility
The module represents the technical basic framework of the exports and does not claim to be complete. In order to adapt the scope to individual requirements, the following extensions are prepared:
@ -33,7 +52,7 @@ The module represents the technical basic framework of the exports and does not
Independently of this, all extension options are available that the OXID Shop provides for modules.
## Extension packages
### Extension packages
- `d3/datawizardtasks` - provides sample exports and their implementation reference
- `d3/datawizardcli` - provides the execution of exports or tasks via the command prompt (e.g. as cronjobs)
@ -43,9 +62,21 @@ Independently of this, all extension options are available that the OXID Shop pr
See [CHANGELOG](CHANGELOG.md) for further informations.
## Licence of this software (d3/datawizard)
## Contributing
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue. Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (git checkout -b feature/AmazingFeature)
- Commit your Changes (git commit -m 'Add some AmazingFeature')
- Push to the Branch (git push origin feature/AmazingFeature)
- Open a Pull Request
## Licence
(status: 2021-05-06)
Distributed under the GPLv3 license.
```
Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
@ -118,4 +149,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
```
```

View File

@ -9,20 +9,40 @@ Die Exporte werden ĂĽber Datenbankabfragen oder fertige Datenlisten definiert. E
Alle Exporte bzw. Tasks sind fĂĽr eine bessere Ăśbersichtlichkeit in Gruppen zusammengefasst.
Im Paket d3/datawizardtasks sind Beispielexporte enthalten. Diese sollen als Implementierungsreferenz fĂĽr individuelle Exporte dienen.
Im Paket `d3/datawizardtasks` sind Beispielexporte enthalten. Diese sollen als Implementierungsreferenz fĂĽr individuelle Exporte dienen.
![Adminbereich](assets/administration_exports.jpg "Adminbereich")
## Schnellinstallation
## Inhaltsverzeichnis
- [Installation](#installation)
- [Verwendung](#verwendung)
- [Erweiterbarkeit](#erweiterbarkeit)
- [Erweiterungspakete](#erweiterungspakete)
- [Changelog](#changelog)
- [Beitragen](#beitragen)
- [Lizenz](#lizenz)
- [weitere Lizenzen und Nutzungsbedingungen](#weitere-lizenzen-und-nutzungsbedingungen)
## Installation
Dieses Paket erfordert einen mit Composer installierten OXID eShop in einer in der [composer.json](composer.json) definierten Version.
Ă–ffnen Sie eine Kommandozeile und navigieren Sie zum Stammverzeichnis des Shops (Elternverzeichnis von source und vendor). FĂĽhren Sie den folgenden Befehl aus. Passen Sie die Pfadangaben an Ihre Installationsumgebung an.
Auf der Konsole im Shoproot (oberhalb von source und vendor) folgenden Befehl ausfĂĽhren:
```bash
php composer require d3/datawizard:^1.0
php composer require d3/datawizard:^2.0
```
Aktivieren Sie das Modul im Shopadmin unter "Erweiterungen -> Module".
## Verwendung
Dieses Paket enthält keine Exporte oder Aktionen. In [Erweiterungspakete](#erweiterungspakete) finden Sie installierbare Beispieleinträge.
Melden Sie sich im Adminbereich Ihres Shops an und navigieren Sie zu "D³ Module -> Data Wizard". Wechseln Sie je nach Wunsch zu "Exporte" oder "Aktionen". Wählen Sie den gewünschten Eintrag und starten Sie den Export bzw. die Aktion.
## Erweiterbarkeit
Das Modul stellt das technische Grundgerüst der Exporte dar und erhebt keinen Anspruch auf Vollständigkeit. Um den Umfang an die individuellen Anforderungen anzupassen, sind folgende Erweiterungen vorbereitet:
@ -33,7 +53,7 @@ Das Modul stellt das technische GrundgerĂĽst der Exporte dar und erhebt keinen A
Unabhängig dessen stehen alle Erweiterungsmöglichkeiten zur Verfügung, die der OXID Shop für Module bereitstellt.
## Erweiterungspakete
### Erweiterungspakete
- `d3/datawizardtasks` - liefert Beispielexporte und deren Implementierungsreferenz
- `d3/datawizardcli` - ermöglicht die Ausführung der Exporte oder Tasks über die Eingabeaufforderung (z.B. als Cronjobs)
@ -43,9 +63,21 @@ Unabhängig dessen stehen alle Erweiterungsmöglichkeiten zur Verfügung, die de
Siehe [CHANGELOG](CHANGELOG.md) fĂĽr weitere Informationen.
## Lizenz dieser Software (d3/datawizard)
## Beitragen
Wenn Sie eine Verbesserungsvorschlag haben, legen Sie einen Fork des Repositories an und erstellen Sie einen Pull Request. Alternativ können Sie einfach ein Issue erstellen. Fügen Sie das Projekt zu Ihren Favoriten hinzu. Vielen Dank.
- Erstellen Sie einen Fork des Projekts
- Erstellen Sie einen Feature Branch (git checkout -b feature/AmazingFeature)
- Fügen Sie Ihre Änderungen hinzu (git commit -m 'Add some AmazingFeature')
- Ăśbertragen Sie den Branch (git push origin feature/AmazingFeature)
- Ă–ffnen Sie einen Pull Request
## Lizenz
(Stand: 06.05.2021)
Vertrieben unter der GPLv3 Lizenz.
```
Copyright (c) D3 Data Development (Inh. Thomas Dartsch)

View File

@ -1,6 +1,6 @@
{
"name": "d3/datawizard",
"description": "das magische Datenwerkzeug",
"description": "the magical data tool /\n das magische Datenwerkzeug",
"type": "oxideshop-module",
"keywords": [
"oxid",
@ -25,15 +25,12 @@
"GPL-3.0-or-later"
],
"require": {
"php": ">=7.1",
"oxid-esales/oxideshop-ce": "6.3 - 6.7",
"php": ">=7.3",
"oxid-esales/oxideshop-ce": "6.8 - 6.13",
"league/csv": "^9.0",
"mathieuviossat/arraytotexttable": "^1.0",
"form-manager/form-manager": "^5.1 || ^6.1",
"d3/modcfg": "^5.3.6.0"
},
"require-dev": {
"oxid-esales/oxideshop-ce": "6.8 - 6.9"
"form-manager/form-manager": "^6.1",
"d3/modcfg": "^6.0"
},
"extra": {
"oxideshop": {

View File

@ -32,13 +32,13 @@ $aModule = [
'en' => '',
],
'thumbnail' => '',
'version' => '1.5.0.1',
'version' => '2.1.1.1',
'author' => 'D&sup3; Data Development (Inh.: Thomas Dartsch)',
'email' => 'support@shopmodule.com',
'url' => 'https://www.oxidmodule.com/',
'controllers' => [
'd3ExportWizard' => D3\DataWizard\Application\Controller\Admin\d3ExportWizard::class,
'd3ActionWizard' => D3\DataWizard\Application\Controller\Admin\d3ActionWizard::class
'd3ActionWizard' => D3\DataWizard\Application\Controller\Admin\d3ActionWizard::class,
],
'extend' => [],
'events' => [],
@ -54,8 +54,8 @@ $aModule = [
'group' => $sModuleId.'_general',
'name' => $sModuleId.'_debug',
'type' => 'bool',
'value' => false
]
'value' => false,
],
],
'blocks' => []
'blocks' => [],
];

View File

@ -12,6 +12,7 @@
*/
// Include datawizard test config
namespace D3\DataWizard\tests;
use D3\ModCfg\Tests\additional_abstract;
@ -36,4 +37,5 @@ class additional extends additional_abstract
try {
d3GetModCfgDIC()->get(additional::class);
} catch (Exception $e) {}
} catch (Exception $e) {
}

View File

@ -11,5 +11,4 @@
* @link https://www.oxidmodule.com
*/
define('D3DATAWIZARD_REQUIRE_MODCFG', true);
const D3DATAWIZARD_REQUIRE_MODCFG = true;

View File

@ -15,4 +15,4 @@ class d3TestAction extends ActionBase
{
return ["UPDATE 1"];
}
}
}

View File

@ -13,6 +13,6 @@ class d3TestExport extends ExportBase
public function getQuery(): array
{
return "SELECT 1";
return ["SELECT 1"];
}
}
}

View File

@ -33,7 +33,7 @@ class d3ActionWizardTest extends d3AdminControllerTest
protected $testClassName = d3ActionWizard::class;
public function setUp() : void
public function setUp(): void
{
parent::setUp();
@ -99,7 +99,7 @@ class d3ActionWizardTest extends d3AdminControllerTest
{
return [
['test1'],
['test2']
['test2'],
];
}
@ -144,7 +144,7 @@ class d3ActionWizardTest extends d3AdminControllerTest
$actionMock = $this->getMockBuilder(d3TestAction::class)
->onlyMethods([
'getQuery',
'run'
'run',
])
->getMock();
$actionMock->expects($this->atLeastOnce())->method('getQuery')->willReturn(['SELECT 1', ['1']]);
@ -190,4 +190,4 @@ class d3ActionWizardTest extends d3AdminControllerTest
'debug' => [true],
];
}
}
}

View File

@ -39,7 +39,7 @@ abstract class d3AdminControllerTest extends d3ModCfgUnitTestCase
protected $testClassName;
public function tearDown() : void
public function tearDown(): void
{
parent::tearDown();
@ -169,7 +169,7 @@ abstract class d3AdminControllerTest extends d3ModCfgUnitTestCase
$actionMock = $this->getMockBuilder(d3TestAction::class)
->onlyMethods([
'getQuery',
'run'
'run',
])
->getMock();
$actionMock->expects($this->atLeastOnce())->method('getQuery')->willReturn(['SELECT 1', ['1']]);
@ -259,4 +259,4 @@ abstract class d3AdminControllerTest extends d3ModCfgUnitTestCase
)
);
}
}
}

View File

@ -34,7 +34,7 @@ class d3ExportWizardTest extends d3AdminControllerTest
protected $testClassName = d3ExportWizard::class;
public function setUp() : void
public function setUp(): void
{
parent::setUp();
@ -100,7 +100,7 @@ class d3ExportWizardTest extends d3AdminControllerTest
{
return [
['test1'],
['test2']
['test2'],
];
}
@ -146,7 +146,7 @@ class d3ExportWizardTest extends d3AdminControllerTest
$exportMock = $this->getMockBuilder(d3TestExport::class)
->onlyMethods([
'getQuery',
'run'
'run',
])
->getMock();
$exportMock->expects($this->atLeastOnce())->method('getQuery')->willReturn(['SELECT 1', ['1']]);
@ -192,4 +192,4 @@ class d3ExportWizardTest extends d3AdminControllerTest
'debug' => [true],
];
}
}
}

View File

@ -31,14 +31,14 @@ class ActionBaseTest extends d3ModCfgUnitTestCase
/** @var d3TestAction */
protected $_oModel;
public function setUp() : void
public function setUp(): void
{
parent::setUp();
$this->_oModel = oxNew(d3TestAction::class);
}
public function tearDown() : void
public function tearDown(): void
{
parent::tearDown();
@ -94,7 +94,7 @@ class ActionBaseTest extends d3ModCfgUnitTestCase
);
}
public function canGetHasFormElementsDataProvider()
public function canGetHasFormElementsDataProvider(): array
{
return [
'hasFormElements' => [['abc', 'def'], true],
@ -135,7 +135,7 @@ class ActionBaseTest extends d3ModCfgUnitTestCase
$inputMock = $this->getMockBuilder($inputClass)
->onlyMethods([
'setTemplate',
'setAttribute'
'setAttribute',
])
->getMock();
$inputMock->expects($this->atLeastOnce())->method('setTemplate');
@ -160,7 +160,7 @@ class ActionBaseTest extends d3ModCfgUnitTestCase
return [
'Radio' => [Radio::class],
'Checkbox' => [Radio::class],
'Hidden' => [Hidden::class]
'Hidden' => [Hidden::class],
];
}
@ -175,7 +175,7 @@ class ActionBaseTest extends d3ModCfgUnitTestCase
->onlyMethods([
'hasFormElements',
'executeAction',
'getQuery'
'getQuery',
])
->getMock();
$modelMock->expects($this->atLeastOnce())->method('hasFormElements')->willReturn(false);
@ -204,7 +204,7 @@ class ActionBaseTest extends d3ModCfgUnitTestCase
'hasFormElements',
'executeAction',
'getQuery',
'getFormElements'
'getFormElements',
])
->getMock();
$modelMock->expects($this->atLeastOnce())->method('hasFormElements')->willReturn(true);
@ -246,7 +246,7 @@ class ActionBaseTest extends d3ModCfgUnitTestCase
return [
'validElements' => [[$validMock, $validMock], false],
'invalidElements' => [[$validMock, $invalidField], true]
'invalidElements' => [[$validMock, $invalidField], true],
];
}
@ -313,4 +313,4 @@ class ActionBaseTest extends d3ModCfgUnitTestCase
)
);
}
}
}

View File

@ -21,20 +21,21 @@ use D3\DataWizard\tests\tools\d3TestAction;
use D3\DataWizard\tests\tools\d3TestExport;
use D3\ModCfg\Tests\unit\d3ModCfgUnitTestCase;
use PHPUnit\Framework\MockObject\MockObject;
use ReflectionException;
class ConfigurationTest extends d3ModCfgUnitTestCase
{
/** @var Configuration */
protected $_oModel;
public function setUp() : void
public function setUp(): void
{
parent::setUp();
$this->_oModel = oxNew(Configuration::class);
}
public function tearDown() : void
public function tearDown(): void
{
parent::tearDown();
@ -44,7 +45,7 @@ class ConfigurationTest extends d3ModCfgUnitTestCase
/**
* @covers \D3\DataWizard\Application\Model\Configuration::__construct
* @test
* @throws \ReflectionException
* @throws ReflectionException
*/
public function canConstruct()
{
@ -65,7 +66,7 @@ class ConfigurationTest extends d3ModCfgUnitTestCase
/**
* @covers \D3\DataWizard\Application\Model\Configuration::configure()
* @test
* @throws \ReflectionException
* @throws ReflectionException
*/
public function canConfigure()
{
@ -80,7 +81,7 @@ class ConfigurationTest extends d3ModCfgUnitTestCase
/**
* @covers \D3\DataWizard\Application\Model\Configuration::registerAction
* @test
* @throws \ReflectionException
* @throws ReflectionException
*/
public function canRegisterAction()
{
@ -113,7 +114,7 @@ class ConfigurationTest extends d3ModCfgUnitTestCase
/**
* @covers \D3\DataWizard\Application\Model\Configuration::registerExport
* @test
* @throws \ReflectionException
* @throws ReflectionException
*/
public function canRegisterExport()
{
@ -147,16 +148,16 @@ class ConfigurationTest extends d3ModCfgUnitTestCase
* @param $array
* @return array|false
*/
public function array_flatten($array) {
public function array_flatten($array)
{
if (!is_array($array)) {
return false;
}
$result = array();
$result = [];
foreach ($array as $key => $value) {
if (is_array($value)) {
$result = array_merge($result, $this->array_flatten($value));
}
else {
} else {
$result[$key] = $value;
}
}
@ -166,7 +167,7 @@ class ConfigurationTest extends d3ModCfgUnitTestCase
/**
* @covers \D3\DataWizard\Application\Model\Configuration::getGroupedActions()
* @test
* @throws \ReflectionException
* @throws ReflectionException
*/
public function canGetGroupedActions()
{
@ -190,7 +191,7 @@ class ConfigurationTest extends d3ModCfgUnitTestCase
/**
* @covers \D3\DataWizard\Application\Model\Configuration::getGroupedExports()
* @test
* @throws \ReflectionException
* @throws ReflectionException
*/
public function canGetGroupedExports()
{
@ -214,7 +215,7 @@ class ConfigurationTest extends d3ModCfgUnitTestCase
/**
* @covers \D3\DataWizard\Application\Model\Configuration::getActionGroups()
* @test
* @throws \ReflectionException
* @throws ReflectionException
*/
public function canGetActionGroups()
{
@ -238,7 +239,7 @@ class ConfigurationTest extends d3ModCfgUnitTestCase
/**
* @covers \D3\DataWizard\Application\Model\Configuration::getExportGroups()
* @test
* @throws \ReflectionException
* @throws ReflectionException
*/
public function canGetExportGroups()
{
@ -262,7 +263,7 @@ class ConfigurationTest extends d3ModCfgUnitTestCase
/**
* @covers \D3\DataWizard\Application\Model\Configuration::getActionsByGroup()
* @test
* @throws \ReflectionException
* @throws ReflectionException
*/
public function canGetActionsByGroup()
{
@ -287,7 +288,7 @@ class ConfigurationTest extends d3ModCfgUnitTestCase
/**
* @covers \D3\DataWizard\Application\Model\Configuration::getExportsByGroup()
* @test
* @throws \ReflectionException
* @throws ReflectionException
*/
public function canGetExportsByGroup()
{
@ -312,7 +313,7 @@ class ConfigurationTest extends d3ModCfgUnitTestCase
/**
* @covers \D3\DataWizard\Application\Model\Configuration::getAllActions()
* @test
* @throws \ReflectionException
* @throws ReflectionException
*/
public function canGetAllActions()
{
@ -320,7 +321,7 @@ class ConfigurationTest extends d3ModCfgUnitTestCase
$modelMock = $this->getMockBuilder(Configuration::class)
->onlyMethods([
'getActionGroups',
'getActionsByGroup'
'getActionsByGroup',
])
->getMock();
$modelMock->expects($this->once())->method('getActionGroups')->willReturn(['123', '456']);
@ -343,7 +344,7 @@ class ConfigurationTest extends d3ModCfgUnitTestCase
/**
* @covers \D3\DataWizard\Application\Model\Configuration::getAllExports()
* @test
* @throws \ReflectionException
* @throws ReflectionException
*/
public function canGetAllExports()
{
@ -351,7 +352,7 @@ class ConfigurationTest extends d3ModCfgUnitTestCase
$modelMock = $this->getMockBuilder(Configuration::class)
->onlyMethods([
'getExportGroups',
'getExportsByGroup'
'getExportsByGroup',
])
->getMock();
$modelMock->expects($this->once())->method('getExportGroups')->willReturn(['123', '456']);
@ -374,7 +375,7 @@ class ConfigurationTest extends d3ModCfgUnitTestCase
/**
* @covers \D3\DataWizard\Application\Model\Configuration::getActionById()
* @test
* @throws \ReflectionException
* @throws ReflectionException
* @dataProvider canGetActionByIdDataProvider
*/
public function canGetActionById($id, $throwException)
@ -409,7 +410,7 @@ class ConfigurationTest extends d3ModCfgUnitTestCase
/**
* @covers \D3\DataWizard\Application\Model\Configuration::getExportById()
* @test
* @throws \ReflectionException
* @throws ReflectionException
* @dataProvider canGetActionByIdDataProvider
*/
public function canGetExportById($id, $throwException)
@ -451,4 +452,4 @@ class ConfigurationTest extends d3ModCfgUnitTestCase
'set id' => ['456', false],
];
}
}
}

View File

@ -17,7 +17,9 @@ namespace D3\DataWizard\tests\unit\Application\Model\Exceptions;
use D3\DataWizard\Application\Model\Exceptions\DebugException;
use D3\ModCfg\Tests\unit\d3ModCfgUnitTestCase;
use Exception;
use PHPUnit\Framework\MockObject\MockObject;
use ReflectionException;
class DebugExceptionTest extends d3ModCfgUnitTestCase
{
@ -27,13 +29,13 @@ class DebugExceptionTest extends d3ModCfgUnitTestCase
/**
* @covers \D3\DataWizard\Application\Model\Exceptions\DebugException::__construct
* @test
* @throws \ReflectionException
* @throws ReflectionException
*/
public function canConstruct()
{
$code = '500';
$exception = oxNew(\Exception::class);
$exception = oxNew(Exception::class);
/** @var DebugException|MockObject $modelMock */
$modelMock = $this->getMockBuilder(DebugException::class)
@ -72,5 +74,4 @@ class DebugExceptionTest extends d3ModCfgUnitTestCase
)
);
}
}
}

View File

@ -17,7 +17,9 @@ namespace D3\DataWizard\tests\unit\Application\Model\Exceptions;
use D3\DataWizard\Application\Model\Exceptions\ExportFileException;
use D3\ModCfg\Tests\unit\d3ModCfgUnitTestCase;
use Exception;
use PHPUnit\Framework\MockObject\MockObject;
use ReflectionException;
class ExportFileExceptionTest extends d3ModCfgUnitTestCase
{
@ -27,13 +29,13 @@ class ExportFileExceptionTest extends d3ModCfgUnitTestCase
/**
* @covers \D3\DataWizard\Application\Model\Exceptions\ExportFileException::__construct
* @test
* @throws \ReflectionException
* @throws ReflectionException
*/
public function canConstruct()
{
$code = '500';
$exception = oxNew(\Exception::class);
$exception = oxNew(Exception::class);
/** @var ExportFileException|MockObject $modelMock */
$modelMock = $this->getMockBuilder(ExportFileException::class)
@ -72,5 +74,4 @@ class ExportFileExceptionTest extends d3ModCfgUnitTestCase
)
);
}
}
}

View File

@ -19,8 +19,10 @@ use D3\DataWizard\Application\Model\Exceptions\InputUnvalidException;
use D3\DataWizard\Application\Model\ExportBase;
use D3\DataWizard\tests\tools\d3TestExport;
use D3\ModCfg\Tests\unit\d3ModCfgUnitTestCase;
use Exception;
use FormManager\Inputs\Number;
use PHPUnit\Framework\MockObject\MockObject;
use ReflectionException;
class InputUnvalidExceptionTest extends d3ModCfgUnitTestCase
{
@ -30,15 +32,14 @@ class InputUnvalidExceptionTest extends d3ModCfgUnitTestCase
/**
* @covers \D3\DataWizard\Application\Model\Exceptions\InputUnvalidException::__construct
* @test
* @throws \ReflectionException
* @throws ReflectionException
*/
public function canConstruct()
{
$code = '500';
$exception = oxNew(\Exception::class);
$exception = oxNew(Exception::class);
/** @var Number $invalidField */
$invalidField = new Number(null, [
'required' => true,
'min' => 1,
@ -92,5 +93,4 @@ class InputUnvalidExceptionTest extends d3ModCfgUnitTestCase
)
);
}
}
}

View File

@ -17,7 +17,9 @@ namespace D3\DataWizard\tests\unit\Application\Model\Exceptions;
use D3\DataWizard\Application\Model\Exceptions\NoSuitableRendererException;
use D3\ModCfg\Tests\unit\d3ModCfgUnitTestCase;
use Exception;
use PHPUnit\Framework\MockObject\MockObject;
use ReflectionException;
class NoSuitableRendererExceptionTest extends d3ModCfgUnitTestCase
{
@ -27,13 +29,13 @@ class NoSuitableRendererExceptionTest extends d3ModCfgUnitTestCase
/**
* @covers \D3\DataWizard\Application\Model\Exceptions\NoSuitableRendererException::__construct
* @test
* @throws \ReflectionException
* @throws ReflectionException
*/
public function canConstruct()
{
$code = '500';
$exception = oxNew(\Exception::class);
$exception = oxNew(Exception::class);
/** @var NoSuitableRendererException|MockObject $modelMock */
$modelMock = $this->getMockBuilder(NoSuitableRendererException::class)
@ -72,5 +74,4 @@ class NoSuitableRendererExceptionTest extends d3ModCfgUnitTestCase
)
);
}
}
}

View File

@ -19,7 +19,9 @@ use D3\DataWizard\Application\Model\Exceptions\TaskException;
use D3\DataWizard\Application\Model\ExportBase;
use D3\DataWizard\tests\tools\d3TestExport;
use D3\ModCfg\Tests\unit\d3ModCfgUnitTestCase;
use Exception;
use PHPUnit\Framework\MockObject\MockObject;
use ReflectionException;
class TaskExceptionTest extends d3ModCfgUnitTestCase
{
@ -29,13 +31,13 @@ class TaskExceptionTest extends d3ModCfgUnitTestCase
/**
* @covers \D3\DataWizard\Application\Model\Exceptions\TaskException::__construct
* @test
* @throws \ReflectionException
* @throws ReflectionException
*/
public function canConstruct()
{
$code = '500';
$exception = oxNew(\Exception::class);
$exception = oxNew(Exception::class);
/** @var ExportBase|MockObject $taskMock */
$taskMock = $this->getMockBuilder(d3TestExport::class)
@ -80,5 +82,4 @@ class TaskExceptionTest extends d3ModCfgUnitTestCase
)
);
}
}
}

View File

@ -36,14 +36,14 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
/** @var d3TestExport */
protected $_oModel;
public function setUp() : void
public function setUp(): void
{
parent::setUp();
$this->_oModel = oxNew(d3TestExport::class);
}
public function tearDown() : void
public function tearDown(): void
{
parent::tearDown();
@ -99,7 +99,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
);
}
public function canGetHasFormElementsDataProvider()
public function canGetHasFormElementsDataProvider(): array
{
return [
'hasFormElements' => [['abc', 'def'], true],
@ -140,7 +140,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
$inputMock = $this->getMockBuilder($inputClass)
->onlyMethods([
'setTemplate',
'setAttribute'
'setAttribute',
])
->getMock();
$inputMock->expects($this->atLeastOnce())->method('setTemplate');
@ -165,7 +165,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
return [
'Radio' => [Radio::class],
'Checkbox' => [Radio::class],
'Hidden' => [Hidden::class]
'Hidden' => [Hidden::class],
];
}
@ -183,7 +183,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
$modelMock = $this->getMockBuilder(d3TestExport::class)
->onlyMethods([
'hasFormElements',
'executeExport'
'executeExport',
])
->getMock();
$modelMock->expects($this->atLeastOnce())->method('hasFormElements')->willReturn(false);
@ -214,7 +214,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
->onlyMethods([
'hasFormElements',
'executeExport',
'getFormElements'
'getFormElements',
])
->getMock();
$modelMock->expects($this->atLeastOnce())->method('hasFormElements')->willReturn(true);
@ -256,7 +256,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
return [
'validElements' => [[$validMock, $validMock], false],
'invalidElements' => [[$validMock, $invalidField], true]
'invalidElements' => [[$validMock, $invalidField], true],
];
}
@ -274,7 +274,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
'startDirectDownload',
'filterFilename',
'trailingslashit',
'createFile'
'createFile',
])
->getMock();
$fsMock->expects($this->exactly((int) !isset($path)))->method('startDirectDownload')->willReturn(true);
@ -287,7 +287,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
->onlyMethods([
'getContent',
'getFileSystem',
'getExportFileName'
'getExportFileName',
])
->getMock();
$modelMock->expects($this->atLeastOnce())->method('getContent')->willReturn('some content');
@ -371,7 +371,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
/** @var d3TestExport|MockObject $modelMock */
$modelMock = $this->getMockBuilder(d3TestExport::class)
->onlyMethods([
'getRendererBridge'
'getRendererBridge',
])
->getMock();
$modelMock->expects($this->atLeastOnce())->method('getRendererBridge')->willReturn($rendererBridgeMock);
@ -425,7 +425,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
/** @var d3TestExport|MockObject $modelMock */
$modelMock = $this->getMockBuilder(d3TestExport::class)
->onlyMethods([
'getRenderer'
'getRenderer',
])
->getMock();
$modelMock->expects($this->atLeastOnce())->method('getRenderer')->with($format)->willReturn($rendererMock);
@ -463,7 +463,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
/** @var d3TestExport|MockObject $modelMock */
$modelMock = $this->getMockBuilder(d3TestExport::class)
->onlyMethods([
'getRenderer'
'getRenderer',
])
->getMock();
$modelMock->expects($this->atLeastOnce())->method('getRenderer')->with($format)->willReturn($rendererMock);
@ -490,7 +490,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
/** @var d3TestExport|MockObject $modelMock */
$modelMock = $this->getMockBuilder(d3TestExport::class)
->onlyMethods([
'getTitle'
'getTitle',
])
->getMock();
$modelMock->expects($this->atLeastOnce())->method('getTitle')->willReturn('someTitle');
@ -516,7 +516,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
$modelMock = $this->getMockBuilder(d3TestExport::class)
->onlyMethods([
'getExportFilenameBase',
'getFileExtension'
'getFileExtension',
])
->getMock();
$modelMock->expects($this->atLeastOnce())->method('getExportFilenameBase')->willReturn('base');
@ -551,7 +551,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
/** @var d3TestExport|MockObject $modelMock */
$modelMock = $this->getMockBuilder(d3TestExport::class)
->onlyMethods([
'd3GetDb'
'd3GetDb',
])
->getMock();
$modelMock->expects($this->exactly((int) !$throwsException))->method('d3GetDb')->willReturn($dbMock);
@ -570,13 +570,13 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
[
[
'field1' => 'content1',
'field2' => 'content2'
]
'field2' => 'content2',
],
],
[
'field1',
'field2'
]
'field2',
],
],
$result
);
@ -613,7 +613,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
->onlyMethods([
'getQuery',
'getExportData',
'renderContent'
'renderContent',
])
->getMock();
$modelMock->expects($this->atLeastOnce())->method('getQuery')->willReturn(['SELECT 1', ['arg1', 'arg2']]);
@ -631,4 +631,4 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
)
);
}
}
}

View File

@ -22,13 +22,14 @@ use League\Csv\Writer;
use OxidEsales\Eshop\Core\Config;
use OxidEsales\Eshop\Core\Registry;
use PHPUnit\Framework\MockObject\MockObject;
use ReflectionException;
class CsvTest extends ExportRendererTest
{
/** @var Csv */
protected $_oModel;
public function setUp() : void
public function setUp(): void
{
parent::setUp();
@ -38,7 +39,7 @@ class CsvTest extends ExportRendererTest
/**
* @covers \D3\DataWizard\Application\Model\ExportRenderer\Csv::getContent
* @test
* @throws \ReflectionException
* @throws ReflectionException
* @dataProvider canGetContentDataProvider
*/
public function canGetContent($blThrowException)
@ -50,23 +51,19 @@ class CsvTest extends ExportRendererTest
/** @var Writer|MockObject $csvMock */
$csvMockBuilder = $this->getMockBuilder(Writer::class);
$csvMockBuilder->disableOriginalConstructor();
$onlyMethods = ['insertOne', 'insertAll'];
if (method_exists($csvMockBuilder->getMock(), 'getContent')) {
$onlyMethods[] = 'getContent';
} else {
$csvMockBuilder->addMethods(['getContent']);
}
$onlyMethods = ['__toString', 'insertOne', 'insertAll'];
$csvMockBuilder->onlyMethods($onlyMethods);
$csvMock = $csvMockBuilder->getMock();
$csvMock->method('insertOne')->willReturn(1);
$csvMock->method('insertAll')->willReturn(1);
if ($blThrowException) {
$csvMock->expects($this->atLeastOnce())->method('getContent')->willThrowException(oxNew(Exception::class));
$csvMock->expects($this->atLeastOnce())->method('__toString')->willThrowException(oxNew(Exception::class));
$this->expectException(RenderException::class);
} else {
$csvMock->expects($this->atLeastOnce())->method('getContent')->willReturn($expected);
$csvMock->expects($this->atLeastOnce())->method('__toString')->willReturn($expected);
}
$csvMock->expects($this->atLeastOnce())->method('insertOne')->with($fieldList)->willReturn(1);
$csvMock->expects($this->atLeastOnce())->method('insertAll')->with($valueList)->willReturn(1);
/** @var Csv|MockObject $modelMock */
$modelMock = $this->getMockBuilder(Csv::class)
@ -92,14 +89,14 @@ class CsvTest extends ExportRendererTest
{
return [
'exception' => [true],
'no exception' => [false]
'no exception' => [false],
];
}
/**
* @covers \D3\DataWizard\Application\Model\ExportRenderer\Csv::getCsv
* @test
* @throws \ReflectionException
* @throws ReflectionException
*/
public function canGetCsv()
{
@ -115,7 +112,7 @@ class CsvTest extends ExportRendererTest
/**
* @covers \D3\DataWizard\Application\Model\ExportRenderer\Csv::getCsv
* @test
* @throws \ReflectionException
* @throws ReflectionException
*/
public function canGetCsvNoSettings()
{
@ -165,7 +162,7 @@ class CsvTest extends ExportRendererTest
/**
* @covers \D3\DataWizard\Application\Model\ExportRenderer\Csv::d3GetConfig
* @test
* @throws \ReflectionException
* @throws ReflectionException
*/
public function canGetConfig()
{
@ -177,4 +174,4 @@ class CsvTest extends ExportRendererTest
)
);
}
}
}

View File

@ -15,13 +15,14 @@ namespace D3\DataWizard\tests\unit\Application\Model\ExportRenderer;
use D3\DataWizard\Application\Model\ExportRenderer\RendererInterface;
use D3\ModCfg\Tests\unit\d3ModCfgUnitTestCase;
use ReflectionException;
abstract class ExportRendererTest extends d3ModCfgUnitTestCase
{
/** @var RendererInterface */
protected $_oModel;
public function tearDown() : void
public function tearDown(): void
{
parent::tearDown();
@ -33,7 +34,7 @@ abstract class ExportRendererTest extends d3ModCfgUnitTestCase
* @covers \D3\DataWizard\Application\Model\ExportRenderer\Json::getFileExtension
* @covers \D3\DataWizard\Application\Model\ExportRenderer\Pretty::getFileExtension
* @test
* @throws \ReflectionException
* @throws ReflectionException
*/
public function canGetFileExtension()
{
@ -51,7 +52,7 @@ abstract class ExportRendererTest extends d3ModCfgUnitTestCase
* @covers \D3\DataWizard\Application\Model\ExportRenderer\Json::getTitleTranslationId
* @covers \D3\DataWizard\Application\Model\ExportRenderer\Pretty::getTitleTranslationId
* @test
* @throws \ReflectionException
* @throws ReflectionException
*/
public function canGetTitleTranslationId()
{
@ -62,4 +63,4 @@ abstract class ExportRendererTest extends d3ModCfgUnitTestCase
)
);
}
}
}

View File

@ -17,13 +17,14 @@ namespace D3\DataWizard\tests\unit\Application\Model\ExportRenderer;
use D3\DataWizard\Application\Model\Exceptions\RenderException;
use D3\DataWizard\Application\Model\ExportRenderer\Json;
use ReflectionException;
class JsonTest extends ExportRendererTest
{
/** @var Json */
protected $_oModel;
public function setUp() : void
public function setUp(): void
{
parent::setUp();
@ -33,7 +34,7 @@ class JsonTest extends ExportRendererTest
/**
* @covers \D3\DataWizard\Application\Model\ExportRenderer\Json::getContent
* @test
* @throws \ReflectionException
* @throws ReflectionException
* @dataProvider canGetContentDataProvider
*/
public function canGetContent($valueList, $expectException)
@ -60,7 +61,7 @@ class JsonTest extends ExportRendererTest
{
return [
'valid' => [['value1', 'value2'], false],
'invalid' => [["text" => "\xB1\x31"], true] // malformed UTF8 chars
'invalid' => [["text" => "\xB1\x31"], true], // malformed UTF8 chars
];
}
}
}

View File

@ -18,13 +18,14 @@ namespace D3\DataWizard\tests\unit\Application\Model\ExportRenderer;
use D3\DataWizard\Application\Model\ExportRenderer\Pretty;
use MathieuViossat\Util\ArrayToTextTable;
use PHPUnit\Framework\MockObject\MockObject;
use ReflectionException;
class PrettyTest extends ExportRendererTest
{
/** @var Pretty */
protected $_oModel;
public function setUp() : void
public function setUp(): void
{
parent::setUp();
@ -34,7 +35,7 @@ class PrettyTest extends ExportRendererTest
/**
* @covers \D3\DataWizard\Application\Model\ExportRenderer\Pretty::getContent
* @test
* @throws \ReflectionException
* @throws ReflectionException
*/
public function canGetContent()
{
@ -69,7 +70,7 @@ class PrettyTest extends ExportRendererTest
/**
* @covers \D3\DataWizard\Application\Model\ExportRenderer\Pretty::getArrayToTextTableInstance
* @test
* @throws \ReflectionException
* @throws ReflectionException
*/
public function canGetArrayToTextTableInstance()
{
@ -82,4 +83,4 @@ class PrettyTest extends ExportRendererTest
)
);
}
}
}

View File

@ -23,13 +23,14 @@ use D3\DataWizard\Application\Model\ExportRenderer\RendererBridge;
use D3\DataWizard\Application\Model\ExportRenderer\RendererInterface;
use D3\ModCfg\Tests\unit\d3ModCfgUnitTestCase;
use PHPUnit\Framework\MockObject\MockObject;
use ReflectionException;
class RendererBridgeTest extends d3ModCfgUnitTestCase
{
/** @var RendererBridge */
protected $_oModel;
public function setUp() : void
public function setUp(): void
{
parent::setUp();
@ -46,7 +47,7 @@ class RendererBridgeTest extends d3ModCfgUnitTestCase
/**
* @covers \D3\DataWizard\Application\Model\ExportRenderer\RendererBridge::getRendererList
* @test
* @throws \ReflectionException
* @throws ReflectionException
*/
public function canGetRendererList()
{
@ -62,7 +63,7 @@ class RendererBridgeTest extends d3ModCfgUnitTestCase
/**
* @covers \D3\DataWizard\Application\Model\ExportRenderer\RendererBridge::getTranslatedRendererIdList
* @test
* @throws \ReflectionException
* @throws ReflectionException
*/
public function canGetTranslatedRendererIdList()
{
@ -84,7 +85,7 @@ class RendererBridgeTest extends d3ModCfgUnitTestCase
/**
* @covers \D3\DataWizard\Application\Model\ExportRenderer\RendererBridge::translateRendererId
* @test
* @throws \ReflectionException
* @throws ReflectionException
*/
public function canTranslateRendererId()
{
@ -108,7 +109,7 @@ class RendererBridgeTest extends d3ModCfgUnitTestCase
* @test
* @param $format
* @param $blThrowException
* @throws \ReflectionException
* @throws ReflectionException
* @dataProvider canGetRendererDataProvider
*/
public function canGetRenderer($format, $blThrowException)
@ -121,7 +122,7 @@ class RendererBridgeTest extends d3ModCfgUnitTestCase
[
'CSV' => $this->getMockBuilder(Csv::class)->getMock(),
'Pretty' => $this->getMockBuilder(Pretty::class)->getMock(),
'JSON' => $this->getMockBuilder(Json::class)->getMock()
'JSON' => $this->getMockBuilder(Json::class)->getMock(),
]
);
@ -145,7 +146,7 @@ class RendererBridgeTest extends d3ModCfgUnitTestCase
{
return [
'existing renderer'=> [RendererBridge::FORMAT_JSON, false],
'unknown renderer'=> ['unknownRenderer', true]
'unknown renderer'=> ['unknownRenderer', true],
];
}
}
}