improve tests for EE

This commit is contained in:
2021-11-26 23:16:32 +01:00
parent 61827e7825
commit b1946c4aae
12 changed files with 484 additions and 47 deletions

View File

@ -103,15 +103,12 @@ abstract class ActionBase implements QueryBase
*/
public function registerFormElement(Input $input)
{
switch (get_class($input)) {
case Radio::class:
case Checkbox::class:
$input->setTemplate('<p class="form-check">{{ input }} {{ label }}</p>');
$input->setAttribute('class', 'form-check-input');
break;
default:
$input->setTemplate('<p class="formElements">{{ label }} {{ input }}</p>');
$input->setAttribute('class', 'form-control');
if ($input instanceof Radio || $input instanceof Checkbox) {
$input->setTemplate('<p class="form-check">{{ input }} {{ label }}</p>');
$input->setAttribute('class', 'form-check-input');
} else {
$input->setTemplate('<p class="formElements">{{ label }} {{ input }}</p>');
$input->setAttribute('class', 'form-control');
}
$this->formElements[] = $input;
}

View File

@ -19,6 +19,7 @@ use D3\DataWizard\Application\Model\Exceptions\RenderException;
use League\Csv\EncloseField;
use League\Csv\Exception;
use League\Csv\Writer;
use OxidEsales\Eshop\Core\Config;
use OxidEsales\Eshop\Core\Registry;
class Csv implements RendererInterface
@ -59,13 +60,13 @@ class Csv implements RendererInterface
EncloseField::addTo($csv, "\t\x1f");
$sEncloser = Registry::getConfig()->getConfigParam('sGiCsvFieldEncloser');
$sEncloser = $this->d3GetConfig()->getConfigParam('sGiCsvFieldEncloser');
if (false == $sEncloser) {
$sEncloser = '"';
}
$csv->setEnclosure($sEncloser);
$sDelimiter = Registry::getConfig()->getConfigParam('sCSVSign');
$sDelimiter = $this->d3GetConfig()->getConfigParam('sCSVSign');
if (false == $sDelimiter) {
$sDelimiter = ';';
}
@ -81,4 +82,12 @@ class Csv implements RendererInterface
{
return 'D3_DATAWIZARD_EXPORT_FORMAT_CSV';
}
/**
* @return Config
*/
public function d3GetConfig()
{
return Registry::getConfig();
}
}