Warning: This page has not been updated in over over a year and may be outdated or deprecated.
development:testing:unit_tests
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
development:testing:unit_tests [2023/11/28 18:31] – [Using Phing] demiankatz | development:testing:unit_tests [2023/11/28 18:38] (current) – demiankatz | ||
---|---|---|---|
Line 136: | Line 136: | ||
* Some of VuFind®' | * Some of VuFind®' | ||
* When testing with PostgreSQL, it may be necessary to edit the pg_hba.conf file and change the line "local all all peer" to "local all all md5" to allow password-based database logins required my the test environment. | * When testing with PostgreSQL, it may be necessary to edit the pg_hba.conf file and change the line "local all all peer" to "local all all md5" to allow password-based database logins required my the test environment. | ||
- | * If you encounter issues with the browser tests, you can try running Chrome without the --headless parameter to make the process visible. It's also possible to step through the tests with a PHP debugger if the XDebug extension is installed while checking the results in the visible window. There are a couple of prerequisites for the tests to work properly when running with a visible Chrome window: | + | * If you encounter issues with the browser tests, you can try running Chrome without the ''< |
* Disable Chrome' | * Disable Chrome' | ||
* Set English (US) as the preferred language. | * Set English (US) as the preferred language. | ||
Line 216: | Line 216: | ||
VuFind® integration tests (which check the interaction of components in a real running system) can be found in the module/ | VuFind® integration tests (which check the interaction of components in a real running system) can be found in the module/ | ||
- | VuFind® support modules (VuFindHttp, etc.) have their own tests directories, | + | VuFind® support modules (VuFindSearch, etc.) have their own tests directories, |
- | The layout of the each test directory is designed to mirror the VuFind | + | The layout of the each test directory is designed to mirror the VuFind® |
==== Support Classes/ | ==== Support Classes/ | ||
Line 224: | Line 224: | ||
The VuFindTest namespace (code found in module/ | The VuFindTest namespace (code found in module/ | ||
- | :!: When working on integration tests, pay special attention to the VuFindTest\Feature\Live* traits (introduced during | + | :!: When working on integration tests, pay special attention to the VuFindTest\Feature\Live* traits (introduced during |
==== Mink Browser Automation ==== | ==== Mink Browser Automation ==== | ||
- | If you want to write browser automation tests, you should extend \VuFindTest\Integration\MinkTestCase. This class will automatically set up the Mink environment for you. It also provides a changeConfigs() method which can be used to reconfigure the running | + | If you want to write browser automation tests, you should extend \VuFindTest\Integration\MinkTestCase. This class will automatically set up the Mink environment for you. It also provides a changeConfigs() method which can be used to reconfigure the running |
Some example Mink tests can be found in [[https:// | Some example Mink tests can be found in [[https:// | ||
Line 248: | Line 248: | ||
==== Local Tests ==== | ==== Local Tests ==== | ||
- | Create a directory in your local module mimicking the current structure of the VuFind | + | Create a directory in your local module mimicking the current structure of the VuFind® |
===== Related Video ===== | ===== Related Video ===== | ||
development/testing/unit_tests.1701196318.txt.gz · Last modified: 2023/11/28 18:31 by demiankatz