From b5bd8225e849384628809be8f86d862d71e98d04 Mon Sep 17 00:00:00 2001 From: Christopher Allford Date: Fri, 24 Apr 2020 13:53:40 -0700 Subject: [PATCH 1/5] Moved PHPUnit suite into tests/legacy --- phpunit.xml | 6 +++--- tests/README.md | 2 +- tests/{ => legacy}/bootstrap.php | 2 +- tests/{ => legacy}/data/Dr1Bczxq4q.png | Bin tests/{ => legacy}/data/GeoLite2-Country.tar.gz | Bin tests/{ => legacy}/data/file.txt | 0 tests/{ => legacy}/data/sample-email.html | 0 .../framework/class-wc-api-unit-test-case.php | 0 .../framework/class-wc-dummy-data-store.php | 0 .../framework/class-wc-mock-payment-gateway.php | 0 .../framework/class-wc-mock-session-handler.php | 0 .../framework/class-wc-mock-wc-data.php | 0 .../framework/class-wc-mock-wc-object-query.php | 0 .../framework/class-wc-payment-token-stub.php | 0 .../framework/class-wc-rest-unit-test-case.php | 0 .../framework/class-wc-unit-test-case.php | 0 .../framework/class-wc-unit-test-factory.php | 0 .../framework/helpers/class-wc-helper-coupon.php | 0 .../framework/helpers/class-wc-helper-customer.php | 0 .../framework/helpers/class-wc-helper-fee.php | 0 .../framework/helpers/class-wc-helper-order.php | 0 .../helpers/class-wc-helper-payment-token.php | 0 .../framework/helpers/class-wc-helper-product.php | 0 .../framework/helpers/class-wc-helper-settings.php | 0 .../helpers/class-wc-helper-shipping-zones.php | 0 .../framework/helpers/class-wc-helper-shipping.php | 0 .../vendor/class-wp-test-spy-rest-server.php | 0 tests/{ => legacy}/includes/listener-loader.php | 0 tests/{ => legacy}/includes/wp-http-testcase.php | 0 tests/{ => legacy}/unit-tests/account/functions.php | 0 .../{ => legacy}/unit-tests/account/permissions.php | 0 .../class-wc-tests-admin-duplicate-product.php | 0 .../admin/reports/class-wc-tests-admin-report.php | 0 .../reports/class-wc-tests-report-sales-by-date.php | 0 .../unit-tests/attributes/functions.php | 0 tests/{ => legacy}/unit-tests/cart/cart-fees.php | 0 tests/{ => legacy}/unit-tests/cart/cart.php | 0 tests/{ => legacy}/unit-tests/cart/functions.php | 0 tests/{ => legacy}/unit-tests/checkout/checkout.php | 0 tests/{ => legacy}/unit-tests/core/main-class.php | 2 +- .../unit-tests/core/post-types-admin.php | 0 tests/{ => legacy}/unit-tests/core/taxonomies.php | 0 .../{ => legacy}/unit-tests/countries/countries.php | 0 tests/{ => legacy}/unit-tests/coupon/coupon.php | 0 tests/{ => legacy}/unit-tests/coupon/data-store.php | 0 tests/{ => legacy}/unit-tests/coupon/data.php | 0 tests/{ => legacy}/unit-tests/coupon/functions.php | 0 tests/{ => legacy}/unit-tests/crud/data-store.php | 0 tests/{ => legacy}/unit-tests/crud/data.php | 0 tests/{ => legacy}/unit-tests/crud/meta.php | 0 tests/{ => legacy}/unit-tests/crud/query.php | 0 tests/{ => legacy}/unit-tests/crud/refunds.php | 0 .../class-wc-customer-download-log-data-store.php | 0 .../customer/class-wc-tests-customer-download.php | 0 tests/{ => legacy}/unit-tests/customer/crud.php | 0 .../unit-tests/customer/customer-download-log.php | 0 tests/{ => legacy}/unit-tests/customer/customer.php | 0 .../{ => legacy}/unit-tests/customer/functions.php | 0 .../{ => legacy}/unit-tests/discounts/discounts.php | 0 tests/{ => legacy}/unit-tests/email/emails.php | 0 tests/{ => legacy}/unit-tests/exporter/product.php | 0 .../unit-tests/formatting/functions.php | 0 tests/{ => legacy}/unit-tests/gateways/gateways.php | 0 .../unit-tests/gateways/paypal/request.php | 0 .../geolocation/class-wc-test-gelocation.php | 0 tests/{ => legacy}/unit-tests/importer/product.php | 0 tests/{ => legacy}/unit-tests/importer/sample.csv | 0 .../unit-tests/importer/sample_tax_rates.csv | 0 .../unit-tests/importer/sample_update_product.csv | 0 tests/{ => legacy}/unit-tests/importer/tax.php | 0 .../integrations/class-dummy-integration.php | 0 .../integrations/class-wc-tests-integrations.php | 0 .../class-wc-tests-maxmind-database.php | 0 .../class-wc-tests-maxmind-integration.php | 0 .../libraries/class-wc-mock-background-process.php | 0 .../unit-tests/libraries/wp-background-process.php | 0 .../{ => legacy}/unit-tests/log/log-handler-db.php | 0 .../unit-tests/log/log-handler-email.php | 0 .../unit-tests/log/log-handler-file.php | 0 tests/{ => legacy}/unit-tests/log/log-levels.php | 0 tests/{ => legacy}/unit-tests/log/logger.php | 0 .../unit-tests/log/test_log_expected.txt | 0 .../class-wc-tests-order-item-data-store.php | 0 .../class-wc-tests-order-item-product.php | 0 .../unit-tests/order-items/functions.php | 0 .../unit-tests/order-items/order-item-coupon.php | 0 .../unit-tests/order-items/order-item-fee.php | 0 .../unit-tests/order-items/order-item-meta.php | 0 .../unit-tests/order-items/order-item-tax.php | 0 .../unit-tests/order/class-wc-tests-crud-orders.php | 0 .../order/class-wc-tests-order-functions.php | 0 .../unit-tests/order/class-wc-tests-orders.php | 0 tests/{ => legacy}/unit-tests/order/coupons.php | 0 tests/{ => legacy}/unit-tests/order/query.php | 0 tests/{ => legacy}/unit-tests/packages/packages.php | 0 .../class-wc-tests-page-functions.php | 0 .../unit-tests/payment-gateways/cod.php | 0 .../payment-gateways/payment-gateways.php | 0 tests/{ => legacy}/unit-tests/payment-tokens/cc.php | 0 .../unit-tests/payment-tokens/echeck.php | 0 .../unit-tests/payment-tokens/payment-token.php | 0 .../unit-tests/payment-tokens/payment-tokens.php | 0 tests/{ => legacy}/unit-tests/privacy/export.php | 0 .../product/class-wc-tests-product-download.php | 0 .../{ => legacy}/unit-tests/product/data-store.php | 0 tests/{ => legacy}/unit-tests/product/data.php | 0 tests/{ => legacy}/unit-tests/product/factory.php | 0 tests/{ => legacy}/unit-tests/product/functions.php | 0 .../unit-tests/product/product-simple.php | 0 .../unit-tests/product/product-variable.php | 0 .../unit-tests/product/product-variation.php | 0 tests/{ => legacy}/unit-tests/product/query.php | 0 tests/{ => legacy}/unit-tests/queue/queue.php | 0 .../session/class-wc-tests-session-handler.php | 0 .../settings/register-wp-admin-settings.php | 0 tests/{ => legacy}/unit-tests/setup/functions.php | 0 .../unit-tests/shipping/shipping-zone.php | 0 .../unit-tests/shipping/shipping-zones.php | 0 tests/{ => legacy}/unit-tests/shipping/shipping.php | 0 .../{ => legacy}/unit-tests/shortcodes/products.php | 0 tests/{ => legacy}/unit-tests/tax/tax.php | 0 .../{ => legacy}/unit-tests/templates/functions.php | 0 tests/{ => legacy}/unit-tests/totals/totals.php | 0 .../{ => legacy}/unit-tests/util/api-functions.php | 0 .../unit-tests/util/class-wc-rate-limiter.php | 0 .../util/class-wc-tests-core-functions.php | 0 .../util/class-wc-tests-user-functions.php | 0 .../unit-tests/util/class-wc-tests-wc-query.php | 0 .../unit-tests/util/conditional-functions.php | 0 .../unit-tests/util/deprecated-hooks.php | 0 .../unit-tests/util/dummy-wc-logger.php | 0 tests/{ => legacy}/unit-tests/util/install.php | 4 ++-- .../unit-tests/util/notice-functions.php | 0 .../{ => legacy}/unit-tests/util/plugin-updates.php | 0 tests/{ => legacy}/unit-tests/util/validation.php | 0 tests/{ => legacy}/unit-tests/webhooks/crud.php | 0 .../{ => legacy}/unit-tests/webhooks/functions.php | 0 .../unit-tests/widgets/class-dummy-widget.php | 0 .../unit-tests/widgets/class-wc-tests-widget.php | 0 139 files changed, 8 insertions(+), 8 deletions(-) rename tests/{ => legacy}/bootstrap.php (98%) rename tests/{ => legacy}/data/Dr1Bczxq4q.png (100%) rename tests/{ => legacy}/data/GeoLite2-Country.tar.gz (100%) rename tests/{ => legacy}/data/file.txt (100%) rename tests/{ => legacy}/data/sample-email.html (100%) rename tests/{ => legacy}/framework/class-wc-api-unit-test-case.php (100%) rename tests/{ => legacy}/framework/class-wc-dummy-data-store.php (100%) rename tests/{ => legacy}/framework/class-wc-mock-payment-gateway.php (100%) rename tests/{ => legacy}/framework/class-wc-mock-session-handler.php (100%) rename tests/{ => legacy}/framework/class-wc-mock-wc-data.php (100%) rename tests/{ => legacy}/framework/class-wc-mock-wc-object-query.php (100%) rename tests/{ => legacy}/framework/class-wc-payment-token-stub.php (100%) rename tests/{ => legacy}/framework/class-wc-rest-unit-test-case.php (100%) rename tests/{ => legacy}/framework/class-wc-unit-test-case.php (100%) rename tests/{ => legacy}/framework/class-wc-unit-test-factory.php (100%) rename tests/{ => legacy}/framework/helpers/class-wc-helper-coupon.php (100%) rename tests/{ => legacy}/framework/helpers/class-wc-helper-customer.php (100%) rename tests/{ => legacy}/framework/helpers/class-wc-helper-fee.php (100%) rename tests/{ => legacy}/framework/helpers/class-wc-helper-order.php (100%) rename tests/{ => legacy}/framework/helpers/class-wc-helper-payment-token.php (100%) rename tests/{ => legacy}/framework/helpers/class-wc-helper-product.php (100%) rename tests/{ => legacy}/framework/helpers/class-wc-helper-settings.php (100%) rename tests/{ => legacy}/framework/helpers/class-wc-helper-shipping-zones.php (100%) rename tests/{ => legacy}/framework/helpers/class-wc-helper-shipping.php (100%) rename tests/{ => legacy}/framework/vendor/class-wp-test-spy-rest-server.php (100%) rename tests/{ => legacy}/includes/listener-loader.php (100%) rename tests/{ => legacy}/includes/wp-http-testcase.php (100%) rename tests/{ => legacy}/unit-tests/account/functions.php (100%) rename tests/{ => legacy}/unit-tests/account/permissions.php (100%) rename tests/{ => legacy}/unit-tests/admin/class-wc-tests-admin-duplicate-product.php (100%) rename tests/{ => legacy}/unit-tests/admin/reports/class-wc-tests-admin-report.php (100%) rename tests/{ => legacy}/unit-tests/admin/reports/class-wc-tests-report-sales-by-date.php (100%) rename tests/{ => legacy}/unit-tests/attributes/functions.php (100%) rename tests/{ => legacy}/unit-tests/cart/cart-fees.php (100%) rename tests/{ => legacy}/unit-tests/cart/cart.php (100%) rename tests/{ => legacy}/unit-tests/cart/functions.php (100%) rename tests/{ => legacy}/unit-tests/checkout/checkout.php (100%) rename tests/{ => legacy}/unit-tests/core/main-class.php (94%) rename tests/{ => legacy}/unit-tests/core/post-types-admin.php (100%) rename tests/{ => legacy}/unit-tests/core/taxonomies.php (100%) rename tests/{ => legacy}/unit-tests/countries/countries.php (100%) rename tests/{ => legacy}/unit-tests/coupon/coupon.php (100%) rename tests/{ => legacy}/unit-tests/coupon/data-store.php (100%) rename tests/{ => legacy}/unit-tests/coupon/data.php (100%) rename tests/{ => legacy}/unit-tests/coupon/functions.php (100%) rename tests/{ => legacy}/unit-tests/crud/data-store.php (100%) rename tests/{ => legacy}/unit-tests/crud/data.php (100%) rename tests/{ => legacy}/unit-tests/crud/meta.php (100%) rename tests/{ => legacy}/unit-tests/crud/query.php (100%) rename tests/{ => legacy}/unit-tests/crud/refunds.php (100%) rename tests/{ => legacy}/unit-tests/customer/class-wc-customer-download-log-data-store.php (100%) rename tests/{ => legacy}/unit-tests/customer/class-wc-tests-customer-download.php (100%) rename tests/{ => legacy}/unit-tests/customer/crud.php (100%) rename tests/{ => legacy}/unit-tests/customer/customer-download-log.php (100%) rename tests/{ => legacy}/unit-tests/customer/customer.php (100%) rename tests/{ => legacy}/unit-tests/customer/functions.php (100%) rename tests/{ => legacy}/unit-tests/discounts/discounts.php (100%) rename tests/{ => legacy}/unit-tests/email/emails.php (100%) rename tests/{ => legacy}/unit-tests/exporter/product.php (100%) rename tests/{ => legacy}/unit-tests/formatting/functions.php (100%) rename tests/{ => legacy}/unit-tests/gateways/gateways.php (100%) rename tests/{ => legacy}/unit-tests/gateways/paypal/request.php (100%) rename tests/{ => legacy}/unit-tests/geolocation/class-wc-test-gelocation.php (100%) rename tests/{ => legacy}/unit-tests/importer/product.php (100%) rename tests/{ => legacy}/unit-tests/importer/sample.csv (100%) rename tests/{ => legacy}/unit-tests/importer/sample_tax_rates.csv (100%) rename tests/{ => legacy}/unit-tests/importer/sample_update_product.csv (100%) rename tests/{ => legacy}/unit-tests/importer/tax.php (100%) rename tests/{ => legacy}/unit-tests/integrations/class-dummy-integration.php (100%) rename tests/{ => legacy}/unit-tests/integrations/class-wc-tests-integrations.php (100%) rename tests/{ => legacy}/unit-tests/integrations/maxmind-geolocation/class-wc-tests-maxmind-database.php (100%) rename tests/{ => legacy}/unit-tests/integrations/maxmind-geolocation/class-wc-tests-maxmind-integration.php (100%) rename tests/{ => legacy}/unit-tests/libraries/class-wc-mock-background-process.php (100%) rename tests/{ => legacy}/unit-tests/libraries/wp-background-process.php (100%) rename tests/{ => legacy}/unit-tests/log/log-handler-db.php (100%) rename tests/{ => legacy}/unit-tests/log/log-handler-email.php (100%) rename tests/{ => legacy}/unit-tests/log/log-handler-file.php (100%) rename tests/{ => legacy}/unit-tests/log/log-levels.php (100%) rename tests/{ => legacy}/unit-tests/log/logger.php (100%) rename tests/{ => legacy}/unit-tests/log/test_log_expected.txt (100%) rename tests/{ => legacy}/unit-tests/order-items/class-wc-tests-order-item-data-store.php (100%) rename tests/{ => legacy}/unit-tests/order-items/class-wc-tests-order-item-product.php (100%) rename tests/{ => legacy}/unit-tests/order-items/functions.php (100%) rename tests/{ => legacy}/unit-tests/order-items/order-item-coupon.php (100%) rename tests/{ => legacy}/unit-tests/order-items/order-item-fee.php (100%) rename tests/{ => legacy}/unit-tests/order-items/order-item-meta.php (100%) rename tests/{ => legacy}/unit-tests/order-items/order-item-tax.php (100%) rename tests/{ => legacy}/unit-tests/order/class-wc-tests-crud-orders.php (100%) rename tests/{ => legacy}/unit-tests/order/class-wc-tests-order-functions.php (100%) rename tests/{ => legacy}/unit-tests/order/class-wc-tests-orders.php (100%) rename tests/{ => legacy}/unit-tests/order/coupons.php (100%) rename tests/{ => legacy}/unit-tests/order/query.php (100%) rename tests/{ => legacy}/unit-tests/packages/packages.php (100%) rename tests/{ => legacy}/unit-tests/page-functions/class-wc-tests-page-functions.php (100%) rename tests/{ => legacy}/unit-tests/payment-gateways/cod.php (100%) rename tests/{ => legacy}/unit-tests/payment-gateways/payment-gateways.php (100%) rename tests/{ => legacy}/unit-tests/payment-tokens/cc.php (100%) rename tests/{ => legacy}/unit-tests/payment-tokens/echeck.php (100%) rename tests/{ => legacy}/unit-tests/payment-tokens/payment-token.php (100%) rename tests/{ => legacy}/unit-tests/payment-tokens/payment-tokens.php (100%) rename tests/{ => legacy}/unit-tests/privacy/export.php (100%) rename tests/{ => legacy}/unit-tests/product/class-wc-tests-product-download.php (100%) rename tests/{ => legacy}/unit-tests/product/data-store.php (100%) rename tests/{ => legacy}/unit-tests/product/data.php (100%) rename tests/{ => legacy}/unit-tests/product/factory.php (100%) rename tests/{ => legacy}/unit-tests/product/functions.php (100%) rename tests/{ => legacy}/unit-tests/product/product-simple.php (100%) rename tests/{ => legacy}/unit-tests/product/product-variable.php (100%) rename tests/{ => legacy}/unit-tests/product/product-variation.php (100%) rename tests/{ => legacy}/unit-tests/product/query.php (100%) rename tests/{ => legacy}/unit-tests/queue/queue.php (100%) rename tests/{ => legacy}/unit-tests/session/class-wc-tests-session-handler.php (100%) rename tests/{ => legacy}/unit-tests/settings/register-wp-admin-settings.php (100%) rename tests/{ => legacy}/unit-tests/setup/functions.php (100%) rename tests/{ => legacy}/unit-tests/shipping/shipping-zone.php (100%) rename tests/{ => legacy}/unit-tests/shipping/shipping-zones.php (100%) rename tests/{ => legacy}/unit-tests/shipping/shipping.php (100%) rename tests/{ => legacy}/unit-tests/shortcodes/products.php (100%) rename tests/{ => legacy}/unit-tests/tax/tax.php (100%) rename tests/{ => legacy}/unit-tests/templates/functions.php (100%) rename tests/{ => legacy}/unit-tests/totals/totals.php (100%) rename tests/{ => legacy}/unit-tests/util/api-functions.php (100%) rename tests/{ => legacy}/unit-tests/util/class-wc-rate-limiter.php (100%) rename tests/{ => legacy}/unit-tests/util/class-wc-tests-core-functions.php (100%) rename tests/{ => legacy}/unit-tests/util/class-wc-tests-user-functions.php (100%) rename tests/{ => legacy}/unit-tests/util/class-wc-tests-wc-query.php (100%) rename tests/{ => legacy}/unit-tests/util/conditional-functions.php (100%) rename tests/{ => legacy}/unit-tests/util/deprecated-hooks.php (100%) rename tests/{ => legacy}/unit-tests/util/dummy-wc-logger.php (100%) rename tests/{ => legacy}/unit-tests/util/install.php (96%) rename tests/{ => legacy}/unit-tests/util/notice-functions.php (100%) rename tests/{ => legacy}/unit-tests/util/plugin-updates.php (100%) rename tests/{ => legacy}/unit-tests/util/validation.php (100%) rename tests/{ => legacy}/unit-tests/webhooks/crud.php (100%) rename tests/{ => legacy}/unit-tests/webhooks/functions.php (100%) rename tests/{ => legacy}/unit-tests/widgets/class-dummy-widget.php (100%) rename tests/{ => legacy}/unit-tests/widgets/class-wc-tests-widget.php (100%) diff --git a/phpunit.xml b/phpunit.xml index d8b796394e8eb..772e20117c257 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,6 +1,6 @@ - ./tests/unit-tests + ./tests/legacy/unit-tests @@ -46,6 +46,6 @@ - + diff --git a/tests/README.md b/tests/README.md index 4c0ec2b074610..0c238464efb74 100644 --- a/tests/README.md +++ b/tests/README.md @@ -46,7 +46,7 @@ The tests will execute and you'll be presented with a summary. You can run specific tests by providing the path and filename to the test class: - $ vendor/bin/phpunit tests/unit-tests/importer/product.php + $ vendor/bin/phpunit tests/legacy/unit-tests/importer/product.php A text code coverage summary can be displayed using the `--coverage-text` option: diff --git a/tests/bootstrap.php b/tests/legacy/bootstrap.php similarity index 98% rename from tests/bootstrap.php rename to tests/legacy/bootstrap.php index 0567482dfd8c3..c0a91df0ec384 100644 --- a/tests/bootstrap.php +++ b/tests/legacy/bootstrap.php @@ -41,7 +41,7 @@ public function __construct() { // phpcs:enable WordPress.VIP.SuperGlobalInputUsage.AccessDetected $this->tests_dir = dirname( __FILE__ ); - $this->plugin_dir = dirname( $this->tests_dir ); + $this->plugin_dir = dirname( dirname( $this->tests_dir ) ); $this->wp_tests_dir = getenv( 'WP_TESTS_DIR' ) ? getenv( 'WP_TESTS_DIR' ) : sys_get_temp_dir() . '/wordpress-tests-lib'; // load test function so tests_add_filter() is available. diff --git a/tests/data/Dr1Bczxq4q.png b/tests/legacy/data/Dr1Bczxq4q.png similarity index 100% rename from tests/data/Dr1Bczxq4q.png rename to tests/legacy/data/Dr1Bczxq4q.png diff --git a/tests/data/GeoLite2-Country.tar.gz b/tests/legacy/data/GeoLite2-Country.tar.gz similarity index 100% rename from tests/data/GeoLite2-Country.tar.gz rename to tests/legacy/data/GeoLite2-Country.tar.gz diff --git a/tests/data/file.txt b/tests/legacy/data/file.txt similarity index 100% rename from tests/data/file.txt rename to tests/legacy/data/file.txt diff --git a/tests/data/sample-email.html b/tests/legacy/data/sample-email.html similarity index 100% rename from tests/data/sample-email.html rename to tests/legacy/data/sample-email.html diff --git a/tests/framework/class-wc-api-unit-test-case.php b/tests/legacy/framework/class-wc-api-unit-test-case.php similarity index 100% rename from tests/framework/class-wc-api-unit-test-case.php rename to tests/legacy/framework/class-wc-api-unit-test-case.php diff --git a/tests/framework/class-wc-dummy-data-store.php b/tests/legacy/framework/class-wc-dummy-data-store.php similarity index 100% rename from tests/framework/class-wc-dummy-data-store.php rename to tests/legacy/framework/class-wc-dummy-data-store.php diff --git a/tests/framework/class-wc-mock-payment-gateway.php b/tests/legacy/framework/class-wc-mock-payment-gateway.php similarity index 100% rename from tests/framework/class-wc-mock-payment-gateway.php rename to tests/legacy/framework/class-wc-mock-payment-gateway.php diff --git a/tests/framework/class-wc-mock-session-handler.php b/tests/legacy/framework/class-wc-mock-session-handler.php similarity index 100% rename from tests/framework/class-wc-mock-session-handler.php rename to tests/legacy/framework/class-wc-mock-session-handler.php diff --git a/tests/framework/class-wc-mock-wc-data.php b/tests/legacy/framework/class-wc-mock-wc-data.php similarity index 100% rename from tests/framework/class-wc-mock-wc-data.php rename to tests/legacy/framework/class-wc-mock-wc-data.php diff --git a/tests/framework/class-wc-mock-wc-object-query.php b/tests/legacy/framework/class-wc-mock-wc-object-query.php similarity index 100% rename from tests/framework/class-wc-mock-wc-object-query.php rename to tests/legacy/framework/class-wc-mock-wc-object-query.php diff --git a/tests/framework/class-wc-payment-token-stub.php b/tests/legacy/framework/class-wc-payment-token-stub.php similarity index 100% rename from tests/framework/class-wc-payment-token-stub.php rename to tests/legacy/framework/class-wc-payment-token-stub.php diff --git a/tests/framework/class-wc-rest-unit-test-case.php b/tests/legacy/framework/class-wc-rest-unit-test-case.php similarity index 100% rename from tests/framework/class-wc-rest-unit-test-case.php rename to tests/legacy/framework/class-wc-rest-unit-test-case.php diff --git a/tests/framework/class-wc-unit-test-case.php b/tests/legacy/framework/class-wc-unit-test-case.php similarity index 100% rename from tests/framework/class-wc-unit-test-case.php rename to tests/legacy/framework/class-wc-unit-test-case.php diff --git a/tests/framework/class-wc-unit-test-factory.php b/tests/legacy/framework/class-wc-unit-test-factory.php similarity index 100% rename from tests/framework/class-wc-unit-test-factory.php rename to tests/legacy/framework/class-wc-unit-test-factory.php diff --git a/tests/framework/helpers/class-wc-helper-coupon.php b/tests/legacy/framework/helpers/class-wc-helper-coupon.php similarity index 100% rename from tests/framework/helpers/class-wc-helper-coupon.php rename to tests/legacy/framework/helpers/class-wc-helper-coupon.php diff --git a/tests/framework/helpers/class-wc-helper-customer.php b/tests/legacy/framework/helpers/class-wc-helper-customer.php similarity index 100% rename from tests/framework/helpers/class-wc-helper-customer.php rename to tests/legacy/framework/helpers/class-wc-helper-customer.php diff --git a/tests/framework/helpers/class-wc-helper-fee.php b/tests/legacy/framework/helpers/class-wc-helper-fee.php similarity index 100% rename from tests/framework/helpers/class-wc-helper-fee.php rename to tests/legacy/framework/helpers/class-wc-helper-fee.php diff --git a/tests/framework/helpers/class-wc-helper-order.php b/tests/legacy/framework/helpers/class-wc-helper-order.php similarity index 100% rename from tests/framework/helpers/class-wc-helper-order.php rename to tests/legacy/framework/helpers/class-wc-helper-order.php diff --git a/tests/framework/helpers/class-wc-helper-payment-token.php b/tests/legacy/framework/helpers/class-wc-helper-payment-token.php similarity index 100% rename from tests/framework/helpers/class-wc-helper-payment-token.php rename to tests/legacy/framework/helpers/class-wc-helper-payment-token.php diff --git a/tests/framework/helpers/class-wc-helper-product.php b/tests/legacy/framework/helpers/class-wc-helper-product.php similarity index 100% rename from tests/framework/helpers/class-wc-helper-product.php rename to tests/legacy/framework/helpers/class-wc-helper-product.php diff --git a/tests/framework/helpers/class-wc-helper-settings.php b/tests/legacy/framework/helpers/class-wc-helper-settings.php similarity index 100% rename from tests/framework/helpers/class-wc-helper-settings.php rename to tests/legacy/framework/helpers/class-wc-helper-settings.php diff --git a/tests/framework/helpers/class-wc-helper-shipping-zones.php b/tests/legacy/framework/helpers/class-wc-helper-shipping-zones.php similarity index 100% rename from tests/framework/helpers/class-wc-helper-shipping-zones.php rename to tests/legacy/framework/helpers/class-wc-helper-shipping-zones.php diff --git a/tests/framework/helpers/class-wc-helper-shipping.php b/tests/legacy/framework/helpers/class-wc-helper-shipping.php similarity index 100% rename from tests/framework/helpers/class-wc-helper-shipping.php rename to tests/legacy/framework/helpers/class-wc-helper-shipping.php diff --git a/tests/framework/vendor/class-wp-test-spy-rest-server.php b/tests/legacy/framework/vendor/class-wp-test-spy-rest-server.php similarity index 100% rename from tests/framework/vendor/class-wp-test-spy-rest-server.php rename to tests/legacy/framework/vendor/class-wp-test-spy-rest-server.php diff --git a/tests/includes/listener-loader.php b/tests/legacy/includes/listener-loader.php similarity index 100% rename from tests/includes/listener-loader.php rename to tests/legacy/includes/listener-loader.php diff --git a/tests/includes/wp-http-testcase.php b/tests/legacy/includes/wp-http-testcase.php similarity index 100% rename from tests/includes/wp-http-testcase.php rename to tests/legacy/includes/wp-http-testcase.php diff --git a/tests/unit-tests/account/functions.php b/tests/legacy/unit-tests/account/functions.php similarity index 100% rename from tests/unit-tests/account/functions.php rename to tests/legacy/unit-tests/account/functions.php diff --git a/tests/unit-tests/account/permissions.php b/tests/legacy/unit-tests/account/permissions.php similarity index 100% rename from tests/unit-tests/account/permissions.php rename to tests/legacy/unit-tests/account/permissions.php diff --git a/tests/unit-tests/admin/class-wc-tests-admin-duplicate-product.php b/tests/legacy/unit-tests/admin/class-wc-tests-admin-duplicate-product.php similarity index 100% rename from tests/unit-tests/admin/class-wc-tests-admin-duplicate-product.php rename to tests/legacy/unit-tests/admin/class-wc-tests-admin-duplicate-product.php diff --git a/tests/unit-tests/admin/reports/class-wc-tests-admin-report.php b/tests/legacy/unit-tests/admin/reports/class-wc-tests-admin-report.php similarity index 100% rename from tests/unit-tests/admin/reports/class-wc-tests-admin-report.php rename to tests/legacy/unit-tests/admin/reports/class-wc-tests-admin-report.php diff --git a/tests/unit-tests/admin/reports/class-wc-tests-report-sales-by-date.php b/tests/legacy/unit-tests/admin/reports/class-wc-tests-report-sales-by-date.php similarity index 100% rename from tests/unit-tests/admin/reports/class-wc-tests-report-sales-by-date.php rename to tests/legacy/unit-tests/admin/reports/class-wc-tests-report-sales-by-date.php diff --git a/tests/unit-tests/attributes/functions.php b/tests/legacy/unit-tests/attributes/functions.php similarity index 100% rename from tests/unit-tests/attributes/functions.php rename to tests/legacy/unit-tests/attributes/functions.php diff --git a/tests/unit-tests/cart/cart-fees.php b/tests/legacy/unit-tests/cart/cart-fees.php similarity index 100% rename from tests/unit-tests/cart/cart-fees.php rename to tests/legacy/unit-tests/cart/cart-fees.php diff --git a/tests/unit-tests/cart/cart.php b/tests/legacy/unit-tests/cart/cart.php similarity index 100% rename from tests/unit-tests/cart/cart.php rename to tests/legacy/unit-tests/cart/cart.php diff --git a/tests/unit-tests/cart/functions.php b/tests/legacy/unit-tests/cart/functions.php similarity index 100% rename from tests/unit-tests/cart/functions.php rename to tests/legacy/unit-tests/cart/functions.php diff --git a/tests/unit-tests/checkout/checkout.php b/tests/legacy/unit-tests/checkout/checkout.php similarity index 100% rename from tests/unit-tests/checkout/checkout.php rename to tests/legacy/unit-tests/checkout/checkout.php diff --git a/tests/unit-tests/core/main-class.php b/tests/legacy/unit-tests/core/main-class.php similarity index 94% rename from tests/unit-tests/core/main-class.php rename to tests/legacy/unit-tests/core/main-class.php index 5e9d92f42239b..eb66ed137f0cd 100644 --- a/tests/unit-tests/core/main-class.php +++ b/tests/legacy/unit-tests/core/main-class.php @@ -41,7 +41,7 @@ public function test_wc_instance() { * @since 2.2 */ public function test_constants() { - $this->assertEquals( str_replace( 'tests/unit-tests/core/', '', plugin_dir_path( __FILE__ ) ) . 'woocommerce.php', WC_PLUGIN_FILE ); + $this->assertEquals( str_replace( 'tests/legacy/unit-tests/core/', '', plugin_dir_path( __FILE__ ) ) . 'woocommerce.php', WC_PLUGIN_FILE ); $this->assertEquals( $this->wc->version, Constants::get_constant( 'WC_VERSION' ) ); $this->assertEquals( WC_VERSION, WOOCOMMERCE_VERSION ); $this->assertEquals( 6, WC_ROUNDING_PRECISION ); diff --git a/tests/unit-tests/core/post-types-admin.php b/tests/legacy/unit-tests/core/post-types-admin.php similarity index 100% rename from tests/unit-tests/core/post-types-admin.php rename to tests/legacy/unit-tests/core/post-types-admin.php diff --git a/tests/unit-tests/core/taxonomies.php b/tests/legacy/unit-tests/core/taxonomies.php similarity index 100% rename from tests/unit-tests/core/taxonomies.php rename to tests/legacy/unit-tests/core/taxonomies.php diff --git a/tests/unit-tests/countries/countries.php b/tests/legacy/unit-tests/countries/countries.php similarity index 100% rename from tests/unit-tests/countries/countries.php rename to tests/legacy/unit-tests/countries/countries.php diff --git a/tests/unit-tests/coupon/coupon.php b/tests/legacy/unit-tests/coupon/coupon.php similarity index 100% rename from tests/unit-tests/coupon/coupon.php rename to tests/legacy/unit-tests/coupon/coupon.php diff --git a/tests/unit-tests/coupon/data-store.php b/tests/legacy/unit-tests/coupon/data-store.php similarity index 100% rename from tests/unit-tests/coupon/data-store.php rename to tests/legacy/unit-tests/coupon/data-store.php diff --git a/tests/unit-tests/coupon/data.php b/tests/legacy/unit-tests/coupon/data.php similarity index 100% rename from tests/unit-tests/coupon/data.php rename to tests/legacy/unit-tests/coupon/data.php diff --git a/tests/unit-tests/coupon/functions.php b/tests/legacy/unit-tests/coupon/functions.php similarity index 100% rename from tests/unit-tests/coupon/functions.php rename to tests/legacy/unit-tests/coupon/functions.php diff --git a/tests/unit-tests/crud/data-store.php b/tests/legacy/unit-tests/crud/data-store.php similarity index 100% rename from tests/unit-tests/crud/data-store.php rename to tests/legacy/unit-tests/crud/data-store.php diff --git a/tests/unit-tests/crud/data.php b/tests/legacy/unit-tests/crud/data.php similarity index 100% rename from tests/unit-tests/crud/data.php rename to tests/legacy/unit-tests/crud/data.php diff --git a/tests/unit-tests/crud/meta.php b/tests/legacy/unit-tests/crud/meta.php similarity index 100% rename from tests/unit-tests/crud/meta.php rename to tests/legacy/unit-tests/crud/meta.php diff --git a/tests/unit-tests/crud/query.php b/tests/legacy/unit-tests/crud/query.php similarity index 100% rename from tests/unit-tests/crud/query.php rename to tests/legacy/unit-tests/crud/query.php diff --git a/tests/unit-tests/crud/refunds.php b/tests/legacy/unit-tests/crud/refunds.php similarity index 100% rename from tests/unit-tests/crud/refunds.php rename to tests/legacy/unit-tests/crud/refunds.php diff --git a/tests/unit-tests/customer/class-wc-customer-download-log-data-store.php b/tests/legacy/unit-tests/customer/class-wc-customer-download-log-data-store.php similarity index 100% rename from tests/unit-tests/customer/class-wc-customer-download-log-data-store.php rename to tests/legacy/unit-tests/customer/class-wc-customer-download-log-data-store.php diff --git a/tests/unit-tests/customer/class-wc-tests-customer-download.php b/tests/legacy/unit-tests/customer/class-wc-tests-customer-download.php similarity index 100% rename from tests/unit-tests/customer/class-wc-tests-customer-download.php rename to tests/legacy/unit-tests/customer/class-wc-tests-customer-download.php diff --git a/tests/unit-tests/customer/crud.php b/tests/legacy/unit-tests/customer/crud.php similarity index 100% rename from tests/unit-tests/customer/crud.php rename to tests/legacy/unit-tests/customer/crud.php diff --git a/tests/unit-tests/customer/customer-download-log.php b/tests/legacy/unit-tests/customer/customer-download-log.php similarity index 100% rename from tests/unit-tests/customer/customer-download-log.php rename to tests/legacy/unit-tests/customer/customer-download-log.php diff --git a/tests/unit-tests/customer/customer.php b/tests/legacy/unit-tests/customer/customer.php similarity index 100% rename from tests/unit-tests/customer/customer.php rename to tests/legacy/unit-tests/customer/customer.php diff --git a/tests/unit-tests/customer/functions.php b/tests/legacy/unit-tests/customer/functions.php similarity index 100% rename from tests/unit-tests/customer/functions.php rename to tests/legacy/unit-tests/customer/functions.php diff --git a/tests/unit-tests/discounts/discounts.php b/tests/legacy/unit-tests/discounts/discounts.php similarity index 100% rename from tests/unit-tests/discounts/discounts.php rename to tests/legacy/unit-tests/discounts/discounts.php diff --git a/tests/unit-tests/email/emails.php b/tests/legacy/unit-tests/email/emails.php similarity index 100% rename from tests/unit-tests/email/emails.php rename to tests/legacy/unit-tests/email/emails.php diff --git a/tests/unit-tests/exporter/product.php b/tests/legacy/unit-tests/exporter/product.php similarity index 100% rename from tests/unit-tests/exporter/product.php rename to tests/legacy/unit-tests/exporter/product.php diff --git a/tests/unit-tests/formatting/functions.php b/tests/legacy/unit-tests/formatting/functions.php similarity index 100% rename from tests/unit-tests/formatting/functions.php rename to tests/legacy/unit-tests/formatting/functions.php diff --git a/tests/unit-tests/gateways/gateways.php b/tests/legacy/unit-tests/gateways/gateways.php similarity index 100% rename from tests/unit-tests/gateways/gateways.php rename to tests/legacy/unit-tests/gateways/gateways.php diff --git a/tests/unit-tests/gateways/paypal/request.php b/tests/legacy/unit-tests/gateways/paypal/request.php similarity index 100% rename from tests/unit-tests/gateways/paypal/request.php rename to tests/legacy/unit-tests/gateways/paypal/request.php diff --git a/tests/unit-tests/geolocation/class-wc-test-gelocation.php b/tests/legacy/unit-tests/geolocation/class-wc-test-gelocation.php similarity index 100% rename from tests/unit-tests/geolocation/class-wc-test-gelocation.php rename to tests/legacy/unit-tests/geolocation/class-wc-test-gelocation.php diff --git a/tests/unit-tests/importer/product.php b/tests/legacy/unit-tests/importer/product.php similarity index 100% rename from tests/unit-tests/importer/product.php rename to tests/legacy/unit-tests/importer/product.php diff --git a/tests/unit-tests/importer/sample.csv b/tests/legacy/unit-tests/importer/sample.csv similarity index 100% rename from tests/unit-tests/importer/sample.csv rename to tests/legacy/unit-tests/importer/sample.csv diff --git a/tests/unit-tests/importer/sample_tax_rates.csv b/tests/legacy/unit-tests/importer/sample_tax_rates.csv similarity index 100% rename from tests/unit-tests/importer/sample_tax_rates.csv rename to tests/legacy/unit-tests/importer/sample_tax_rates.csv diff --git a/tests/unit-tests/importer/sample_update_product.csv b/tests/legacy/unit-tests/importer/sample_update_product.csv similarity index 100% rename from tests/unit-tests/importer/sample_update_product.csv rename to tests/legacy/unit-tests/importer/sample_update_product.csv diff --git a/tests/unit-tests/importer/tax.php b/tests/legacy/unit-tests/importer/tax.php similarity index 100% rename from tests/unit-tests/importer/tax.php rename to tests/legacy/unit-tests/importer/tax.php diff --git a/tests/unit-tests/integrations/class-dummy-integration.php b/tests/legacy/unit-tests/integrations/class-dummy-integration.php similarity index 100% rename from tests/unit-tests/integrations/class-dummy-integration.php rename to tests/legacy/unit-tests/integrations/class-dummy-integration.php diff --git a/tests/unit-tests/integrations/class-wc-tests-integrations.php b/tests/legacy/unit-tests/integrations/class-wc-tests-integrations.php similarity index 100% rename from tests/unit-tests/integrations/class-wc-tests-integrations.php rename to tests/legacy/unit-tests/integrations/class-wc-tests-integrations.php diff --git a/tests/unit-tests/integrations/maxmind-geolocation/class-wc-tests-maxmind-database.php b/tests/legacy/unit-tests/integrations/maxmind-geolocation/class-wc-tests-maxmind-database.php similarity index 100% rename from tests/unit-tests/integrations/maxmind-geolocation/class-wc-tests-maxmind-database.php rename to tests/legacy/unit-tests/integrations/maxmind-geolocation/class-wc-tests-maxmind-database.php diff --git a/tests/unit-tests/integrations/maxmind-geolocation/class-wc-tests-maxmind-integration.php b/tests/legacy/unit-tests/integrations/maxmind-geolocation/class-wc-tests-maxmind-integration.php similarity index 100% rename from tests/unit-tests/integrations/maxmind-geolocation/class-wc-tests-maxmind-integration.php rename to tests/legacy/unit-tests/integrations/maxmind-geolocation/class-wc-tests-maxmind-integration.php diff --git a/tests/unit-tests/libraries/class-wc-mock-background-process.php b/tests/legacy/unit-tests/libraries/class-wc-mock-background-process.php similarity index 100% rename from tests/unit-tests/libraries/class-wc-mock-background-process.php rename to tests/legacy/unit-tests/libraries/class-wc-mock-background-process.php diff --git a/tests/unit-tests/libraries/wp-background-process.php b/tests/legacy/unit-tests/libraries/wp-background-process.php similarity index 100% rename from tests/unit-tests/libraries/wp-background-process.php rename to tests/legacy/unit-tests/libraries/wp-background-process.php diff --git a/tests/unit-tests/log/log-handler-db.php b/tests/legacy/unit-tests/log/log-handler-db.php similarity index 100% rename from tests/unit-tests/log/log-handler-db.php rename to tests/legacy/unit-tests/log/log-handler-db.php diff --git a/tests/unit-tests/log/log-handler-email.php b/tests/legacy/unit-tests/log/log-handler-email.php similarity index 100% rename from tests/unit-tests/log/log-handler-email.php rename to tests/legacy/unit-tests/log/log-handler-email.php diff --git a/tests/unit-tests/log/log-handler-file.php b/tests/legacy/unit-tests/log/log-handler-file.php similarity index 100% rename from tests/unit-tests/log/log-handler-file.php rename to tests/legacy/unit-tests/log/log-handler-file.php diff --git a/tests/unit-tests/log/log-levels.php b/tests/legacy/unit-tests/log/log-levels.php similarity index 100% rename from tests/unit-tests/log/log-levels.php rename to tests/legacy/unit-tests/log/log-levels.php diff --git a/tests/unit-tests/log/logger.php b/tests/legacy/unit-tests/log/logger.php similarity index 100% rename from tests/unit-tests/log/logger.php rename to tests/legacy/unit-tests/log/logger.php diff --git a/tests/unit-tests/log/test_log_expected.txt b/tests/legacy/unit-tests/log/test_log_expected.txt similarity index 100% rename from tests/unit-tests/log/test_log_expected.txt rename to tests/legacy/unit-tests/log/test_log_expected.txt diff --git a/tests/unit-tests/order-items/class-wc-tests-order-item-data-store.php b/tests/legacy/unit-tests/order-items/class-wc-tests-order-item-data-store.php similarity index 100% rename from tests/unit-tests/order-items/class-wc-tests-order-item-data-store.php rename to tests/legacy/unit-tests/order-items/class-wc-tests-order-item-data-store.php diff --git a/tests/unit-tests/order-items/class-wc-tests-order-item-product.php b/tests/legacy/unit-tests/order-items/class-wc-tests-order-item-product.php similarity index 100% rename from tests/unit-tests/order-items/class-wc-tests-order-item-product.php rename to tests/legacy/unit-tests/order-items/class-wc-tests-order-item-product.php diff --git a/tests/unit-tests/order-items/functions.php b/tests/legacy/unit-tests/order-items/functions.php similarity index 100% rename from tests/unit-tests/order-items/functions.php rename to tests/legacy/unit-tests/order-items/functions.php diff --git a/tests/unit-tests/order-items/order-item-coupon.php b/tests/legacy/unit-tests/order-items/order-item-coupon.php similarity index 100% rename from tests/unit-tests/order-items/order-item-coupon.php rename to tests/legacy/unit-tests/order-items/order-item-coupon.php diff --git a/tests/unit-tests/order-items/order-item-fee.php b/tests/legacy/unit-tests/order-items/order-item-fee.php similarity index 100% rename from tests/unit-tests/order-items/order-item-fee.php rename to tests/legacy/unit-tests/order-items/order-item-fee.php diff --git a/tests/unit-tests/order-items/order-item-meta.php b/tests/legacy/unit-tests/order-items/order-item-meta.php similarity index 100% rename from tests/unit-tests/order-items/order-item-meta.php rename to tests/legacy/unit-tests/order-items/order-item-meta.php diff --git a/tests/unit-tests/order-items/order-item-tax.php b/tests/legacy/unit-tests/order-items/order-item-tax.php similarity index 100% rename from tests/unit-tests/order-items/order-item-tax.php rename to tests/legacy/unit-tests/order-items/order-item-tax.php diff --git a/tests/unit-tests/order/class-wc-tests-crud-orders.php b/tests/legacy/unit-tests/order/class-wc-tests-crud-orders.php similarity index 100% rename from tests/unit-tests/order/class-wc-tests-crud-orders.php rename to tests/legacy/unit-tests/order/class-wc-tests-crud-orders.php diff --git a/tests/unit-tests/order/class-wc-tests-order-functions.php b/tests/legacy/unit-tests/order/class-wc-tests-order-functions.php similarity index 100% rename from tests/unit-tests/order/class-wc-tests-order-functions.php rename to tests/legacy/unit-tests/order/class-wc-tests-order-functions.php diff --git a/tests/unit-tests/order/class-wc-tests-orders.php b/tests/legacy/unit-tests/order/class-wc-tests-orders.php similarity index 100% rename from tests/unit-tests/order/class-wc-tests-orders.php rename to tests/legacy/unit-tests/order/class-wc-tests-orders.php diff --git a/tests/unit-tests/order/coupons.php b/tests/legacy/unit-tests/order/coupons.php similarity index 100% rename from tests/unit-tests/order/coupons.php rename to tests/legacy/unit-tests/order/coupons.php diff --git a/tests/unit-tests/order/query.php b/tests/legacy/unit-tests/order/query.php similarity index 100% rename from tests/unit-tests/order/query.php rename to tests/legacy/unit-tests/order/query.php diff --git a/tests/unit-tests/packages/packages.php b/tests/legacy/unit-tests/packages/packages.php similarity index 100% rename from tests/unit-tests/packages/packages.php rename to tests/legacy/unit-tests/packages/packages.php diff --git a/tests/unit-tests/page-functions/class-wc-tests-page-functions.php b/tests/legacy/unit-tests/page-functions/class-wc-tests-page-functions.php similarity index 100% rename from tests/unit-tests/page-functions/class-wc-tests-page-functions.php rename to tests/legacy/unit-tests/page-functions/class-wc-tests-page-functions.php diff --git a/tests/unit-tests/payment-gateways/cod.php b/tests/legacy/unit-tests/payment-gateways/cod.php similarity index 100% rename from tests/unit-tests/payment-gateways/cod.php rename to tests/legacy/unit-tests/payment-gateways/cod.php diff --git a/tests/unit-tests/payment-gateways/payment-gateways.php b/tests/legacy/unit-tests/payment-gateways/payment-gateways.php similarity index 100% rename from tests/unit-tests/payment-gateways/payment-gateways.php rename to tests/legacy/unit-tests/payment-gateways/payment-gateways.php diff --git a/tests/unit-tests/payment-tokens/cc.php b/tests/legacy/unit-tests/payment-tokens/cc.php similarity index 100% rename from tests/unit-tests/payment-tokens/cc.php rename to tests/legacy/unit-tests/payment-tokens/cc.php diff --git a/tests/unit-tests/payment-tokens/echeck.php b/tests/legacy/unit-tests/payment-tokens/echeck.php similarity index 100% rename from tests/unit-tests/payment-tokens/echeck.php rename to tests/legacy/unit-tests/payment-tokens/echeck.php diff --git a/tests/unit-tests/payment-tokens/payment-token.php b/tests/legacy/unit-tests/payment-tokens/payment-token.php similarity index 100% rename from tests/unit-tests/payment-tokens/payment-token.php rename to tests/legacy/unit-tests/payment-tokens/payment-token.php diff --git a/tests/unit-tests/payment-tokens/payment-tokens.php b/tests/legacy/unit-tests/payment-tokens/payment-tokens.php similarity index 100% rename from tests/unit-tests/payment-tokens/payment-tokens.php rename to tests/legacy/unit-tests/payment-tokens/payment-tokens.php diff --git a/tests/unit-tests/privacy/export.php b/tests/legacy/unit-tests/privacy/export.php similarity index 100% rename from tests/unit-tests/privacy/export.php rename to tests/legacy/unit-tests/privacy/export.php diff --git a/tests/unit-tests/product/class-wc-tests-product-download.php b/tests/legacy/unit-tests/product/class-wc-tests-product-download.php similarity index 100% rename from tests/unit-tests/product/class-wc-tests-product-download.php rename to tests/legacy/unit-tests/product/class-wc-tests-product-download.php diff --git a/tests/unit-tests/product/data-store.php b/tests/legacy/unit-tests/product/data-store.php similarity index 100% rename from tests/unit-tests/product/data-store.php rename to tests/legacy/unit-tests/product/data-store.php diff --git a/tests/unit-tests/product/data.php b/tests/legacy/unit-tests/product/data.php similarity index 100% rename from tests/unit-tests/product/data.php rename to tests/legacy/unit-tests/product/data.php diff --git a/tests/unit-tests/product/factory.php b/tests/legacy/unit-tests/product/factory.php similarity index 100% rename from tests/unit-tests/product/factory.php rename to tests/legacy/unit-tests/product/factory.php diff --git a/tests/unit-tests/product/functions.php b/tests/legacy/unit-tests/product/functions.php similarity index 100% rename from tests/unit-tests/product/functions.php rename to tests/legacy/unit-tests/product/functions.php diff --git a/tests/unit-tests/product/product-simple.php b/tests/legacy/unit-tests/product/product-simple.php similarity index 100% rename from tests/unit-tests/product/product-simple.php rename to tests/legacy/unit-tests/product/product-simple.php diff --git a/tests/unit-tests/product/product-variable.php b/tests/legacy/unit-tests/product/product-variable.php similarity index 100% rename from tests/unit-tests/product/product-variable.php rename to tests/legacy/unit-tests/product/product-variable.php diff --git a/tests/unit-tests/product/product-variation.php b/tests/legacy/unit-tests/product/product-variation.php similarity index 100% rename from tests/unit-tests/product/product-variation.php rename to tests/legacy/unit-tests/product/product-variation.php diff --git a/tests/unit-tests/product/query.php b/tests/legacy/unit-tests/product/query.php similarity index 100% rename from tests/unit-tests/product/query.php rename to tests/legacy/unit-tests/product/query.php diff --git a/tests/unit-tests/queue/queue.php b/tests/legacy/unit-tests/queue/queue.php similarity index 100% rename from tests/unit-tests/queue/queue.php rename to tests/legacy/unit-tests/queue/queue.php diff --git a/tests/unit-tests/session/class-wc-tests-session-handler.php b/tests/legacy/unit-tests/session/class-wc-tests-session-handler.php similarity index 100% rename from tests/unit-tests/session/class-wc-tests-session-handler.php rename to tests/legacy/unit-tests/session/class-wc-tests-session-handler.php diff --git a/tests/unit-tests/settings/register-wp-admin-settings.php b/tests/legacy/unit-tests/settings/register-wp-admin-settings.php similarity index 100% rename from tests/unit-tests/settings/register-wp-admin-settings.php rename to tests/legacy/unit-tests/settings/register-wp-admin-settings.php diff --git a/tests/unit-tests/setup/functions.php b/tests/legacy/unit-tests/setup/functions.php similarity index 100% rename from tests/unit-tests/setup/functions.php rename to tests/legacy/unit-tests/setup/functions.php diff --git a/tests/unit-tests/shipping/shipping-zone.php b/tests/legacy/unit-tests/shipping/shipping-zone.php similarity index 100% rename from tests/unit-tests/shipping/shipping-zone.php rename to tests/legacy/unit-tests/shipping/shipping-zone.php diff --git a/tests/unit-tests/shipping/shipping-zones.php b/tests/legacy/unit-tests/shipping/shipping-zones.php similarity index 100% rename from tests/unit-tests/shipping/shipping-zones.php rename to tests/legacy/unit-tests/shipping/shipping-zones.php diff --git a/tests/unit-tests/shipping/shipping.php b/tests/legacy/unit-tests/shipping/shipping.php similarity index 100% rename from tests/unit-tests/shipping/shipping.php rename to tests/legacy/unit-tests/shipping/shipping.php diff --git a/tests/unit-tests/shortcodes/products.php b/tests/legacy/unit-tests/shortcodes/products.php similarity index 100% rename from tests/unit-tests/shortcodes/products.php rename to tests/legacy/unit-tests/shortcodes/products.php diff --git a/tests/unit-tests/tax/tax.php b/tests/legacy/unit-tests/tax/tax.php similarity index 100% rename from tests/unit-tests/tax/tax.php rename to tests/legacy/unit-tests/tax/tax.php diff --git a/tests/unit-tests/templates/functions.php b/tests/legacy/unit-tests/templates/functions.php similarity index 100% rename from tests/unit-tests/templates/functions.php rename to tests/legacy/unit-tests/templates/functions.php diff --git a/tests/unit-tests/totals/totals.php b/tests/legacy/unit-tests/totals/totals.php similarity index 100% rename from tests/unit-tests/totals/totals.php rename to tests/legacy/unit-tests/totals/totals.php diff --git a/tests/unit-tests/util/api-functions.php b/tests/legacy/unit-tests/util/api-functions.php similarity index 100% rename from tests/unit-tests/util/api-functions.php rename to tests/legacy/unit-tests/util/api-functions.php diff --git a/tests/unit-tests/util/class-wc-rate-limiter.php b/tests/legacy/unit-tests/util/class-wc-rate-limiter.php similarity index 100% rename from tests/unit-tests/util/class-wc-rate-limiter.php rename to tests/legacy/unit-tests/util/class-wc-rate-limiter.php diff --git a/tests/unit-tests/util/class-wc-tests-core-functions.php b/tests/legacy/unit-tests/util/class-wc-tests-core-functions.php similarity index 100% rename from tests/unit-tests/util/class-wc-tests-core-functions.php rename to tests/legacy/unit-tests/util/class-wc-tests-core-functions.php diff --git a/tests/unit-tests/util/class-wc-tests-user-functions.php b/tests/legacy/unit-tests/util/class-wc-tests-user-functions.php similarity index 100% rename from tests/unit-tests/util/class-wc-tests-user-functions.php rename to tests/legacy/unit-tests/util/class-wc-tests-user-functions.php diff --git a/tests/unit-tests/util/class-wc-tests-wc-query.php b/tests/legacy/unit-tests/util/class-wc-tests-wc-query.php similarity index 100% rename from tests/unit-tests/util/class-wc-tests-wc-query.php rename to tests/legacy/unit-tests/util/class-wc-tests-wc-query.php diff --git a/tests/unit-tests/util/conditional-functions.php b/tests/legacy/unit-tests/util/conditional-functions.php similarity index 100% rename from tests/unit-tests/util/conditional-functions.php rename to tests/legacy/unit-tests/util/conditional-functions.php diff --git a/tests/unit-tests/util/deprecated-hooks.php b/tests/legacy/unit-tests/util/deprecated-hooks.php similarity index 100% rename from tests/unit-tests/util/deprecated-hooks.php rename to tests/legacy/unit-tests/util/deprecated-hooks.php diff --git a/tests/unit-tests/util/dummy-wc-logger.php b/tests/legacy/unit-tests/util/dummy-wc-logger.php similarity index 100% rename from tests/unit-tests/util/dummy-wc-logger.php rename to tests/legacy/unit-tests/util/dummy-wc-logger.php diff --git a/tests/unit-tests/util/install.php b/tests/legacy/unit-tests/util/install.php similarity index 96% rename from tests/unit-tests/util/install.php rename to tests/legacy/unit-tests/util/install.php index 8e9835384e8de..44b28b7161e34 100644 --- a/tests/unit-tests/util/install.php +++ b/tests/legacy/unit-tests/util/install.php @@ -45,7 +45,7 @@ public function test_install() { define( 'WC_REMOVE_ALL_DATA', true ); } - include dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/uninstall.php'; + include dirname( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) ) . '/uninstall.php'; delete_transient( 'wc_installing' ); WC_Install::install(); @@ -99,7 +99,7 @@ public function test_create_roles() { define( 'WP_UNINSTALL_PLUGIN', true ); define( 'WC_REMOVE_ALL_DATA', true ); } - include dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/uninstall.php'; + include dirname( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) ) . '/uninstall.php'; WC_Install::create_roles(); diff --git a/tests/unit-tests/util/notice-functions.php b/tests/legacy/unit-tests/util/notice-functions.php similarity index 100% rename from tests/unit-tests/util/notice-functions.php rename to tests/legacy/unit-tests/util/notice-functions.php diff --git a/tests/unit-tests/util/plugin-updates.php b/tests/legacy/unit-tests/util/plugin-updates.php similarity index 100% rename from tests/unit-tests/util/plugin-updates.php rename to tests/legacy/unit-tests/util/plugin-updates.php diff --git a/tests/unit-tests/util/validation.php b/tests/legacy/unit-tests/util/validation.php similarity index 100% rename from tests/unit-tests/util/validation.php rename to tests/legacy/unit-tests/util/validation.php diff --git a/tests/unit-tests/webhooks/crud.php b/tests/legacy/unit-tests/webhooks/crud.php similarity index 100% rename from tests/unit-tests/webhooks/crud.php rename to tests/legacy/unit-tests/webhooks/crud.php diff --git a/tests/unit-tests/webhooks/functions.php b/tests/legacy/unit-tests/webhooks/functions.php similarity index 100% rename from tests/unit-tests/webhooks/functions.php rename to tests/legacy/unit-tests/webhooks/functions.php diff --git a/tests/unit-tests/widgets/class-dummy-widget.php b/tests/legacy/unit-tests/widgets/class-dummy-widget.php similarity index 100% rename from tests/unit-tests/widgets/class-dummy-widget.php rename to tests/legacy/unit-tests/widgets/class-dummy-widget.php diff --git a/tests/unit-tests/widgets/class-wc-tests-widget.php b/tests/legacy/unit-tests/widgets/class-wc-tests-widget.php similarity index 100% rename from tests/unit-tests/widgets/class-wc-tests-widget.php rename to tests/legacy/unit-tests/widgets/class-wc-tests-widget.php From 1b2f5ab4ad1f62dac4e15ed10f89a08e7626fa45 Mon Sep 17 00:00:00 2001 From: Christopher Allford Date: Tue, 28 Apr 2020 14:04:00 -0700 Subject: [PATCH 2/5] Added handling to prevent namespace conflicts with included packages The root namespace of Core is Automattic\WooCommerce, but both the blocks and wc-admin plugins exist in this namespace. In an effort to prevent possible conflicts, we should not allow for overlap in our repository. The rationale behind doing this as opposed to renaming our root namespace feels reasonable. In the case of Blocks, all of the tooling is already set up in their repository, so all blocks should go there anyway. In the case of WC-Admin, we shouldn't be refactoring admin classes, as that would duplicate work done to revamp them entirely. --- src/Admin/.gitignore | 5 +++++ src/Admin/README.md | 3 +++ src/Blocks/.gitignore | 5 +++++ src/Blocks/README.md | 3 +++ 4 files changed, 16 insertions(+) create mode 100644 src/Admin/.gitignore create mode 100644 src/Admin/README.md create mode 100644 src/Blocks/.gitignore create mode 100644 src/Blocks/README.md diff --git a/src/Admin/.gitignore b/src/Admin/.gitignore new file mode 100644 index 0000000000000..ee8d4ea0dd0c5 --- /dev/null +++ b/src/Admin/.gitignore @@ -0,0 +1,5 @@ +# Prevent anyone from accidentally adding code to these directories. +# This will break any PRs that do, revealing ths mistake they made. +* +!.gitignore +!README.md diff --git a/src/Admin/README.md b/src/Admin/README.md new file mode 100644 index 0000000000000..3251e1f9956d7 --- /dev/null +++ b/src/Admin/README.md @@ -0,0 +1,3 @@ +# WARNING + +The namespace of this folder belongs to the [WC-Admin Plugin](https://github.com/woocommerce/woocommerce-admin) that is included in Core via composer. Any contributions to this namespace should be made in the corresponding repository to prevent conflicts. diff --git a/src/Blocks/.gitignore b/src/Blocks/.gitignore new file mode 100644 index 0000000000000..ee8d4ea0dd0c5 --- /dev/null +++ b/src/Blocks/.gitignore @@ -0,0 +1,5 @@ +# Prevent anyone from accidentally adding code to these directories. +# This will break any PRs that do, revealing ths mistake they made. +* +!.gitignore +!README.md diff --git a/src/Blocks/README.md b/src/Blocks/README.md new file mode 100644 index 0000000000000..95e6021eb152a --- /dev/null +++ b/src/Blocks/README.md @@ -0,0 +1,3 @@ +# WARNING + +The namespace of this folder belongs to the [Product Blocks Plugin](https://github.com/woocommerce/woocommerce-gutenberg-products-block) that is included in Core via composer. Any contributions to this namespace should be made in the corresponding repository to prevent conflicts. From 04ec11e90b9e2095f5255803c8eb1f3a988ac1e4 Mon Sep 17 00:00:00 2001 From: Christopher Allford Date: Tue, 28 Apr 2020 15:41:04 -0700 Subject: [PATCH 3/5] Added a PSR-4 namespaced tests/php folder for tests written against new code in the src directory --- composer.json | 5 +++++ phpunit.xml | 1 + tests/php/.gitkeep | 1 + 3 files changed, 7 insertions(+) create mode 100644 tests/php/.gitkeep diff --git a/composer.json b/composer.json index 85d4e1443388c..d17f7326e8519 100644 --- a/composer.json +++ b/composer.json @@ -43,6 +43,11 @@ "Automattic\\WooCommerce\\": "src/" } }, + "autoload-dev": { + "psr-4": { + "Automattic\\WooCommerce\\Tests\\": "tests/php/" + } + }, "scripts": { "post-install-cmd": [ "sh ./bin/package-update.sh" diff --git a/phpunit.xml b/phpunit.xml index 772e20117c257..75b6a007d51e3 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -11,6 +11,7 @@ ./tests/legacy/unit-tests + ./tests/php diff --git a/tests/php/.gitkeep b/tests/php/.gitkeep new file mode 100644 index 0000000000000..ff96249002a55 --- /dev/null +++ b/tests/php/.gitkeep @@ -0,0 +1 @@ +# Placeholder to include the folder. Remove once tests have been written! From 98b6b973e8a063d9c8e67c2ec64f1ece82cb66a6 Mon Sep 17 00:00:00 2001 From: Christopher Allford Date: Thu, 30 Apr 2020 10:09:42 -0700 Subject: [PATCH 4/5] Updated the tests readme to explain the purpose of our two test directories --- tests/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/README.md b/tests/README.md index 0c238464efb74..e352b11933f53 100644 --- a/tests/README.md +++ b/tests/README.md @@ -54,6 +54,7 @@ A text code coverage summary can be displayed using the `--coverage-text` option ### Writing Tests +* There are two different PHPUnit directories, `tests/legacy` and `tests/php`. The `tests/legacy` directory contains all of the tests for code in the `includes` directory, and the `tests/php` directory is a PSR-4 namespaced directory for tests of code in the `src` directory. * Each test file should roughly correspond to an associated source file, e.g. the `formatting/functions.php` test file covers code in the `wc-formatting-functions.php` file * Each test method should cover a single method or function with one or more assertions * A single method or function can have multiple associated test methods if it's a large or complex method From 857b2231f703ae3cf9b5b959a72c159b435deec8 Mon Sep 17 00:00:00 2001 From: Christopher Allford Date: Thu, 30 Apr 2020 12:43:22 -0700 Subject: [PATCH 5/5] Added a phpcs exclusion to legacy unit tests --- phpcs.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/phpcs.xml b/phpcs.xml index c8196e3167e02..f437ec8b333a5 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -6,6 +6,7 @@ tests/cli/ + tests/legacy/ includes/libraries/ includes/legacy/ includes/api/legacy/