diff --git a/tests/Bootstrap.php b/tests/Bootstrap.php index d46fd31..b5d36a8 100755 --- a/tests/Bootstrap.php +++ b/tests/Bootstrap.php @@ -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', diff --git a/tests/Controller/ApiControllerTest.php b/tests/Controller/ApiControllerTest.php index d1c51e8..d29f084 100755 --- a/tests/Controller/ApiControllerTest.php +++ b/tests/Controller/ApiControllerTest.php @@ -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'), ], ]); diff --git a/tests/Interfaces/OMS/Importer.php b/tests/Interfaces/OMS/Importer.php index 4e11d0a..c6b0554 100755 --- a/tests/Interfaces/OMS/Importer.php +++ b/tests/Interfaces/OMS/Importer.php @@ -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]; } } diff --git a/tests/Interfaces/OMS/test.csv b/tests/Interfaces/OMS/test.csv new file mode 100644 index 0000000..8468c6b --- /dev/null +++ b/tests/Interfaces/OMS/test.csv @@ -0,0 +1,3 @@ +"Module";"Theme";"File";"ID";"de";"en" +"TestModule";"Backend";"";"Test1";"Test1.";"Test1." +"TestModule";"Backend";"";"Test2";"Test2.";"Test1." \ No newline at end of file