add CS-fixed files
This commit is contained in:
parent
51642b57c7
commit
0c0d564554
@ -19,13 +19,13 @@ use D3\DataWizard\Application\Model\Exceptions\DataWizardException;
|
|||||||
|
|
||||||
class Configuration
|
class Configuration
|
||||||
{
|
{
|
||||||
const GROUP_SHOP = 'D3_DATAWIZARD_GROUP_SHOP';
|
public const GROUP_SHOP = 'D3_DATAWIZARD_GROUP_SHOP';
|
||||||
const GROUP_CATEGORY = 'D3_DATAWIZARD_GROUP_CATEGORIES';
|
public const GROUP_CATEGORY = 'D3_DATAWIZARD_GROUP_CATEGORIES';
|
||||||
const GROUP_ARTICLES = 'D3_DATAWIZARD_GROUP_ARTICLES';
|
public const GROUP_ARTICLES = 'D3_DATAWIZARD_GROUP_ARTICLES';
|
||||||
const GROUP_USERS = 'D3_DATAWIZARD_GROUP_USERS';
|
public const GROUP_USERS = 'D3_DATAWIZARD_GROUP_USERS';
|
||||||
const GROUP_ORDERS = 'D3_DATAWIZARD_GROUP_ORDERS';
|
public const GROUP_ORDERS = 'D3_DATAWIZARD_GROUP_ORDERS';
|
||||||
const GROUP_REMARKS = 'D3_DATAWIZARD_GROUP_REMARKS';
|
public const GROUP_REMARKS = 'D3_DATAWIZARD_GROUP_REMARKS';
|
||||||
const GROUP_CMS = 'D3_DATAWIZARD_GROUP_CMS';
|
public const GROUP_CMS = 'D3_DATAWIZARD_GROUP_CMS';
|
||||||
|
|
||||||
protected $actions = [];
|
protected $actions = [];
|
||||||
protected $exports = [];
|
protected $exports = [];
|
||||||
|
@ -43,7 +43,7 @@ class InputUnvalidException extends DataWizardException
|
|||||||
' - ',
|
' - ',
|
||||||
[
|
[
|
||||||
$task->getTitle(),
|
$task->getTitle(),
|
||||||
implode(', ', $messages)
|
implode(', ', $messages),
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
parent::__construct($sMessage, $iCode, $previous);
|
parent::__construct($sMessage, $iCode, $previous);
|
||||||
|
@ -29,7 +29,7 @@ class TaskException extends DataWizardException
|
|||||||
' - ',
|
' - ',
|
||||||
[
|
[
|
||||||
$task->getTitle(),
|
$task->getTitle(),
|
||||||
$sMessage
|
$sMessage,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
parent::__construct($sMessage, $iCode, $previous);
|
parent::__construct($sMessage, $iCode, $previous);
|
||||||
|
@ -19,9 +19,9 @@ use D3\DataWizard\Application\Model\Exceptions\NoSuitableRendererException;
|
|||||||
|
|
||||||
class RendererBridge
|
class RendererBridge
|
||||||
{
|
{
|
||||||
const FORMAT_CSV = 'CSV';
|
public const FORMAT_CSV = 'CSV';
|
||||||
const FORMAT_PRETTY = 'Pretty';
|
public const FORMAT_PRETTY = 'Pretty';
|
||||||
const FORMAT_JSON = 'JSON';
|
public const FORMAT_JSON = 'JSON';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array
|
* @return array
|
||||||
@ -31,7 +31,7 @@ class RendererBridge
|
|||||||
return [
|
return [
|
||||||
self::FORMAT_CSV => oxNew(Csv::class),
|
self::FORMAT_CSV => oxNew(Csv::class),
|
||||||
self::FORMAT_PRETTY => oxNew(Pretty::class),
|
self::FORMAT_PRETTY => oxNew(Pretty::class),
|
||||||
self::FORMAT_JSON => oxNew(Json::class)
|
self::FORMAT_JSON => oxNew(Json::class),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ $sLangName = "Deutsch";
|
|||||||
// -------------------------------
|
// -------------------------------
|
||||||
// RESOURCE IDENTITFIER = STRING
|
// RESOURCE IDENTITFIER = STRING
|
||||||
// -------------------------------
|
// -------------------------------
|
||||||
$aLang = array(
|
$aLang = [
|
||||||
|
|
||||||
//Navigation
|
//Navigation
|
||||||
'charset' => 'UTF-8',
|
'charset' => 'UTF-8',
|
||||||
@ -55,4 +55,4 @@ $aLang = array(
|
|||||||
'D3_DATAWIZARD_ERR_NOACTION_INSTALLED' => 'Es sind keine Aktionen installiert oder aktiviert.',
|
'D3_DATAWIZARD_ERR_NOACTION_INSTALLED' => 'Es sind keine Aktionen installiert oder aktiviert.',
|
||||||
'D3_DATAWIZARD_ERR_ACTIONRESULT' => '%1$s Eintrag verändert',
|
'D3_DATAWIZARD_ERR_ACTIONRESULT' => '%1$s Eintrag verändert',
|
||||||
'D3_DATAWIZARD_ERR_ACTIONRESULTS' => '%1$s Einträge verändert',
|
'D3_DATAWIZARD_ERR_ACTIONRESULTS' => '%1$s Einträge verändert',
|
||||||
);
|
];
|
||||||
|
@ -17,7 +17,7 @@ $sLangName = "English";
|
|||||||
// -------------------------------
|
// -------------------------------
|
||||||
// RESOURCE IDENTITFIER = STRING
|
// RESOURCE IDENTITFIER = STRING
|
||||||
// -------------------------------
|
// -------------------------------
|
||||||
$aLang = array(
|
$aLang = [
|
||||||
|
|
||||||
//Navigation
|
//Navigation
|
||||||
'charset' => 'UTF-8',
|
'charset' => 'UTF-8',
|
||||||
@ -55,4 +55,4 @@ $aLang = array(
|
|||||||
'D3_DATAWIZARD_ERR_NOACTION_INSTALLED' => 'No actions are installed or activated.',
|
'D3_DATAWIZARD_ERR_NOACTION_INSTALLED' => 'No actions are installed or activated.',
|
||||||
'D3_DATAWIZARD_ERR_ACTIONRESULT' => '%1$s entry changed',
|
'D3_DATAWIZARD_ERR_ACTIONRESULT' => '%1$s entry changed',
|
||||||
'D3_DATAWIZARD_ERR_ACTIONRESULTS' => '%1$s entries changed',
|
'D3_DATAWIZARD_ERR_ACTIONRESULTS' => '%1$s entries changed',
|
||||||
);
|
];
|
||||||
|
@ -38,7 +38,7 @@ $aModule = [
|
|||||||
'url' => 'https://www.oxidmodule.com/',
|
'url' => 'https://www.oxidmodule.com/',
|
||||||
'controllers' => [
|
'controllers' => [
|
||||||
'd3ExportWizard' => D3\DataWizard\Application\Controller\Admin\d3ExportWizard::class,
|
'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' => [],
|
'extend' => [],
|
||||||
'events' => [],
|
'events' => [],
|
||||||
@ -54,8 +54,8 @@ $aModule = [
|
|||||||
'group' => $sModuleId.'_general',
|
'group' => $sModuleId.'_general',
|
||||||
'name' => $sModuleId.'_debug',
|
'name' => $sModuleId.'_debug',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'value' => false
|
'value' => false,
|
||||||
]
|
|
||||||
],
|
],
|
||||||
'blocks' => []
|
],
|
||||||
|
'blocks' => [],
|
||||||
];
|
];
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Include datawizard test config
|
// Include datawizard test config
|
||||||
|
|
||||||
namespace D3\DataWizard\tests;
|
namespace D3\DataWizard\tests;
|
||||||
|
|
||||||
use D3\ModCfg\Tests\additional_abstract;
|
use D3\ModCfg\Tests\additional_abstract;
|
||||||
@ -36,4 +37,5 @@ class additional extends additional_abstract
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
d3GetModCfgDIC()->get(additional::class);
|
d3GetModCfgDIC()->get(additional::class);
|
||||||
} catch (Exception $e) {}
|
} catch (Exception $e) {
|
||||||
|
}
|
||||||
|
@ -12,4 +12,3 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const D3DATAWIZARD_REQUIRE_MODCFG = true;
|
const D3DATAWIZARD_REQUIRE_MODCFG = true;
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ class d3ActionWizardTest extends d3AdminControllerTest
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
['test1'],
|
['test1'],
|
||||||
['test2']
|
['test2'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,7 +144,7 @@ class d3ActionWizardTest extends d3AdminControllerTest
|
|||||||
$actionMock = $this->getMockBuilder(d3TestAction::class)
|
$actionMock = $this->getMockBuilder(d3TestAction::class)
|
||||||
->onlyMethods([
|
->onlyMethods([
|
||||||
'getQuery',
|
'getQuery',
|
||||||
'run'
|
'run',
|
||||||
])
|
])
|
||||||
->getMock();
|
->getMock();
|
||||||
$actionMock->expects($this->atLeastOnce())->method('getQuery')->willReturn(['SELECT 1', ['1']]);
|
$actionMock->expects($this->atLeastOnce())->method('getQuery')->willReturn(['SELECT 1', ['1']]);
|
||||||
|
@ -169,7 +169,7 @@ abstract class d3AdminControllerTest extends d3ModCfgUnitTestCase
|
|||||||
$actionMock = $this->getMockBuilder(d3TestAction::class)
|
$actionMock = $this->getMockBuilder(d3TestAction::class)
|
||||||
->onlyMethods([
|
->onlyMethods([
|
||||||
'getQuery',
|
'getQuery',
|
||||||
'run'
|
'run',
|
||||||
])
|
])
|
||||||
->getMock();
|
->getMock();
|
||||||
$actionMock->expects($this->atLeastOnce())->method('getQuery')->willReturn(['SELECT 1', ['1']]);
|
$actionMock->expects($this->atLeastOnce())->method('getQuery')->willReturn(['SELECT 1', ['1']]);
|
||||||
|
@ -100,7 +100,7 @@ class d3ExportWizardTest extends d3AdminControllerTest
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
['test1'],
|
['test1'],
|
||||||
['test2']
|
['test2'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,7 +146,7 @@ class d3ExportWizardTest extends d3AdminControllerTest
|
|||||||
$exportMock = $this->getMockBuilder(d3TestExport::class)
|
$exportMock = $this->getMockBuilder(d3TestExport::class)
|
||||||
->onlyMethods([
|
->onlyMethods([
|
||||||
'getQuery',
|
'getQuery',
|
||||||
'run'
|
'run',
|
||||||
])
|
])
|
||||||
->getMock();
|
->getMock();
|
||||||
$exportMock->expects($this->atLeastOnce())->method('getQuery')->willReturn(['SELECT 1', ['1']]);
|
$exportMock->expects($this->atLeastOnce())->method('getQuery')->willReturn(['SELECT 1', ['1']]);
|
||||||
|
@ -135,7 +135,7 @@ class ActionBaseTest extends d3ModCfgUnitTestCase
|
|||||||
$inputMock = $this->getMockBuilder($inputClass)
|
$inputMock = $this->getMockBuilder($inputClass)
|
||||||
->onlyMethods([
|
->onlyMethods([
|
||||||
'setTemplate',
|
'setTemplate',
|
||||||
'setAttribute'
|
'setAttribute',
|
||||||
])
|
])
|
||||||
->getMock();
|
->getMock();
|
||||||
$inputMock->expects($this->atLeastOnce())->method('setTemplate');
|
$inputMock->expects($this->atLeastOnce())->method('setTemplate');
|
||||||
@ -160,7 +160,7 @@ class ActionBaseTest extends d3ModCfgUnitTestCase
|
|||||||
return [
|
return [
|
||||||
'Radio' => [Radio::class],
|
'Radio' => [Radio::class],
|
||||||
'Checkbox' => [Radio::class],
|
'Checkbox' => [Radio::class],
|
||||||
'Hidden' => [Hidden::class]
|
'Hidden' => [Hidden::class],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,7 +175,7 @@ class ActionBaseTest extends d3ModCfgUnitTestCase
|
|||||||
->onlyMethods([
|
->onlyMethods([
|
||||||
'hasFormElements',
|
'hasFormElements',
|
||||||
'executeAction',
|
'executeAction',
|
||||||
'getQuery'
|
'getQuery',
|
||||||
])
|
])
|
||||||
->getMock();
|
->getMock();
|
||||||
$modelMock->expects($this->atLeastOnce())->method('hasFormElements')->willReturn(false);
|
$modelMock->expects($this->atLeastOnce())->method('hasFormElements')->willReturn(false);
|
||||||
@ -204,7 +204,7 @@ class ActionBaseTest extends d3ModCfgUnitTestCase
|
|||||||
'hasFormElements',
|
'hasFormElements',
|
||||||
'executeAction',
|
'executeAction',
|
||||||
'getQuery',
|
'getQuery',
|
||||||
'getFormElements'
|
'getFormElements',
|
||||||
])
|
])
|
||||||
->getMock();
|
->getMock();
|
||||||
$modelMock->expects($this->atLeastOnce())->method('hasFormElements')->willReturn(true);
|
$modelMock->expects($this->atLeastOnce())->method('hasFormElements')->willReturn(true);
|
||||||
@ -246,7 +246,7 @@ class ActionBaseTest extends d3ModCfgUnitTestCase
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
'validElements' => [[$validMock, $validMock], false],
|
'validElements' => [[$validMock, $validMock], false],
|
||||||
'invalidElements' => [[$validMock, $invalidField], true]
|
'invalidElements' => [[$validMock, $invalidField], true],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,16 +148,16 @@ class ConfigurationTest extends d3ModCfgUnitTestCase
|
|||||||
* @param $array
|
* @param $array
|
||||||
* @return array|false
|
* @return array|false
|
||||||
*/
|
*/
|
||||||
public function array_flatten($array) {
|
public function array_flatten($array)
|
||||||
|
{
|
||||||
if (!is_array($array)) {
|
if (!is_array($array)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$result = array();
|
$result = [];
|
||||||
foreach ($array as $key => $value) {
|
foreach ($array as $key => $value) {
|
||||||
if (is_array($value)) {
|
if (is_array($value)) {
|
||||||
$result = array_merge($result, $this->array_flatten($value));
|
$result = array_merge($result, $this->array_flatten($value));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$result[$key] = $value;
|
$result[$key] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -321,7 +321,7 @@ class ConfigurationTest extends d3ModCfgUnitTestCase
|
|||||||
$modelMock = $this->getMockBuilder(Configuration::class)
|
$modelMock = $this->getMockBuilder(Configuration::class)
|
||||||
->onlyMethods([
|
->onlyMethods([
|
||||||
'getActionGroups',
|
'getActionGroups',
|
||||||
'getActionsByGroup'
|
'getActionsByGroup',
|
||||||
])
|
])
|
||||||
->getMock();
|
->getMock();
|
||||||
$modelMock->expects($this->once())->method('getActionGroups')->willReturn(['123', '456']);
|
$modelMock->expects($this->once())->method('getActionGroups')->willReturn(['123', '456']);
|
||||||
@ -352,7 +352,7 @@ class ConfigurationTest extends d3ModCfgUnitTestCase
|
|||||||
$modelMock = $this->getMockBuilder(Configuration::class)
|
$modelMock = $this->getMockBuilder(Configuration::class)
|
||||||
->onlyMethods([
|
->onlyMethods([
|
||||||
'getExportGroups',
|
'getExportGroups',
|
||||||
'getExportsByGroup'
|
'getExportsByGroup',
|
||||||
])
|
])
|
||||||
->getMock();
|
->getMock();
|
||||||
$modelMock->expects($this->once())->method('getExportGroups')->willReturn(['123', '456']);
|
$modelMock->expects($this->once())->method('getExportGroups')->willReturn(['123', '456']);
|
||||||
|
@ -74,5 +74,4 @@ class DebugExceptionTest extends d3ModCfgUnitTestCase
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -74,5 +74,4 @@ class ExportFileExceptionTest extends d3ModCfgUnitTestCase
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -93,5 +93,4 @@ class InputUnvalidExceptionTest extends d3ModCfgUnitTestCase
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -74,5 +74,4 @@ class NoSuitableRendererExceptionTest extends d3ModCfgUnitTestCase
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -82,5 +82,4 @@ class TaskExceptionTest extends d3ModCfgUnitTestCase
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -140,7 +140,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
|
|||||||
$inputMock = $this->getMockBuilder($inputClass)
|
$inputMock = $this->getMockBuilder($inputClass)
|
||||||
->onlyMethods([
|
->onlyMethods([
|
||||||
'setTemplate',
|
'setTemplate',
|
||||||
'setAttribute'
|
'setAttribute',
|
||||||
])
|
])
|
||||||
->getMock();
|
->getMock();
|
||||||
$inputMock->expects($this->atLeastOnce())->method('setTemplate');
|
$inputMock->expects($this->atLeastOnce())->method('setTemplate');
|
||||||
@ -165,7 +165,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
|
|||||||
return [
|
return [
|
||||||
'Radio' => [Radio::class],
|
'Radio' => [Radio::class],
|
||||||
'Checkbox' => [Radio::class],
|
'Checkbox' => [Radio::class],
|
||||||
'Hidden' => [Hidden::class]
|
'Hidden' => [Hidden::class],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -183,7 +183,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
|
|||||||
$modelMock = $this->getMockBuilder(d3TestExport::class)
|
$modelMock = $this->getMockBuilder(d3TestExport::class)
|
||||||
->onlyMethods([
|
->onlyMethods([
|
||||||
'hasFormElements',
|
'hasFormElements',
|
||||||
'executeExport'
|
'executeExport',
|
||||||
])
|
])
|
||||||
->getMock();
|
->getMock();
|
||||||
$modelMock->expects($this->atLeastOnce())->method('hasFormElements')->willReturn(false);
|
$modelMock->expects($this->atLeastOnce())->method('hasFormElements')->willReturn(false);
|
||||||
@ -214,7 +214,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
|
|||||||
->onlyMethods([
|
->onlyMethods([
|
||||||
'hasFormElements',
|
'hasFormElements',
|
||||||
'executeExport',
|
'executeExport',
|
||||||
'getFormElements'
|
'getFormElements',
|
||||||
])
|
])
|
||||||
->getMock();
|
->getMock();
|
||||||
$modelMock->expects($this->atLeastOnce())->method('hasFormElements')->willReturn(true);
|
$modelMock->expects($this->atLeastOnce())->method('hasFormElements')->willReturn(true);
|
||||||
@ -256,7 +256,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
'validElements' => [[$validMock, $validMock], false],
|
'validElements' => [[$validMock, $validMock], false],
|
||||||
'invalidElements' => [[$validMock, $invalidField], true]
|
'invalidElements' => [[$validMock, $invalidField], true],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -274,7 +274,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
|
|||||||
'startDirectDownload',
|
'startDirectDownload',
|
||||||
'filterFilename',
|
'filterFilename',
|
||||||
'trailingslashit',
|
'trailingslashit',
|
||||||
'createFile'
|
'createFile',
|
||||||
])
|
])
|
||||||
->getMock();
|
->getMock();
|
||||||
$fsMock->expects($this->exactly((int) !isset($path)))->method('startDirectDownload')->willReturn(true);
|
$fsMock->expects($this->exactly((int) !isset($path)))->method('startDirectDownload')->willReturn(true);
|
||||||
@ -287,7 +287,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
|
|||||||
->onlyMethods([
|
->onlyMethods([
|
||||||
'getContent',
|
'getContent',
|
||||||
'getFileSystem',
|
'getFileSystem',
|
||||||
'getExportFileName'
|
'getExportFileName',
|
||||||
])
|
])
|
||||||
->getMock();
|
->getMock();
|
||||||
$modelMock->expects($this->atLeastOnce())->method('getContent')->willReturn('some content');
|
$modelMock->expects($this->atLeastOnce())->method('getContent')->willReturn('some content');
|
||||||
@ -371,7 +371,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
|
|||||||
/** @var d3TestExport|MockObject $modelMock */
|
/** @var d3TestExport|MockObject $modelMock */
|
||||||
$modelMock = $this->getMockBuilder(d3TestExport::class)
|
$modelMock = $this->getMockBuilder(d3TestExport::class)
|
||||||
->onlyMethods([
|
->onlyMethods([
|
||||||
'getRendererBridge'
|
'getRendererBridge',
|
||||||
])
|
])
|
||||||
->getMock();
|
->getMock();
|
||||||
$modelMock->expects($this->atLeastOnce())->method('getRendererBridge')->willReturn($rendererBridgeMock);
|
$modelMock->expects($this->atLeastOnce())->method('getRendererBridge')->willReturn($rendererBridgeMock);
|
||||||
@ -425,7 +425,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
|
|||||||
/** @var d3TestExport|MockObject $modelMock */
|
/** @var d3TestExport|MockObject $modelMock */
|
||||||
$modelMock = $this->getMockBuilder(d3TestExport::class)
|
$modelMock = $this->getMockBuilder(d3TestExport::class)
|
||||||
->onlyMethods([
|
->onlyMethods([
|
||||||
'getRenderer'
|
'getRenderer',
|
||||||
])
|
])
|
||||||
->getMock();
|
->getMock();
|
||||||
$modelMock->expects($this->atLeastOnce())->method('getRenderer')->with($format)->willReturn($rendererMock);
|
$modelMock->expects($this->atLeastOnce())->method('getRenderer')->with($format)->willReturn($rendererMock);
|
||||||
@ -463,7 +463,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
|
|||||||
/** @var d3TestExport|MockObject $modelMock */
|
/** @var d3TestExport|MockObject $modelMock */
|
||||||
$modelMock = $this->getMockBuilder(d3TestExport::class)
|
$modelMock = $this->getMockBuilder(d3TestExport::class)
|
||||||
->onlyMethods([
|
->onlyMethods([
|
||||||
'getRenderer'
|
'getRenderer',
|
||||||
])
|
])
|
||||||
->getMock();
|
->getMock();
|
||||||
$modelMock->expects($this->atLeastOnce())->method('getRenderer')->with($format)->willReturn($rendererMock);
|
$modelMock->expects($this->atLeastOnce())->method('getRenderer')->with($format)->willReturn($rendererMock);
|
||||||
@ -490,7 +490,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
|
|||||||
/** @var d3TestExport|MockObject $modelMock */
|
/** @var d3TestExport|MockObject $modelMock */
|
||||||
$modelMock = $this->getMockBuilder(d3TestExport::class)
|
$modelMock = $this->getMockBuilder(d3TestExport::class)
|
||||||
->onlyMethods([
|
->onlyMethods([
|
||||||
'getTitle'
|
'getTitle',
|
||||||
])
|
])
|
||||||
->getMock();
|
->getMock();
|
||||||
$modelMock->expects($this->atLeastOnce())->method('getTitle')->willReturn('someTitle');
|
$modelMock->expects($this->atLeastOnce())->method('getTitle')->willReturn('someTitle');
|
||||||
@ -516,7 +516,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
|
|||||||
$modelMock = $this->getMockBuilder(d3TestExport::class)
|
$modelMock = $this->getMockBuilder(d3TestExport::class)
|
||||||
->onlyMethods([
|
->onlyMethods([
|
||||||
'getExportFilenameBase',
|
'getExportFilenameBase',
|
||||||
'getFileExtension'
|
'getFileExtension',
|
||||||
])
|
])
|
||||||
->getMock();
|
->getMock();
|
||||||
$modelMock->expects($this->atLeastOnce())->method('getExportFilenameBase')->willReturn('base');
|
$modelMock->expects($this->atLeastOnce())->method('getExportFilenameBase')->willReturn('base');
|
||||||
@ -551,7 +551,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
|
|||||||
/** @var d3TestExport|MockObject $modelMock */
|
/** @var d3TestExport|MockObject $modelMock */
|
||||||
$modelMock = $this->getMockBuilder(d3TestExport::class)
|
$modelMock = $this->getMockBuilder(d3TestExport::class)
|
||||||
->onlyMethods([
|
->onlyMethods([
|
||||||
'd3GetDb'
|
'd3GetDb',
|
||||||
])
|
])
|
||||||
->getMock();
|
->getMock();
|
||||||
$modelMock->expects($this->exactly((int) !$throwsException))->method('d3GetDb')->willReturn($dbMock);
|
$modelMock->expects($this->exactly((int) !$throwsException))->method('d3GetDb')->willReturn($dbMock);
|
||||||
@ -570,13 +570,13 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
|
|||||||
[
|
[
|
||||||
[
|
[
|
||||||
'field1' => 'content1',
|
'field1' => 'content1',
|
||||||
'field2' => 'content2'
|
'field2' => 'content2',
|
||||||
]
|
],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'field1',
|
'field1',
|
||||||
'field2'
|
'field2',
|
||||||
]
|
],
|
||||||
],
|
],
|
||||||
$result
|
$result
|
||||||
);
|
);
|
||||||
@ -613,7 +613,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
|
|||||||
->onlyMethods([
|
->onlyMethods([
|
||||||
'getQuery',
|
'getQuery',
|
||||||
'getExportData',
|
'getExportData',
|
||||||
'renderContent'
|
'renderContent',
|
||||||
])
|
])
|
||||||
->getMock();
|
->getMock();
|
||||||
$modelMock->expects($this->atLeastOnce())->method('getQuery')->willReturn(['SELECT 1', ['arg1', 'arg2']]);
|
$modelMock->expects($this->atLeastOnce())->method('getQuery')->willReturn(['SELECT 1', ['arg1', 'arg2']]);
|
||||||
|
@ -89,7 +89,7 @@ class CsvTest extends ExportRendererTest
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'exception' => [true],
|
'exception' => [true],
|
||||||
'no exception' => [false]
|
'no exception' => [false],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ class JsonTest extends ExportRendererTest
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'valid' => [['value1', 'value2'], false],
|
'valid' => [['value1', 'value2'], false],
|
||||||
'invalid' => [["text" => "\xB1\x31"], true] // malformed UTF8 chars
|
'invalid' => [["text" => "\xB1\x31"], true], // malformed UTF8 chars
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -122,7 +122,7 @@ class RendererBridgeTest extends d3ModCfgUnitTestCase
|
|||||||
[
|
[
|
||||||
'CSV' => $this->getMockBuilder(Csv::class)->getMock(),
|
'CSV' => $this->getMockBuilder(Csv::class)->getMock(),
|
||||||
'Pretty' => $this->getMockBuilder(Pretty::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 [
|
return [
|
||||||
'existing renderer'=> [RendererBridge::FORMAT_JSON, false],
|
'existing renderer'=> [RendererBridge::FORMAT_JSON, false],
|
||||||
'unknown renderer'=> ['unknownRenderer', true]
|
'unknown renderer'=> ['unknownRenderer', true],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user