Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Data Liberation] Add support for terms meta and new unit tests #2105

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

zaerl
Copy link
Collaborator

@zaerl zaerl commented Dec 19, 2024

Motivation for the change, related issues

This code is cherry-picked from #2030. This is done to publish those parts during this discussion: #2090.

Implementation details

New unit tests

  1. Added all the ~130 WordPress core unit tests. Some of them are marked as skipped waiting for [Data Liberation] Topological sorter, entities remapping and add missing imports #2030 to be merged
  2. Updated the WXRs to the latest version.
  3. Added a PlaygroundTestCase base class that clean up the WordPress database after a test, as _delete_all_data does.

New meta

  1. Added support for terms meta.
  2. Fixed wrong meta_{key|value} strings.

New PHPUnit filter

This PR adds a PHPUNIT_FILTER constant to packages/playground/data-liberation/tests/import/blueprint-import.json. If the value is not falsy it will be passed to PHPUnit when calling npx nx run playground-data-liberation:test:wp-phpunit. So, for example, you can set "PHPUNIT_FILTER": "WPRewriteUrlsTests". It will be the same as running phpunit --filter WPRewriteUrlsTests.

Testing Instructions (or ideally a Blueprint)

Unit tests

npx nx run playground-data-liberation:test:wp-phpunit

# Or only tests that do not need a WordPress environment
cd packages/playground/data-liberation
./vendor/bin/phpunit

Many tests can be run only in a real WordPress environment, which is why wp-phpunit exists.

@zaerl zaerl requested a review from adamziel December 19, 2024 12:05
@zaerl zaerl self-assigned this Dec 19, 2024
@zaerl zaerl changed the title Add support for terms meta and new unit tests [Data Liberation] Add support for terms meta and new unit tests Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs review
Development

Successfully merging this pull request may close these issues.

1 participant