Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Relocates Font Face and Fonts Library PHP files into Core's fonts directory #53747

Merged
merged 2 commits into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions lib/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,30 +160,30 @@ function gutenberg_is_experiment_enabled( $name ) {
*/
if ( defined( 'FONTS_LIBRARY_ENABLE' ) && FONTS_LIBRARY_ENABLE ) {
// Loads the Fonts Library.
require __DIR__ . '/experimental/fonts-library/class-wp-fonts-library.php';
require __DIR__ . '/experimental/fonts-library/class-wp-font-family-utils.php';
require __DIR__ . '/experimental/fonts-library/class-wp-font-family.php';
require __DIR__ . '/experimental/fonts-library/class-wp-rest-fonts-library-controller.php';
require __DIR__ . '/experimental/fonts-library/fonts-library.php';
require __DIR__ . '/experimental/fonts/fonts-library/class-wp-fonts-library.php';
require __DIR__ . '/experimental/fonts/fonts-library/class-wp-font-family-utils.php';
require __DIR__ . '/experimental/fonts/fonts-library/class-wp-font-family.php';
require __DIR__ . '/experimental/fonts/fonts-library/class-wp-rest-fonts-library-controller.php';
require __DIR__ . '/experimental/fonts/fonts-library/fonts-library.php';

if ( ! class_exists( 'WP_Font_Face' ) ) {
require __DIR__ . '/experimental/fonts/class-wp-font-face.php';
require __DIR__ . '/experimental/fonts/class-wp-font-face-resolver.php';
require __DIR__ . '/experimental/fonts/fonts.php';
require __DIR__ . '/experimental/fonts/font-face/class-wp-font-face.php';
require __DIR__ . '/experimental/fonts/font-face/class-wp-font-face-resolver.php';
require __DIR__ . '/experimental/fonts/font-face/fonts.php';

// Load the BC Layer. Do no backport to WP Core.
require __DIR__ . '/experimental/fonts/bc-layer/class-wp-fonts-provider.php';
require __DIR__ . '/experimental/fonts/bc-layer/class-wp-fonts-utils.php';
require __DIR__ . '/experimental/fonts/bc-layer/class-wp-fonts.php';
require __DIR__ . '/experimental/fonts/bc-layer/class-wp-fonts-provider-local.php';
require __DIR__ . '/experimental/fonts/bc-layer/class-wp-fonts-resolver.php';
require __DIR__ . '/experimental/fonts/bc-layer/class-gutenberg-fonts-api-bc-layer.php';
require __DIR__ . '/experimental/fonts/bc-layer/webfonts-deprecations.php';
require __DIR__ . '/experimental/fonts/bc-layer/class-wp-webfonts-utils.php';
require __DIR__ . '/experimental/fonts/bc-layer/class-wp-webfonts-provider.php';
require __DIR__ . '/experimental/fonts/bc-layer/class-wp-webfonts-provider-local.php';
require __DIR__ . '/experimental/fonts/bc-layer/class-wp-webfonts.php';
require __DIR__ . '/experimental/fonts/bc-layer/class-wp-web-fonts.php';
require __DIR__ . '/experimental/fonts/font-face/bc-layer/class-wp-fonts-provider.php';
require __DIR__ . '/experimental/fonts/font-face/bc-layer/class-wp-fonts-utils.php';
require __DIR__ . '/experimental/fonts/font-face/bc-layer/class-wp-fonts.php';
require __DIR__ . '/experimental/fonts/font-face/bc-layer/class-wp-fonts-provider-local.php';
require __DIR__ . '/experimental/fonts/font-face/bc-layer/class-wp-fonts-resolver.php';
require __DIR__ . '/experimental/fonts/font-face/bc-layer/class-gutenberg-fonts-api-bc-layer.php';
require __DIR__ . '/experimental/fonts/font-face/bc-layer/webfonts-deprecations.php';
require __DIR__ . '/experimental/fonts/font-face/bc-layer/class-wp-webfonts-utils.php';
require __DIR__ . '/experimental/fonts/font-face/bc-layer/class-wp-webfonts-provider.php';
require __DIR__ . '/experimental/fonts/font-face/bc-layer/class-wp-webfonts-provider-local.php';
require __DIR__ . '/experimental/fonts/font-face/bc-layer/class-wp-webfonts.php';
require __DIR__ . '/experimental/fonts/font-face/bc-layer/class-wp-web-fonts.php';
}
} elseif ( ! class_exists( 'WP_Fonts' ) ) {
// Fonts API files.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,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( __DIR__ . '/../../data/themedir1' );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@

require_once __DIR__ . '/../wp-font-face-tests-dataset.php';

/*
* This code is only needed if the Font API is enabled.
* @todo remove this code when Font Library is merged into Gutenberg.
*/
if ( ! class_exists( 'WP_Font_Face' ) ) {
require_once __DIR__ . '/../../../lib/experimental/fonts/class-wp-font-face.php';
require_once __DIR__ . '/../../../lib/experimental/fonts/class-wp-font-face-resolver.php';
require_once __DIR__ . '/../../../lib/experimental/fonts/fonts.php';
}

/**
* Test WP_Font_Face::generate_and_print().
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@

require_once __DIR__ . '/../wp-font-face-testcase.php';

/*
* This code is only needed if the Font API is enabled.
* @todo remove this code when Font Library is merged into Gutenberg.
*/
if ( ! class_exists( 'WP_Font_Face' ) ) {
require_once __DIR__ . '/../../../lib/experimental/fonts/class-wp-font-face.php';
require_once __DIR__ . '/../../../lib/experimental/fonts/class-wp-font-face-resolver.php';
require_once __DIR__ . '/../../../lib/experimental/fonts/fonts.php';
}

/**
* Tests WP_Font_Face_Resolver::get_fonts_from_theme_json().
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@

require_once __DIR__ . '/wp-font-face-testcase.php';

/*
* This code is only needed if the Font API is enabled.
* @todo remove this code when Font Library is merged into Gutenberg.
*/
if ( ! class_exists( 'WP_Font_Face' ) ) {
require_once __DIR__ . '/../../../lib/experimental/fonts/class-wp-font-face.php';
require_once __DIR__ . '/../../../lib/experimental/fonts/class-wp-font-face-resolver.php';
require_once __DIR__ . '/../../../lib/experimental/fonts/fonts.php';
}

/**
* Test wp_print_font_faces().
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* @covers WP_Font_Family::__construct
*/
class Tests_FontsLibrary_WpFontFamily_Construct extends WP_UnitTestCase {
class Tests_Fonts_WpFontFamily_Construct extends WP_UnitTestCase {

public function test_should_initialize_data() {
$property = new ReflectionProperty( WP_Font_Family::class, 'data' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* @covers WP_Font_Family::get_data
*/
class Tests_FontsLibrary_WpFontsLibrary_GetData extends WP_UnitTestCase {
class Tests_Fonts_WpFontsLibrary_GetData extends WP_UnitTestCase {

/**
* @dataProvider data_should_get_data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* @covers WP_Font_Family::get_data_as_json
*/
class Tests_FontsLibrary_WpFontFamily_GetDataAsJson extends WP_UnitTestCase {
class Tests_Fonts_WpFontFamily_GetDataAsJson extends WP_UnitTestCase {

/**
* @dataProvider data_should_get_data_as_json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @covers WP_Font_Family::get_font_post
*/
class Tests_FontsLibrary_WpFontFamily_GetFontPost extends WP_Font_Family_UnitTestCase {
class Tests_Fonts_WpFontFamily_GetFontPost extends WP_Font_Family_UnitTestCase {

public function test_should_return_post() {
// Set up the post.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* @covers WP_Font_Family::has_font_faces
*/
class Tests_FontsLibrary_WpFontFamily_HasFontFaces extends WP_UnitTestCase {
class Tests_Fonts_WpFontFamily_HasFontFaces extends WP_UnitTestCase {

public function test_should_return_true_when_check_succeeds() {
$font_data = array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @covers WP_Font_Family::install
*/
class Tests_FontsLibrary_WpFontFamily_Install extends WP_Font_Family_UnitTestCase {
class Tests_Fonts_WpFontFamily_Install extends WP_Font_Family_UnitTestCase {

/**
* @dataProvider data_should_not_download_when_no_fontface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @covers WP_Font_Family::uninstall
*/
class Tests_FontsLibrary_WpFontFamily_Uninstall extends WP_Font_Family_UnitTestCase {
class Tests_Fonts_WpFontFamily_Uninstall extends WP_Font_Family_UnitTestCase {

public function test_should_return_error_when_font_not_found() {
// Set up.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* @covers WP_Font_Family_Utils::get_filename_from_font_face
*/
class Tests_FontsLibrary_WpFontsFamilyUtils_GetFilenameFromFontFace extends WP_UnitTestCase {
class Tests_Fonts_WpFontsFamilyUtils_GetFilenameFromFontFace extends WP_UnitTestCase {

/**
* @dataProvider data_should_get_filename
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* @covers WP_Font_Family_Utils::has_font_mime_type
*/
class Tests_FontsLibrary_WpFontsFamilyUtils_HasFontMimeType extends WP_UnitTestCase {
class Tests_Fonts_WpFontsFamilyUtils_HasFontMimeType extends WP_UnitTestCase {

/**
* @dataProvider data_should_succeed_when_has_mime_type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* @covers WP_Font_Family_Utils::merge_fonts_data
*/
class Tests_FontsLibrary_WpFontsFamilyUtils_MergeFontsData extends WP_UnitTestCase {
class Tests_Fonts_WpFontsFamilyUtils_MergeFontsData extends WP_UnitTestCase {

/**
* @dataProvider data_should_fail_merge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* @covers WP_Fonts_Library::get_fonts_dir
*/
class Tests_FontsLibrary_WpFontsLibrary_GetFontsDir extends WP_UnitTestCase {
class Tests_Fonts_WpFontsLibrary_GetFontsDir extends WP_UnitTestCase {

public function test_get_fonts_dir() {
$this->assertStringEndsWith( '/wp-content/uploads/fonts', WP_Fonts_Library::get_fonts_dir() );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* @covers WP_Fonts_Library::set_upload_dir
*/
class Tests_FontsLibrary_WpFontsLibrary_SetUploadDir extends WP_UnitTestCase {
class Tests_Fonts_WpFontsLibrary_SetUploadDir extends WP_UnitTestCase {

public function test_should_set_fonts_upload_dir() {
$defaults = array(
Expand Down