test fixes and changes for release

This commit is contained in:
Dennis Eichhorn 2022-12-25 00:06:17 +01:00
parent 7609e25a52
commit c9c1ded5a7
4 changed files with 28 additions and 6 deletions

View File

@ -257,6 +257,25 @@ $CONFIG = [
'root' => '/',
'https' => false,
],
'app' => [
'path' => __DIR__,
'default' => [
'app' => 'Backend',
'id' => 'backend',
'lang' => 'en',
'theme' => 'Backend',
'org' => 1,
],
'domains' => [
'127.0.0.1' => [
'app' => 'Backend',
'id' => 'backend',
'lang' => 'en',
'theme' => 'Backend',
'org' => 1,
],
],
],
'socket' => [
'master' => [
'host' => '127.0.0.1',

View File

@ -238,16 +238,16 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
$request->setData('type', 'language');
if (!\is_file(__DIR__ . '/test_tmp.csv')) {
\copy(__DIR__ . '/../Interfaces/OMS/test.csv', __DIR__ . '/../Interfaces/OMS/test_tmp.csv');
\copy(__DIR__ . '/../Interfaces/OMS/test.csv', __DIR__ . '/test_tmp.csv');
}
TestUtils::setMember($request, 'files', [
'file0' => [
'name' => 'test.csv',
'name' => 'test_tmp.csv',
'type' => 'csv',
'tmp_name' => __DIR__ . '/../Interfaces/OMS/test_tmp.csv',
'tmp_name' => __DIR__ . '/test_tmp.csv',
'error' => \UPLOAD_ERR_OK,
'size' => \filesize(__DIR__ . '/../Interfaces/OMS/test_tmp.csv'),
'size' => \filesize(__DIR__ . '/test_tmp.csv'),
],
]);

View File

@ -151,11 +151,11 @@ final class Importer extends ImporterAbstract
}
foreach ($supportedLanguages as $index => $language) {
if (empty(\trim($language))) {
if (empty($language = \trim($language))) {
continue; // @codeCoverageIgnore
}
$languageArray[$line[0]][$line[1]][$line[2]][$line[3]][\trim($language)] = $translations[$index];
$languageArray[$line[0]][$line[1]][$line[2]][$line[3]][$language] = $translations[$index];
}
}

View File

@ -0,0 +1,3 @@
"Module";"Theme";"File";"ID";"de";"en"
"TestModule";"Backend";"";"Test1";"Test1.";"Test1."
"TestModule";"Backend";"";"Test2";"Test2.";"Test1."
1 Module Theme File ID de en
2 TestModule Backend Test1 Test1. Test1.
3 TestModule Backend Test2 Test2. Test1.