From 20025a28a3c66cf58d2005338dab39e37924bccf Mon Sep 17 00:00:00 2001 From: Anton Fedurtsya Date: Wed, 24 Apr 2024 14:12:55 +0300 Subject: [PATCH] OXDEV-7845 Make running local version of phpunit and codeception possible Signed-off-by: Anton Fedurtsya --- composer.json | 16 +++++++++++++--- tests/Codeception/Config/params.php | 4 ++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 5f12408..bf51454 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,14 @@ "phpstan/phpstan": "^1.8.11", "squizlabs/php_codesniffer": "3.*", "oxid-esales/oxideshop-ce": "dev-b-7.1.x", - "phpunit/phpunit": "^10.4" + "phpunit/phpunit": "^10.4", + "codeception/codeception": "^5.0", + "codeception/module-asserts": "^3.0", + "codeception/module-db": "^3.0", + "codeception/module-filesystem": "^3.0", + "codeception/module-webdriver": "^4.0", + "oxid-esales/codeception-modules": "dev-b-7.1.x", + "oxid-esales/codeception-page-objects": "dev-b-7.1.x" }, "autoload": { "psr-4": { @@ -54,12 +61,15 @@ "tests-integration": "XDEBUG_MODE=coverage vendor/bin/phpunit --bootstrap=/var/www/source/bootstrap.php --config=tests/ --testsuite=Integration", "tests-coverage": "XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-text --bootstrap=/var/www/source/bootstrap.php --config=tests/ --coverage-html=tests/result/coverage", - "tests-codeception": "THEME_ID=apex MODULE_IDS=ddoewysiwyg /var/www/vendor/bin/codecept run Acceptance -c /var/www/vendor/ddoe/wysiwyg-editor-module/tests/codeception.yml" + "tests-codeception": [ + "Composer\\Config::disableProcessTimeout", + "THEME_ID=apex MODULE_IDS=ddoemedialibrary,ddoewysiwyg SHOP_ROOT_PATH=/var/www vendor/bin/codecept run Acceptance -c tests/codeception.yml" + ] }, "config": { "allow-plugins": { "oxid-esales/oxideshop-unified-namespace-generator": true, - "oxid-esales/oxideshop-composer-plugin": true + "oxid-esales/oxideshop-composer-plugin": false } } } diff --git a/tests/Codeception/Config/params.php b/tests/Codeception/Config/params.php index c935839..1b23470 100644 --- a/tests/Codeception/Config/params.php +++ b/tests/Codeception/Config/params.php @@ -12,6 +12,10 @@ use OxidEsales\Codeception\Module\Database\DatabaseDefaultsFileGenerator; use Symfony\Component\Filesystem\Path; +if ($shopRootPath = getenv('SHOP_ROOT_PATH')){ + require_once(Path::join($shopRootPath, 'source', 'bootstrap.php')); +} + $facts = new Facts(); return [ 'SHOP_URL' => $facts->getShopUrl(),