Separate plugin functionality into separate classes #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose for this PR:
This PR is intended to capture changes to the plugin's structure to follow WordPress best practices. No plugin functionality changes are included. In order to ensure the refactoring doesn't introduce errors, unit tests are also introduced to check functionality remains as intended.
Changes:
job_listing
CPT, borrowed from WP Job Manager, tweaked tests, and the restructure of the main class into two separate classes. One class handles the settings, and the other the output.Still to be added:
Unit Testing:
composer install
to include the PHPUnit dependencies../bin/install-wp-tests.sh <database-name> <database-user> <database-password> [<database-host>]
. Example:./bin/install-wp-tests.sh wordpress_tests root root localhost latest
, noting your user and password may depend on your local sql credentials.vendor/bin/phpunit --testsuite tests
.