About Features Downloads Getting Started Documentation Events Support GitHub

Love VuFind®? Consider becoming a financial supporter. Your support helps build a better VuFind®!

Site Tools


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.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
development:testing:unit_tests [2023/11/28 18:29] demiankatzdevelopment:testing:unit_tests [2023/11/28 18:36] – [Location] demiankatz
Line 58: Line 58:
 This command will turn off the VuFind® test instance created by step 1. This command will turn off the VuFind® test instance created by step 1.
  
-:!: This command will reset the installation including configuration and any changes made to files in the git repository. Any uncommitted changes to files contained in the git repository will be lost.+:!: This command will reset the installation including configuration and any changes made to files in the git repository. Be sure you save/commit anything important BEFORE you shut down.
  
 === The Faster Version === === The Faster Version ===
Line 136: Line 136:
   * Some of VuFind®'s tests use a record ID containing a slash. In order for these tests to work, your Apache installation needs to be configured with "AllowEncodedSlashes on" set in the VirtualHost used for running the VuFind® instance being tested.   * Some of VuFind®'s tests use a record ID containing a slash. In order for these tests to work, your Apache installation needs to be configured with "AllowEncodedSlashes on" set in the VirtualHost used for running the VuFind® instance being tested.
   * 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 ''<nowiki>--headless</nowiki>'' 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:
     * Disable Chrome's "Warn you if passwords are exposed in a data breach" in Privacy and Security settings while running the tests so that the password checks don't interfere with patron tests.     * Disable Chrome's "Warn you if passwords are exposed in a data breach" in Privacy and Security settings while running the tests so that the password checks don't interfere with patron tests.
     * 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/tests/integration-tests directory of your VuFind® installation. VuFind® integration tests (which check the interaction of components in a real running system) can be found in the module/VuFind/tests/integration-tests directory of your VuFind® installation.
  
-VuFind® support modules (VuFindHttp, etc.) have their own tests directories, but these are configured to be run automatically as part of VuFind®'s main test suite.+VuFind® support modules (VuFindSearch, etc.) have their own tests directories, but these are configured to be run automatically as part of VuFind®'s main test suite.
  
-The layout of the each test directory is designed to mirror the VuFind module's src directory (module/VuFind/src/VuFind).  Tests should be placed in a directory that corresponds with the component being tested.  For example, the unit tests for the \VuFind\Date\Converter class are found in "module/VuFind/tests/unit-tests/src/VuFindTest/Date/ConverterTest.php".+The layout of the each test directory is designed to mirror the VuFind module's src directory (module/VuFind/src/VuFind).  Tests should be placed in a directory that corresponds with the component being tested.  For example, the unit tests for the \VuFind\Config\Writer class are found in "module/VuFind/tests/unit-tests/src/VuFindTest/Config/WriterTest.php".
  
 ==== Support Classes/Traits ==== ==== Support Classes/Traits ====
development/testing/unit_tests.txt · Last modified: 2023/11/28 18:38 by demiankatz