Editor: Add functionality required for theme export in the site editor

This bring across changes to theme export functionality, and related code, and tests. Relates issue in Gutenberg: https://github.com/WordPress/gutenberg/issues/39889.

Props scruffian, timothyblynjacobs, oandregal, ajlende, zieleadam.
See #55505.



git-svn-id: https://develop.svn.wordpress.org/trunk@53129 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Greg Ziółkowski
2022-04-11 10:36:02 +00:00
parent 43aba3b36f
commit a5a6d0d0e0
8 changed files with 712 additions and 80 deletions

View File

@@ -357,10 +357,10 @@ class Tests_Block_Template_Utils extends WP_UnitTestCase {
// Open ZIP file and make sure the directories exist.
$zip = new ZipArchive();
$zip->open( $filename );
$has_theme_dir = $zip->locateName( 'theme/' ) !== false;
$has_block_templates_dir = $zip->locateName( 'theme/templates/' ) !== false;
$has_block_template_parts_dir = $zip->locateName( 'theme/parts/' ) !== false;
$this->assertTrue( $has_theme_dir, 'theme directory exists' );
$has_theme_json = $zip->locateName( 'theme.json' ) !== false;
$has_block_templates_dir = $zip->locateName( 'templates/' ) !== false;
$has_block_template_parts_dir = $zip->locateName( 'parts/' ) !== false;
$this->assertTrue( $has_theme_json, 'theme.json exists' );
$this->assertTrue( $has_block_templates_dir, 'theme/templates directory exists' );
$this->assertTrue( $has_block_template_parts_dir, 'theme/parts directory exists' );