Skip to content

Commit

Permalink
Load translations dynamically dependant on current location
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Fedurtsya <anton@fedurtsya.com>
  • Loading branch information
Sieg committed Sep 27, 2024
1 parent b30823b commit 1063f09
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/Codeception/Acceptance.suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ modules:
shop_path: '%SHOP_SOURCE_PATH%'
paths:
- 'Application/views/apex'
- '../translations'
- '%SOURCE_RELATIVE_PACKAGE_PATH%/translations'
paths_admin:
- 'Application/views/admin_twig'
- '../views/admin_twig'
- '%SOURCE_RELATIVE_PACKAGE_PATH%/views/admin_twig'
- \OxidEsales\Codeception\Module\OxideshopAdmin:
screen_shot_url: '%SCREEN_SHOT_URL%'
depends:
Expand Down
6 changes: 6 additions & 0 deletions tests/Codeception/Config/params.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
return [
'SHOP_URL' => $facts->getShopUrl(),
'SHOP_SOURCE_PATH' => $facts->getSourcePath(),
'SOURCE_RELATIVE_PACKAGE_PATH' => getSourceRelativePackagePath($facts),
'VENDOR_PATH' => $facts->getVendorPath(),
'DB_NAME' => $facts->getDatabaseName(),
'DB_USERNAME' => $facts->getDatabaseUserName(),
Expand All @@ -35,6 +36,11 @@
'PHP_BIN' => $php,
];

function getSourceRelativePackagePath(Facts $facts): string
{
return str_replace($facts->getShopRootPath(), '..', __DIR__) . '/../../../';
}

function getTestDataDumpFilePath(): string
{
return getShopTestPath() . '/Codeception/Support/Data/generated/shop-dump.sql';
Expand Down

0 comments on commit 1063f09

Please sign in to comment.