Skip to content

Commit

Permalink
Tests: A valid WordPress theme must have an index.php file, other pla…
Browse files Browse the repository at this point in the history
…yground tests don't abide by this.
  • Loading branch information
dd32 committed Jun 26, 2024
1 parent 5f6319d commit 3b9a9b4
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ describe('Blueprint step importThemeStarterContent', () => {

it('Should import theme starter content', async () => {
const docroot = php.documentRoot;
// Create a test theme with starter content, Must have at a minimum style.css + index.php
php.mkdir(`${docroot}/wp-content/themes/test-theme`);
php.writeFile(
`${docroot}/wp-content/themes/test-theme/style.css`,
Expand All @@ -36,6 +37,7 @@ describe('Blueprint step importThemeStarterContent', () => {
*/
`
);
php.writeFile(`${docroot}/wp-content/themes/test-theme/index.php`, '');
php.writeFile(
`${docroot}/wp-content/themes/test-theme/functions.php`,
`<?php
Expand Down Expand Up @@ -69,7 +71,7 @@ add_action( 'after_setup_theme', 'testtheme_theme_support' );

const response = await php.run({
code: `<?php
require '/wordpress/wp-load.php';
require '${docroot}/wp-load.php';
echo json_encode([
'show_on_front' => get_option('show_on_front'),
'front_page' => get_post( get_option('page_on_front') ),
Expand Down

0 comments on commit 3b9a9b4

Please sign in to comment.