8
0
Fork 0

Commits vergleichen

...

14 Commits

49 geänderte Dateien mit 329 neuen und 243 gelöschten Zeilen

5
.gitattributes vendored Normale Datei
Datei anzeigen

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

1
.gitignore vendored Normale Datei
Datei anzeigen

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

13
.php-cs-fixer.php Normale Datei
Datei anzeigen

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

Datei anzeigen

@ -19,13 +19,13 @@ use D3\DataWizard\Application\Model\Exceptions\DataWizardException;
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 = [];

Datei anzeigen

@ -43,7 +43,7 @@ class InputUnvalidException extends DataWizardException
' - ',
[
$task->getTitle(),
implode(', ', $messages)
implode(', ', $messages),
]
);
parent::__construct($sMessage, $iCode, $previous);

Datei anzeigen

@ -29,7 +29,7 @@ class TaskException extends DataWizardException
' - ',
[
$task->getTitle(),
$sMessage
$sMessage,
]
);
parent::__construct($sMessage, $iCode, $previous);

Datei anzeigen

@ -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,7 +31,7 @@ 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),
];
}

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

@ -1,64 +1,65 @@
# Changelog
All notable changes to this project will be documented in this file.
## 2.1.0.0 (2021-12-21)
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).
#### Changed
## [Unreleased](https://git.d3data.de/D3Public/DataWizard/compare/2.1.1.0...rel_2.x)
## [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
### Changed
- documentation extended
## [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
---
## 2.0.0.0 (2021-12-20)
#### Added
## [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
#### Changed
### Changed
- adjust code to PHP 7.3 and up
---
## 1.4.0.0 (2021-11-11)
#### 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

Datei anzeigen

@ -9,13 +9,26 @@ 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:^2.0
@ -23,6 +36,12 @@ 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)

Datei anzeigen

@ -9,13 +9,27 @@ 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:^2.0
@ -23,6 +37,12 @@ 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)

Datei anzeigen

@ -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",
@ -26,10 +26,11 @@
],
"require": {
"php": ">=7.3",
"oxid-esales/oxideshop-ce": "6.8 - 6.10",
"oxid-esales/oxideshop-ce": "6.8 - 6.13",
"league/csv": "^9.0",
"mathieuviossat/arraytotexttable": "^1.0",
"form-manager/form-manager": "^6.1"
"form-manager/form-manager": "^6.1",
"d3/modcfg": "^6.0"
},
"extra": {
"oxideshop": {

Datei anzeigen

@ -32,13 +32,13 @@ $aModule = [
'en' => '',
],
'thumbnail' => '',
'version' => '2.1.0.0',
'version' => '2.1.1.0',
'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' => [],
];

Datei anzeigen

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

Datei anzeigen

@ -12,4 +12,3 @@
*/
const D3DATAWIZARD_REQUIRE_MODCFG = true;

Datei anzeigen

@ -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']]);

Datei anzeigen

@ -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']]);

Datei anzeigen

@ -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']]);

Datei anzeigen

@ -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],
];
}

Datei anzeigen

@ -148,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;
}
}
@ -321,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']);
@ -352,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']);

Datei anzeigen

@ -74,5 +74,4 @@ class DebugExceptionTest extends d3ModCfgUnitTestCase
)
);
}
}

Datei anzeigen

@ -74,5 +74,4 @@ class ExportFileExceptionTest extends d3ModCfgUnitTestCase
)
);
}
}

Datei anzeigen

@ -93,5 +93,4 @@ class InputUnvalidExceptionTest extends d3ModCfgUnitTestCase
)
);
}
}

Datei anzeigen

@ -74,5 +74,4 @@ class NoSuitableRendererExceptionTest extends d3ModCfgUnitTestCase
)
);
}
}

Datei anzeigen

@ -82,5 +82,4 @@ class TaskExceptionTest extends d3ModCfgUnitTestCase
)
);
}
}

Datei anzeigen

@ -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']]);

Datei anzeigen

@ -89,7 +89,7 @@ class CsvTest extends ExportRendererTest
{
return [
'exception' => [true],
'no exception' => [false]
'no exception' => [false],
];
}

Datei anzeigen

@ -61,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
];
}
}

Datei anzeigen

@ -122,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(),
]
);
@ -146,7 +146,7 @@ class RendererBridgeTest extends d3ModCfgUnitTestCase
{
return [
'existing renderer'=> [RendererBridge::FORMAT_JSON, false],
'unknown renderer'=> ['unknownRenderer', true]
'unknown renderer'=> ['unknownRenderer', true],
];
}
}