fix test issues

This commit is contained in:
Daniel Seifert 2024-05-10 12:18:33 +02:00
bovenliggende bb7b9c2025
commit 3fd5f2dc98
7 gewijzigde bestanden met toevoegingen van 19 en 48 verwijderingen

Bestand weergeven

@ -72,7 +72,7 @@ If you have a suggestion that would make this better, please fork the repo and c
- Push to the Branch (git push origin feature/AmazingFeature)
- Open a Pull Request
## Licence
## License
(status: 2021-05-06)
Distributed under the GPLv3 license.

Bestand weergeven

@ -32,6 +32,10 @@
"form-manager/form-manager": "^6.1",
"d3/modcfg": "^7.0"
},
"require-dev": {
"d3/testingtools": "^1.2.0.0",
"phpunit/phpunit": "^9.1.1"
},
"suggest": {
"d3/datawizardtasks": "useful example tasks for Data Wizard",
"d3/datawizardcli": "command line implementation for fully automated Data Wizard tasks",
@ -41,5 +45,9 @@
"psr-4": {
"D3\\DataWizard\\": "./"
}
},
"scripts": {
"phpunit": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --config=vendor/d3/datawizard/ --no-coverage",
"phpunit-coverage": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --config=vendor/d3/datawizard/ --coverage-html=vendor/d3/datawizard/tests/result/coverage"
}
}

Bestand weergeven

@ -2,51 +2,14 @@
## Requirements
Both unit and acceptance tests require OXID Testing Library installed.
See https://github.com/OXID-eSales/testing_library.
Please install the packages listed in the composer.json in "require-dev". Unfortunately Composer does not provide an automatic installation.
missing ext-sockets
### Configuration
Please install the packages listed in the composer.json in "require-dev". Unfortunately Composer does not provide an automatic installation.
Here is an example of Testing Library configuration file `oxideshop/test_config.yml`
```
# This file is auto-generated during the composer install
mandatory_parameters:
shop_path: /var/www/oxideshop/source
shop_tests_path: /var/www/oxideshop/tests
partial_module_paths: d3/datawizard
optional_parameters:
shop_url: null
shop_serial: ''
enable_varnish: false
is_subshop: false
install_shop: false
remote_server_dir: null
shop_setup_path: null
restore_shop_after_tests_suite: false
test_database_name: null
restore_after_acceptance_tests: false
restore_after_unit_tests: false
tmp_path: /tmp/oxid_test_library/
database_restoration_class: DatabaseRestorer
activate_all_modules: false
run_tests_for_shop: false
run_tests_for_modules: true
screen_shots_path: null
screen_shots_url: null
browser_name: firefox
selenium_server_ip: 127.0.0.1
selenium_server_port: '4444'
additional_test_paths: null
```
Make sure the module has been activated with a valid license key.
Configure the error reporting to `error_reporting(E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED);` in the `config.inc.php` due some deprecation issues in original OXID code
## Unit Tests
To execute unit tests run the following:
```
cd /var/www/oxideshop/
vendor/bin/runtests
```
commands are described in composer.json scripts section

Bestand weergeven

@ -36,6 +36,6 @@ class additional extends additional_abstract
}
try {
d3GetModCfgDIC()->get(additional::class);
} catch (Exception $e) {
d3GetOxidDIC()->get(additional::class);
} catch (Exception) {
}

Bestand weergeven

@ -69,7 +69,7 @@ class InputUnvalidExceptionTest extends d3ModCfgUnitTestCase
[$taskMock, $invalidField, $code, $exception]
);
$this->assertRegExp(
$this->assertMatchesRegularExpression(
'/^testTitle\s-\s*->\s.*\sless\s/m',
$this->callMethod(
$this->_oModel,

Bestand weergeven

@ -524,7 +524,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
$this->_oModel = $modelMock;
$this->assertRegExp(
$this->assertMatchesRegularExpression(
'/^base_(\d{4})-(\d{2})-(\d{2})_(\d{2})-(\d{2})-(\d{2})\.extension$/m',
$this->callMethod(
$this->_oModel,

Bestand weergeven

@ -38,7 +38,7 @@ abstract class ExportRendererTest extends d3ModCfgUnitTestCase
*/
public function canGetFileExtension()
{
$this->assertRegExp(
$this->assertMatchesRegularExpression(
"/^[a-z0-9._-]*$/i",
$this->callMethod(
$this->_oModel,