From f0ff5f5466c658f77babece39dfb07ac4baaf1b2 Mon Sep 17 00:00:00 2001 From: Tonya Mork Date: Tue, 22 Aug 2023 10:57:42 -0500 Subject: [PATCH] Make fonts test files use Core approach (#53856) * Make Fonts test files use Core approach. * Moves the files into phpunit/tests/ directory to match Core. * Removes the `-test.php` suffix from each test file. * Adds the directive to find the test files in phpunit/tests/ (to match how Core does it). * Adds GUTENBERG_DIR_TESTDATA and GUTENBERG_DIR_TESTFIXTURES constants to make it easier on tests to point to these locations. * Rename testcase to base.php --- phpunit.xml.dist | 1 + phpunit/bootstrap.php | 2 ++ phpunit/multisite.xml | 1 + .../wp-fonts-testcase.php => tests/fonts-api/base.php} | 2 +- .../fonts-api/bc-layer/base.php} | 2 +- .../{ => tests}/fonts-api/bc-layer/bc-layer-tests-dataset.php | 0 .../gutenbergFontsApiBcLayer/isDeprecatedStructure.php} | 2 +- .../gutenbergFontsApiBcLayer/migrateDeprecatedStructure.php} | 2 +- .../fonts-api/bc-layer/wpRegisterWebfonts.php} | 2 +- .../fonts-api/bc-layer/wpWebfonts/getAllWebfonts.php} | 2 +- .../fonts-api/bc-layer/wpWebfonts/getFontSlug.php} | 2 +- .../fonts-api/bc-layer/wpWebfonts/getRegisteredWebfonts.php} | 2 +- .../fonts-api/bc-layer/wpWebfonts/registerWebfont.php} | 2 +- phpunit/{ => tests}/fonts-api/wp-fonts-tests-dataset.php | 0 .../fonts-api/wpDeregisterFontFamily.php} | 2 +- .../fonts-api/wpDeregisterFontVariation.php} | 2 +- .../fonts-api/wpEnqueueFontVariations.php} | 2 +- .../fonts-api/wpEnqueueFonts.php} | 2 +- .../wpFonts-test.php => tests/fonts-api/wpFonts.php} | 2 +- .../wpFonts/add-test.php => tests/fonts-api/wpFonts/add.php} | 2 +- .../fonts-api/wpFonts/addFontFamily.php} | 2 +- .../fonts-api/wpFonts/addVariation.php} | 2 +- .../dequeue-test.php => tests/fonts-api/wpFonts/dequeue.php} | 2 +- .../doItem-test.php => tests/fonts-api/wpFonts/doItem.php} | 2 +- .../doItems-test.php => tests/fonts-api/wpFonts/doItems.php} | 4 ++-- .../enqueue-test.php => tests/fonts-api/wpFonts/enqueue.php} | 2 +- .../fonts-api/wpFonts/getEnqueued.php} | 2 +- .../fonts-api/wpFonts/getProviders.php} | 4 ++-- .../fonts-api/wpFonts/getRegistered.php} | 2 +- .../query-test.php => tests/fonts-api/wpFonts/query.php} | 2 +- .../fonts-api/wpFonts/registerProvider.php} | 4 ++-- .../remove-test.php => tests/fonts-api/wpFonts/remove.php} | 2 +- .../fonts-api/wpFonts/removeFontFamily.php} | 2 +- .../fonts-api/wpFonts/removeVariation.php} | 2 +- .../fonts-api/wpFontsProviderLocal.php} | 4 ++-- .../fonts-api/wpFontsResolver/addMissingFontsToThemeJson.php} | 2 +- .../fonts-api/wpFontsResolver/enqueueUserSelectedFonts.php} | 2 +- .../fonts-api/wpFontsResolver/registerFontsFromThemeJson.php} | 2 +- .../fonts-api/wpFontsUtils/convertFontFamilyIntoHandle.php} | 2 +- .../fonts-api/wpFontsUtils/convertVariationIntoHandle.php} | 2 +- .../fonts-api/wpFontsUtils/getFontFamilyFromVariation.php} | 2 +- .../fonts-api/wpFontsUtils/isDefined.php} | 2 +- .../fonts-api/wpPrintFonts.php} | 4 ++-- .../fonts-api/wpRegisterFontProvider.php} | 4 ++-- .../fonts-api/wpRegisterFonts.php} | 2 +- .../fonts/font-face/base.php} | 2 +- .../fonts/font-face/wp-font-face-tests-dataset.php | 0 .../fonts/font-face/wpFontFace/generateAndPrint.php} | 2 +- .../font-face/wpFontFaceResolver/getFontsFromThemeJson.php} | 2 +- .../fonts/font-face/wpPrintFontFaces.php} | 2 +- .../font-library/class-wp-rest-font-library-controller.php} | 0 .../fonts/font-library/wpFontFamily/__construct.php} | 0 phpunit/{ => tests}/fonts/font-library/wpFontFamily/base.php | 0 .../fonts/font-library/wpFontFamily/getData.php} | 0 .../fonts/font-library/wpFontFamily/getDataAsJson.php} | 0 .../fonts/font-library/wpFontFamily/getFontPost.php} | 0 .../fonts/font-library/wpFontFamily/hasFontFaces.php} | 0 .../fonts/font-library/wpFontFamily/install.php} | 0 .../fonts/font-library/wpFontFamily/uninstall.php} | 0 .../wpFontFamilyUtils/getFilenameFromFontFace.php} | 0 .../fonts/font-library/wpFontFamilyUtils/hasFontMimeType.php} | 0 .../fonts/font-library/wpFontFamilyUtils/mergeFontsData.php} | 0 .../fonts/font-library/wpFontLibrary/getFontsDir.php} | 0 .../fonts/font-library/wpFontLibrary/setUploadDir.php} | 0 64 files changed, 54 insertions(+), 50 deletions(-) rename phpunit/{fonts-api/wp-fonts-testcase.php => tests/fonts-api/base.php} (99%) rename phpunit/{fonts-api/bc-layer/fonts-bc-layer-testcase.php => tests/fonts-api/bc-layer/base.php} (94%) rename phpunit/{ => tests}/fonts-api/bc-layer/bc-layer-tests-dataset.php (100%) rename phpunit/{fonts-api/bc-layer/gutenbergFontsApiBcLayer/isDeprecatedStructure-test.php => tests/fonts-api/bc-layer/gutenbergFontsApiBcLayer/isDeprecatedStructure.php} (94%) rename phpunit/{fonts-api/bc-layer/gutenbergFontsApiBcLayer/migrateDeprecatedStructure-test.php => tests/fonts-api/bc-layer/gutenbergFontsApiBcLayer/migrateDeprecatedStructure.php} (95%) rename phpunit/{fonts-api/bc-layer/wpRegisterWebfonts-test.php => tests/fonts-api/bc-layer/wpRegisterWebfonts.php} (97%) rename phpunit/{fonts-api/bc-layer/wpWebfonts/getAllWebfonts-test.php => tests/fonts-api/bc-layer/wpWebfonts/getAllWebfonts.php} (93%) rename phpunit/{fonts-api/bc-layer/wpWebfonts/getFontSlug-test.php => tests/fonts-api/bc-layer/wpWebfonts/getFontSlug.php} (98%) rename phpunit/{fonts-api/bc-layer/wpWebfonts/getRegisteredWebfonts-test.php => tests/fonts-api/bc-layer/wpWebfonts/getRegisteredWebfonts.php} (93%) rename phpunit/{fonts-api/bc-layer/wpWebfonts/registerWebfont-test.php => tests/fonts-api/bc-layer/wpWebfonts/registerWebfont.php} (98%) rename phpunit/{ => tests}/fonts-api/wp-fonts-tests-dataset.php (100%) rename phpunit/{fonts-api/wpDeregisterFontFamily-test.php => tests/fonts-api/wpDeregisterFontFamily.php} (98%) rename phpunit/{fonts-api/wpDeregisterFontVariation-test.php => tests/fonts-api/wpDeregisterFontVariation.php} (99%) rename phpunit/{fonts-api/wpEnqueueFontVariations-test.php => tests/fonts-api/wpEnqueueFontVariations.php} (98%) rename phpunit/{fonts-api/wpEnqueueFonts-test.php => tests/fonts-api/wpEnqueueFonts.php} (98%) rename phpunit/{fonts-api/wpFonts-test.php => tests/fonts-api/wpFonts.php} (94%) rename phpunit/{fonts-api/wpFonts/add-test.php => tests/fonts-api/wpFonts/add.php} (95%) rename phpunit/{fonts-api/wpFonts/addFontFamily-test.php => tests/fonts-api/wpFonts/addFontFamily.php} (97%) rename phpunit/{fonts-api/wpFonts/addVariation-test.php => tests/fonts-api/wpFonts/addVariation.php} (99%) rename phpunit/{fonts-api/wpFonts/dequeue-test.php => tests/fonts-api/wpFonts/dequeue.php} (97%) rename phpunit/{fonts-api/wpFonts/doItem-test.php => tests/fonts-api/wpFonts/doItem.php} (99%) rename phpunit/{fonts-api/wpFonts/doItems-test.php => tests/fonts-api/wpFonts/doItems.php} (98%) rename phpunit/{fonts-api/wpFonts/enqueue-test.php => tests/fonts-api/wpFonts/enqueue.php} (97%) rename phpunit/{fonts-api/wpFonts/getEnqueued-test.php => tests/fonts-api/wpFonts/getEnqueued.php} (96%) rename phpunit/{fonts-api/wpFonts/getProviders-test.php => tests/fonts-api/wpFonts/getProviders.php} (93%) rename phpunit/{fonts-api/wpFonts/getRegistered-test.php => tests/fonts-api/wpFonts/getRegistered.php} (97%) rename phpunit/{fonts-api/wpFonts/query-test.php => tests/fonts-api/wpFonts/query.php} (98%) rename phpunit/{fonts-api/wpFonts/registerProvider-test.php => tests/fonts-api/wpFonts/registerProvider.php} (96%) rename phpunit/{fonts-api/wpFonts/remove-test.php => tests/fonts-api/wpFonts/remove.php} (97%) rename phpunit/{fonts-api/wpFonts/removeFontFamily-test.php => tests/fonts-api/wpFonts/removeFontFamily.php} (98%) rename phpunit/{fonts-api/wpFonts/removeVariation-test.php => tests/fonts-api/wpFonts/removeVariation.php} (99%) rename phpunit/{fonts-api/wpFontsProviderLocal-test.php => tests/fonts-api/wpFontsProviderLocal.php} (97%) rename phpunit/{fonts-api/wpFontsResolver/addMissingFontsToThemeJson-test.php => tests/fonts-api/wpFontsResolver/addMissingFontsToThemeJson.php} (99%) rename phpunit/{fonts-api/wpFontsResolver/enqueueUserSelectedFonts-test.php => tests/fonts-api/wpFontsResolver/enqueueUserSelectedFonts.php} (98%) rename phpunit/{fonts-api/wpFontsResolver/registerFontsFromThemeJson-test.php => tests/fonts-api/wpFontsResolver/registerFontsFromThemeJson.php} (99%) rename phpunit/{fonts-api/wpFontsUtils/convertFontFamilyIntoHandle-test.php => tests/fonts-api/wpFontsUtils/convertFontFamilyIntoHandle.php} (97%) rename phpunit/{fonts-api/wpFontsUtils/convertVariationIntoHandle-test.php => tests/fonts-api/wpFontsUtils/convertVariationIntoHandle.php} (98%) rename phpunit/{fonts-api/wpFontsUtils/getFontFamilyFromVariation-test.php => tests/fonts-api/wpFontsUtils/getFontFamilyFromVariation.php} (98%) rename phpunit/{fonts-api/wpFontsUtils/isDefined-test.php => tests/fonts-api/wpFontsUtils/isDefined.php} (96%) rename phpunit/{fonts-api/wpPrintFonts-test.php => tests/fonts-api/wpPrintFonts.php} (98%) rename phpunit/{fonts-api/wpRegisterFontProvider-test.php => tests/fonts-api/wpRegisterFontProvider.php} (95%) rename phpunit/{fonts-api/wpRegisterFonts-test.php => tests/fonts-api/wpRegisterFonts.php} (98%) rename phpunit/{fonts/font-face/wp-font-face-testcase.php => tests/fonts/font-face/base.php} (98%) rename phpunit/{ => tests}/fonts/font-face/wp-font-face-tests-dataset.php (100%) rename phpunit/{fonts/font-face/wpFontFace/generateAndPrint-test.php => tests/fonts/font-face/wpFontFace/generateAndPrint.php} (94%) rename phpunit/{fonts/font-face/wpFontFaceResolver/getFontsFromThemeJson-test.php => tests/fonts/font-face/wpFontFaceResolver/getFontsFromThemeJson.php} (98%) rename phpunit/{fonts/font-face/wpPrintFontFaces-test.php => tests/fonts/font-face/wpPrintFontFaces.php} (96%) rename phpunit/{fonts/font-library/class-wp-rest-font-library-controller-test.php => tests/fonts/font-library/class-wp-rest-font-library-controller.php} (100%) rename phpunit/{fonts/font-library/wpFontFamily/__construct-test.php => tests/fonts/font-library/wpFontFamily/__construct.php} (100%) rename phpunit/{ => tests}/fonts/font-library/wpFontFamily/base.php (100%) rename phpunit/{fonts/font-library/wpFontFamily/getData-test.php => tests/fonts/font-library/wpFontFamily/getData.php} (100%) rename phpunit/{fonts/font-library/wpFontFamily/getDataAsJson-test.php => tests/fonts/font-library/wpFontFamily/getDataAsJson.php} (100%) rename phpunit/{fonts/font-library/wpFontFamily/getFontPost-test.php => tests/fonts/font-library/wpFontFamily/getFontPost.php} (100%) rename phpunit/{fonts/font-library/wpFontFamily/hasFontFaces-test.php => tests/fonts/font-library/wpFontFamily/hasFontFaces.php} (100%) rename phpunit/{fonts/font-library/wpFontFamily/install-test.php => tests/fonts/font-library/wpFontFamily/install.php} (100%) rename phpunit/{fonts/font-library/wpFontFamily/uninstall-test.php => tests/fonts/font-library/wpFontFamily/uninstall.php} (100%) rename phpunit/{fonts/font-library/wpFontFamilyUtils/getFilenameFromFontFace-test.php => tests/fonts/font-library/wpFontFamilyUtils/getFilenameFromFontFace.php} (100%) rename phpunit/{fonts/font-library/wpFontFamilyUtils/hasFontMimeType-test.php => tests/fonts/font-library/wpFontFamilyUtils/hasFontMimeType.php} (100%) rename phpunit/{fonts/font-library/wpFontFamilyUtils/mergeFontsData-test.php => tests/fonts/font-library/wpFontFamilyUtils/mergeFontsData.php} (100%) rename phpunit/{fonts/font-library/wpFontLibrary/getFontsDir-test.php => tests/fonts/font-library/wpFontLibrary/getFontsDir.php} (100%) rename phpunit/{fonts/font-library/wpFontLibrary/setUploadDir-test.php => tests/fonts/font-library/wpFontLibrary/setUploadDir.php} (100%) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 8e8a0fb2f09215..4a4c9bf6569356 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -14,6 +14,7 @@ ./phpunit/ + ./phpunit/tests/ diff --git a/phpunit/bootstrap.php b/phpunit/bootstrap.php index f64e6fa5c7ef14..7084df68443baa 100644 --- a/phpunit/bootstrap.php +++ b/phpunit/bootstrap.php @@ -21,6 +21,8 @@ if ( ! defined( 'LOCAL_WP_ENVIRONMENT_TYPE' ) ) { define( 'LOCAL_WP_ENVIRONMENT_TYPE', 'local' ); } +define( 'GUTENBERG_DIR_TESTDATA', __DIR__ . '/data/' ); +define( 'GUTENBERG_DIR_TESTFIXTURES', __DIR__ . '/fixtures/' ); // Pretend that these are Core unit tests. This is needed so that // wp_theme_has_theme_json() does not cache its return value between each test. diff --git a/phpunit/multisite.xml b/phpunit/multisite.xml index 03b0b5314bc507..ac18402abb0c82 100644 --- a/phpunit/multisite.xml +++ b/phpunit/multisite.xml @@ -15,6 +15,7 @@ ./ + ./tests/ diff --git a/phpunit/fonts-api/wp-fonts-testcase.php b/phpunit/tests/fonts-api/base.php similarity index 99% rename from phpunit/fonts-api/wp-fonts-testcase.php rename to phpunit/tests/fonts-api/base.php index b7bff9234b9ed0..11ae3b624ea8ca 100644 --- a/phpunit/fonts-api/wp-fonts-testcase.php +++ b/phpunit/tests/fonts-api/base.php @@ -70,7 +70,7 @@ public static function set_up_before_class() { parent::set_up_before_class(); if ( self::$requires_switch_theme_fixtures ) { - self::$theme_root = realpath( __DIR__ . '/../data/themedir1' ); + self::$theme_root = realpath( GUTENBERG_DIR_TESTDATA . '/themedir1' ); } } diff --git a/phpunit/fonts-api/bc-layer/fonts-bc-layer-testcase.php b/phpunit/tests/fonts-api/bc-layer/base.php similarity index 94% rename from phpunit/fonts-api/bc-layer/fonts-bc-layer-testcase.php rename to phpunit/tests/fonts-api/bc-layer/base.php index 6c5e3bad800b8e..27a4d43f7188a2 100644 --- a/phpunit/fonts-api/bc-layer/fonts-bc-layer-testcase.php +++ b/phpunit/tests/fonts-api/bc-layer/base.php @@ -6,7 +6,7 @@ * @subpackage Fonts API */ -require_once __DIR__ . '/../wp-fonts-testcase.php'; +require_once dirname( __DIR__ ) . '/base.php'; require_once __DIR__ . '/bc-layer-tests-dataset.php'; /** diff --git a/phpunit/fonts-api/bc-layer/bc-layer-tests-dataset.php b/phpunit/tests/fonts-api/bc-layer/bc-layer-tests-dataset.php similarity index 100% rename from phpunit/fonts-api/bc-layer/bc-layer-tests-dataset.php rename to phpunit/tests/fonts-api/bc-layer/bc-layer-tests-dataset.php diff --git a/phpunit/fonts-api/bc-layer/gutenbergFontsApiBcLayer/isDeprecatedStructure-test.php b/phpunit/tests/fonts-api/bc-layer/gutenbergFontsApiBcLayer/isDeprecatedStructure.php similarity index 94% rename from phpunit/fonts-api/bc-layer/gutenbergFontsApiBcLayer/isDeprecatedStructure-test.php rename to phpunit/tests/fonts-api/bc-layer/gutenbergFontsApiBcLayer/isDeprecatedStructure.php index e623ecf19f7d13..d76de3f205005d 100644 --- a/phpunit/fonts-api/bc-layer/gutenbergFontsApiBcLayer/isDeprecatedStructure-test.php +++ b/phpunit/tests/fonts-api/bc-layer/gutenbergFontsApiBcLayer/isDeprecatedStructure.php @@ -6,7 +6,7 @@ * @subpackage Fonts API */ -require_once __DIR__ . '/../fonts-bc-layer-testcase.php'; +require_once dirname( __DIR__ ) . '/base.php'; /** * @group fontsapi diff --git a/phpunit/fonts-api/bc-layer/gutenbergFontsApiBcLayer/migrateDeprecatedStructure-test.php b/phpunit/tests/fonts-api/bc-layer/gutenbergFontsApiBcLayer/migrateDeprecatedStructure.php similarity index 95% rename from phpunit/fonts-api/bc-layer/gutenbergFontsApiBcLayer/migrateDeprecatedStructure-test.php rename to phpunit/tests/fonts-api/bc-layer/gutenbergFontsApiBcLayer/migrateDeprecatedStructure.php index c0e2c77d9ca1c2..b98481dfbf942f 100644 --- a/phpunit/fonts-api/bc-layer/gutenbergFontsApiBcLayer/migrateDeprecatedStructure-test.php +++ b/phpunit/tests/fonts-api/bc-layer/gutenbergFontsApiBcLayer/migrateDeprecatedStructure.php @@ -6,7 +6,7 @@ * @subpackage Fonts API */ -require_once __DIR__ . '/../fonts-bc-layer-testcase.php'; +require_once dirname( __DIR__ ) . '/base.php'; /** * @group fontsapi diff --git a/phpunit/fonts-api/bc-layer/wpRegisterWebfonts-test.php b/phpunit/tests/fonts-api/bc-layer/wpRegisterWebfonts.php similarity index 97% rename from phpunit/fonts-api/bc-layer/wpRegisterWebfonts-test.php rename to phpunit/tests/fonts-api/bc-layer/wpRegisterWebfonts.php index 4a64068fee8c86..59e0a9d314a135 100644 --- a/phpunit/fonts-api/bc-layer/wpRegisterWebfonts-test.php +++ b/phpunit/tests/fonts-api/bc-layer/wpRegisterWebfonts.php @@ -6,7 +6,7 @@ * @subpackage Fonts API */ -require_once __DIR__ . '/fonts-bc-layer-testcase.php'; +require_once __DIR__ . '/base.php'; /** * @group fontsapi diff --git a/phpunit/fonts-api/bc-layer/wpWebfonts/getAllWebfonts-test.php b/phpunit/tests/fonts-api/bc-layer/wpWebfonts/getAllWebfonts.php similarity index 93% rename from phpunit/fonts-api/bc-layer/wpWebfonts/getAllWebfonts-test.php rename to phpunit/tests/fonts-api/bc-layer/wpWebfonts/getAllWebfonts.php index d6c1e10b691e4a..7a217a343c5359 100644 --- a/phpunit/fonts-api/bc-layer/wpWebfonts/getAllWebfonts-test.php +++ b/phpunit/tests/fonts-api/bc-layer/wpWebfonts/getAllWebfonts.php @@ -6,7 +6,7 @@ * @subpackage Fonts API */ -require_once __DIR__ . '/../../wp-fonts-testcase.php'; +require_once dirname( __DIR__ ) . '/base.php'; /** * @group fontsapi diff --git a/phpunit/fonts-api/bc-layer/wpWebfonts/getFontSlug-test.php b/phpunit/tests/fonts-api/bc-layer/wpWebfonts/getFontSlug.php similarity index 98% rename from phpunit/fonts-api/bc-layer/wpWebfonts/getFontSlug-test.php rename to phpunit/tests/fonts-api/bc-layer/wpWebfonts/getFontSlug.php index df17cb69b621c4..7c05f24b037520 100644 --- a/phpunit/fonts-api/bc-layer/wpWebfonts/getFontSlug-test.php +++ b/phpunit/tests/fonts-api/bc-layer/wpWebfonts/getFontSlug.php @@ -6,7 +6,7 @@ * @subpackage Fonts API */ -require_once __DIR__ . '/../fonts-bc-layer-testcase.php'; +require_once dirname( __DIR__ ) . '/base.php'; /** * @group fontsapi diff --git a/phpunit/fonts-api/bc-layer/wpWebfonts/getRegisteredWebfonts-test.php b/phpunit/tests/fonts-api/bc-layer/wpWebfonts/getRegisteredWebfonts.php similarity index 93% rename from phpunit/fonts-api/bc-layer/wpWebfonts/getRegisteredWebfonts-test.php rename to phpunit/tests/fonts-api/bc-layer/wpWebfonts/getRegisteredWebfonts.php index 3b41d9d37b4147..7a8c97a4d86471 100644 --- a/phpunit/fonts-api/bc-layer/wpWebfonts/getRegisteredWebfonts-test.php +++ b/phpunit/tests/fonts-api/bc-layer/wpWebfonts/getRegisteredWebfonts.php @@ -6,7 +6,7 @@ * @subpackage Fonts API */ -require_once __DIR__ . '/../fonts-bc-layer-testcase.php'; +require_once dirname( __DIR__ ) . '/base.php'; /** * @group fontsapi diff --git a/phpunit/fonts-api/bc-layer/wpWebfonts/registerWebfont-test.php b/phpunit/tests/fonts-api/bc-layer/wpWebfonts/registerWebfont.php similarity index 98% rename from phpunit/fonts-api/bc-layer/wpWebfonts/registerWebfont-test.php rename to phpunit/tests/fonts-api/bc-layer/wpWebfonts/registerWebfont.php index faaaf0e7ef6b79..ccc4249ad4fcc6 100644 --- a/phpunit/fonts-api/bc-layer/wpWebfonts/registerWebfont-test.php +++ b/phpunit/tests/fonts-api/bc-layer/wpWebfonts/registerWebfont.php @@ -6,7 +6,7 @@ * @subpackage Fonts API */ -require_once __DIR__ . '/../fonts-bc-layer-testcase.php'; +require_once dirname( __DIR__ ) . '/base.php'; /** * @group fontsapi diff --git a/phpunit/fonts-api/wp-fonts-tests-dataset.php b/phpunit/tests/fonts-api/wp-fonts-tests-dataset.php similarity index 100% rename from phpunit/fonts-api/wp-fonts-tests-dataset.php rename to phpunit/tests/fonts-api/wp-fonts-tests-dataset.php diff --git a/phpunit/fonts-api/wpDeregisterFontFamily-test.php b/phpunit/tests/fonts-api/wpDeregisterFontFamily.php similarity index 98% rename from phpunit/fonts-api/wpDeregisterFontFamily-test.php rename to phpunit/tests/fonts-api/wpDeregisterFontFamily.php index 6ef73879f20320..59db2e2abc8264 100644 --- a/phpunit/fonts-api/wpDeregisterFontFamily-test.php +++ b/phpunit/tests/fonts-api/wpDeregisterFontFamily.php @@ -6,7 +6,7 @@ * @subpackage Fonts API */ -require_once __DIR__ . '/wp-fonts-testcase.php'; +require_once __DIR__ . '/base.php'; /** * @group fontsapi diff --git a/phpunit/fonts-api/wpDeregisterFontVariation-test.php b/phpunit/tests/fonts-api/wpDeregisterFontVariation.php similarity index 99% rename from phpunit/fonts-api/wpDeregisterFontVariation-test.php rename to phpunit/tests/fonts-api/wpDeregisterFontVariation.php index 5cf20301c12702..78b4bf51f758af 100644 --- a/phpunit/fonts-api/wpDeregisterFontVariation-test.php +++ b/phpunit/tests/fonts-api/wpDeregisterFontVariation.php @@ -6,7 +6,7 @@ * @subpackage Fonts API */ -require_once __DIR__ . '/wp-fonts-testcase.php'; +require_once __DIR__ . '/base.php'; /** * @group fontsapi diff --git a/phpunit/fonts-api/wpEnqueueFontVariations-test.php b/phpunit/tests/fonts-api/wpEnqueueFontVariations.php similarity index 98% rename from phpunit/fonts-api/wpEnqueueFontVariations-test.php rename to phpunit/tests/fonts-api/wpEnqueueFontVariations.php index 46aa4fd1499d17..6e026d99f58897 100644 --- a/phpunit/fonts-api/wpEnqueueFontVariations-test.php +++ b/phpunit/tests/fonts-api/wpEnqueueFontVariations.php @@ -6,7 +6,7 @@ * @subpackage Fonts API */ -require_once __DIR__ . '/wp-fonts-testcase.php'; +require_once __DIR__ . '/base.php'; /** * @group fontsapi diff --git a/phpunit/fonts-api/wpEnqueueFonts-test.php b/phpunit/tests/fonts-api/wpEnqueueFonts.php similarity index 98% rename from phpunit/fonts-api/wpEnqueueFonts-test.php rename to phpunit/tests/fonts-api/wpEnqueueFonts.php index 43c1fd63a76104..c00fb0f2dfdae5 100644 --- a/phpunit/fonts-api/wpEnqueueFonts-test.php +++ b/phpunit/tests/fonts-api/wpEnqueueFonts.php @@ -6,7 +6,7 @@ * @subpackage Fonts API */ -require_once __DIR__ . '/wp-fonts-testcase.php'; +require_once __DIR__ . '/base.php'; /** * @group fontsapi diff --git a/phpunit/fonts-api/wpFonts-test.php b/phpunit/tests/fonts-api/wpFonts.php similarity index 94% rename from phpunit/fonts-api/wpFonts-test.php rename to phpunit/tests/fonts-api/wpFonts.php index 9a50dcb0fafc30..3b33e58edf2995 100644 --- a/phpunit/fonts-api/wpFonts-test.php +++ b/phpunit/tests/fonts-api/wpFonts.php @@ -6,7 +6,7 @@ * @subpackage Fonts API */ -require_once __DIR__ . '/wp-fonts-testcase.php'; +require_once __DIR__ . '/base.php'; /** * @group fontsapi diff --git a/phpunit/fonts-api/wpFonts/add-test.php b/phpunit/tests/fonts-api/wpFonts/add.php similarity index 95% rename from phpunit/fonts-api/wpFonts/add-test.php rename to phpunit/tests/fonts-api/wpFonts/add.php index 8d88b6834d0cf6..f9449b87c53b53 100644 --- a/phpunit/fonts-api/wpFonts/add-test.php +++ b/phpunit/tests/fonts-api/wpFonts/add.php @@ -6,7 +6,7 @@ * @subpackage Fonts API */ -require_once __DIR__ . '/../wp-fonts-testcase.php'; +require_once dirname( __DIR__ ) . '/base.php'; /** * @group fontsapi diff --git a/phpunit/fonts-api/wpFonts/addFontFamily-test.php b/phpunit/tests/fonts-api/wpFonts/addFontFamily.php similarity index 97% rename from phpunit/fonts-api/wpFonts/addFontFamily-test.php rename to phpunit/tests/fonts-api/wpFonts/addFontFamily.php index 85676b47c35e5e..f227c2c4025a40 100644 --- a/phpunit/fonts-api/wpFonts/addFontFamily-test.php +++ b/phpunit/tests/fonts-api/wpFonts/addFontFamily.php @@ -6,7 +6,7 @@ * @subpackage Fonts API */ -require_once __DIR__ . '/../wp-fonts-testcase.php'; +require_once dirname( __DIR__ ) . '/base.php'; /** * @group fontsapi diff --git a/phpunit/fonts-api/wpFonts/addVariation-test.php b/phpunit/tests/fonts-api/wpFonts/addVariation.php similarity index 99% rename from phpunit/fonts-api/wpFonts/addVariation-test.php rename to phpunit/tests/fonts-api/wpFonts/addVariation.php index 0f86c07ab0eaa8..5b6d93bcc99fe0 100644 --- a/phpunit/fonts-api/wpFonts/addVariation-test.php +++ b/phpunit/tests/fonts-api/wpFonts/addVariation.php @@ -6,7 +6,7 @@ * @subpackage Fonts API */ -require_once __DIR__ . '/../wp-fonts-testcase.php'; +require_once dirname( __DIR__ ) . '/base.php'; /** * @group fontsapi diff --git a/phpunit/fonts-api/wpFonts/dequeue-test.php b/phpunit/tests/fonts-api/wpFonts/dequeue.php similarity index 97% rename from phpunit/fonts-api/wpFonts/dequeue-test.php rename to phpunit/tests/fonts-api/wpFonts/dequeue.php index e6ea2223657baa..6cd11dc55b9376 100644 --- a/phpunit/fonts-api/wpFonts/dequeue-test.php +++ b/phpunit/tests/fonts-api/wpFonts/dequeue.php @@ -6,7 +6,7 @@ * @subpackage Fonts API */ -require_once __DIR__ . '/../wp-fonts-testcase.php'; +require_once dirname( __DIR__ ) . '/base.php'; /** * @group fontsapi diff --git a/phpunit/fonts-api/wpFonts/doItem-test.php b/phpunit/tests/fonts-api/wpFonts/doItem.php similarity index 99% rename from phpunit/fonts-api/wpFonts/doItem-test.php rename to phpunit/tests/fonts-api/wpFonts/doItem.php index 602c8d74e1bae1..af46f376b3bc5c 100644 --- a/phpunit/fonts-api/wpFonts/doItem-test.php +++ b/phpunit/tests/fonts-api/wpFonts/doItem.php @@ -6,7 +6,7 @@ * @subpackage Fonts API */ -require_once __DIR__ . '/../wp-fonts-testcase.php'; +require_once dirname( __DIR__ ) . '/base.php'; /** * @group fontsapi diff --git a/phpunit/fonts-api/wpFonts/doItems-test.php b/phpunit/tests/fonts-api/wpFonts/doItems.php similarity index 98% rename from phpunit/fonts-api/wpFonts/doItems-test.php rename to phpunit/tests/fonts-api/wpFonts/doItems.php index 20314f957014d9..23307366101cb0 100644 --- a/phpunit/fonts-api/wpFonts/doItems-test.php +++ b/phpunit/tests/fonts-api/wpFonts/doItems.php @@ -6,8 +6,8 @@ * @subpackage Fonts API */ -require_once __DIR__ . '/../wp-fonts-testcase.php'; -require_once __DIR__ . '/../../fixtures/mock-provider.php'; +require_once dirname( __DIR__ ) . '/base.php'; +require_once GUTENBERG_DIR_TESTFIXTURES . '/mock-provider.php'; /** * @group fontsapi diff --git a/phpunit/fonts-api/wpFonts/enqueue-test.php b/phpunit/tests/fonts-api/wpFonts/enqueue.php similarity index 97% rename from phpunit/fonts-api/wpFonts/enqueue-test.php rename to phpunit/tests/fonts-api/wpFonts/enqueue.php index 34380febfef5df..09c14676c7ae09 100644 --- a/phpunit/fonts-api/wpFonts/enqueue-test.php +++ b/phpunit/tests/fonts-api/wpFonts/enqueue.php @@ -6,7 +6,7 @@ * @subpackage Fonts API */ -require_once __DIR__ . '/../wp-fonts-testcase.php'; +require_once dirname( __DIR__ ) . '/base.php'; /** * @group fontsapi diff --git a/phpunit/fonts-api/wpFonts/getEnqueued-test.php b/phpunit/tests/fonts-api/wpFonts/getEnqueued.php similarity index 96% rename from phpunit/fonts-api/wpFonts/getEnqueued-test.php rename to phpunit/tests/fonts-api/wpFonts/getEnqueued.php index 68a509f3c35ccb..bacb8a31aa6500 100644 --- a/phpunit/fonts-api/wpFonts/getEnqueued-test.php +++ b/phpunit/tests/fonts-api/wpFonts/getEnqueued.php @@ -6,7 +6,7 @@ * @subpackage Fonts API */ -require_once __DIR__ . '/../wp-fonts-testcase.php'; +require_once dirname( __DIR__ ) . '/base.php'; /** * @group fontsapi diff --git a/phpunit/fonts-api/wpFonts/getProviders-test.php b/phpunit/tests/fonts-api/wpFonts/getProviders.php similarity index 93% rename from phpunit/fonts-api/wpFonts/getProviders-test.php rename to phpunit/tests/fonts-api/wpFonts/getProviders.php index ed73921a31aea4..410adaace286aa 100644 --- a/phpunit/fonts-api/wpFonts/getProviders-test.php +++ b/phpunit/tests/fonts-api/wpFonts/getProviders.php @@ -6,8 +6,8 @@ * @subpackage Fonts API */ -require_once __DIR__ . '/../wp-fonts-testcase.php'; -require_once __DIR__ . '/../../fixtures/mock-provider.php'; +require_once dirname( __DIR__ ) . '/base.php'; +require_once GUTENBERG_DIR_TESTFIXTURES . '/mock-provider.php'; /** * @group fontsapi diff --git a/phpunit/fonts-api/wpFonts/getRegistered-test.php b/phpunit/tests/fonts-api/wpFonts/getRegistered.php similarity index 97% rename from phpunit/fonts-api/wpFonts/getRegistered-test.php rename to phpunit/tests/fonts-api/wpFonts/getRegistered.php index 365a97733f3cfa..7dc116f5875390 100644 --- a/phpunit/fonts-api/wpFonts/getRegistered-test.php +++ b/phpunit/tests/fonts-api/wpFonts/getRegistered.php @@ -7,7 +7,7 @@ * @subpackage Fonts API */ -require_once __DIR__ . '/../wp-fonts-testcase.php'; +require_once dirname( __DIR__ ) . '/base.php'; /** * @group fontsapi diff --git a/phpunit/fonts-api/wpFonts/query-test.php b/phpunit/tests/fonts-api/wpFonts/query.php similarity index 98% rename from phpunit/fonts-api/wpFonts/query-test.php rename to phpunit/tests/fonts-api/wpFonts/query.php index c64d88cf9fa867..0e56b515e7ebf4 100644 --- a/phpunit/fonts-api/wpFonts/query-test.php +++ b/phpunit/tests/fonts-api/wpFonts/query.php @@ -6,7 +6,7 @@ * @subpackage Fonts API */ -require_once __DIR__ . '/../wp-fonts-testcase.php'; +require_once dirname( __DIR__ ) . '/base.php'; /** * @group fontsapi diff --git a/phpunit/fonts-api/wpFonts/registerProvider-test.php b/phpunit/tests/fonts-api/wpFonts/registerProvider.php similarity index 96% rename from phpunit/fonts-api/wpFonts/registerProvider-test.php rename to phpunit/tests/fonts-api/wpFonts/registerProvider.php index 03dc6fd6049b1a..09d3d7f3891720 100644 --- a/phpunit/fonts-api/wpFonts/registerProvider-test.php +++ b/phpunit/tests/fonts-api/wpFonts/registerProvider.php @@ -6,8 +6,8 @@ * @subpackage Fonts API */ -require_once __DIR__ . '/../wp-fonts-testcase.php'; -require_once __DIR__ . '/../../fixtures/mock-provider.php'; +require_once dirname( __DIR__ ) . '/base.php'; +require_once GUTENBERG_DIR_TESTFIXTURES . '/mock-provider.php'; /** * @group fontsapi diff --git a/phpunit/fonts-api/wpFonts/remove-test.php b/phpunit/tests/fonts-api/wpFonts/remove.php similarity index 97% rename from phpunit/fonts-api/wpFonts/remove-test.php rename to phpunit/tests/fonts-api/wpFonts/remove.php index 6da419a988e853..208bd58c3d2c30 100644 --- a/phpunit/fonts-api/wpFonts/remove-test.php +++ b/phpunit/tests/fonts-api/wpFonts/remove.php @@ -6,7 +6,7 @@ * @subpackage Fonts API */ -require_once __DIR__ . '/../wp-fonts-testcase.php'; +require_once dirname( __DIR__ ) . '/base.php'; /** * @group fontsapi diff --git a/phpunit/fonts-api/wpFonts/removeFontFamily-test.php b/phpunit/tests/fonts-api/wpFonts/removeFontFamily.php similarity index 98% rename from phpunit/fonts-api/wpFonts/removeFontFamily-test.php rename to phpunit/tests/fonts-api/wpFonts/removeFontFamily.php index b04882e04acdde..6e762307d05207 100644 --- a/phpunit/fonts-api/wpFonts/removeFontFamily-test.php +++ b/phpunit/tests/fonts-api/wpFonts/removeFontFamily.php @@ -6,7 +6,7 @@ * @subpackage Fonts API */ -require_once __DIR__ . '/../wp-fonts-testcase.php'; +require_once dirname( __DIR__ ) . '/base.php'; /** * @group fontsapi diff --git a/phpunit/fonts-api/wpFonts/removeVariation-test.php b/phpunit/tests/fonts-api/wpFonts/removeVariation.php similarity index 99% rename from phpunit/fonts-api/wpFonts/removeVariation-test.php rename to phpunit/tests/fonts-api/wpFonts/removeVariation.php index fb8f78e4122fb2..508c8ce264d8fb 100644 --- a/phpunit/fonts-api/wpFonts/removeVariation-test.php +++ b/phpunit/tests/fonts-api/wpFonts/removeVariation.php @@ -6,7 +6,7 @@ * @subpackage Fonts API */ -require_once __DIR__ . '/../wp-fonts-testcase.php'; +require_once dirname( __DIR__ ) . '/base.php'; /** * @group fontsapi diff --git a/phpunit/fonts-api/wpFontsProviderLocal-test.php b/phpunit/tests/fonts-api/wpFontsProviderLocal.php similarity index 97% rename from phpunit/fonts-api/wpFontsProviderLocal-test.php rename to phpunit/tests/fonts-api/wpFontsProviderLocal.php index 1bd28e4a6aba7b..f9319390c3b6b5 100644 --- a/phpunit/fonts-api/wpFontsProviderLocal-test.php +++ b/phpunit/tests/fonts-api/wpFontsProviderLocal.php @@ -6,7 +6,7 @@ * @subpackage Fonts API */ -require_once __DIR__ . '/wp-fonts-testcase.php'; +require_once __DIR__ . '/base.php'; /** * @group fontsapi @@ -155,7 +155,7 @@ public function data_get_css_print_styles() { * `wp-content/themes/` directory to ensure consistency when running tests. */ private function set_up_theme() { - $this->theme_root = realpath( DIR_TESTDATA . '/themedir1' ); + $this->theme_root = realpath( GUTENBERG_DIR_TESTDATA . '/themedir1' ); $this->orig_theme_dir = $GLOBALS['wp_theme_directories']; $GLOBALS['wp_theme_directories'] = array( $this->theme_root ); diff --git a/phpunit/fonts-api/wpFontsResolver/addMissingFontsToThemeJson-test.php b/phpunit/tests/fonts-api/wpFontsResolver/addMissingFontsToThemeJson.php similarity index 99% rename from phpunit/fonts-api/wpFontsResolver/addMissingFontsToThemeJson-test.php rename to phpunit/tests/fonts-api/wpFontsResolver/addMissingFontsToThemeJson.php index 31bb4b1d409cc4..d6e45561e5e335 100644 --- a/phpunit/fonts-api/wpFontsResolver/addMissingFontsToThemeJson-test.php +++ b/phpunit/tests/fonts-api/wpFontsResolver/addMissingFontsToThemeJson.php @@ -1,6 +1,6 @@