mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Tests: Use a minimal theme for tests.
New default themes require workarounds being added to several unit tests, as they often alter default WordPress behaviour. To avoid ongoing maintenance issues, this change switches to a minimal theme when running tests. This change also removes the old workarounds for default themes. Fixes #31550. git-svn-id: https://develop.svn.wordpress.org/trunk@38858 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
4
tests/phpunit/data/themedir1/default/comments.php
Normal file
4
tests/phpunit/data/themedir1/default/comments.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
// Minimal comment template
|
||||
wp_list_comments();
|
||||
@@ -1,7 +1,18 @@
|
||||
<?php
|
||||
|
||||
// dummy theme
|
||||
// Minimum functions.php to pass unit tests
|
||||
|
||||
echo dirname(__FILE__).'/'.basename(__FILE__);
|
||||
function default_widgets_init() {
|
||||
register_sidebar( array( 'id' => 'sidebar-1' ) );
|
||||
}
|
||||
add_action( 'widgets_init', 'default_widgets_init' );
|
||||
|
||||
?>
|
||||
function default_after_setup_theme() {
|
||||
add_theme_support( 'post-thumbnails' );
|
||||
|
||||
// Don't call it after wp_loaded has happened, for tests that manually re-run load actions.
|
||||
if( ! did_action( 'wp_loaded' ) ) {
|
||||
add_theme_support( 'title-tag' );
|
||||
}
|
||||
}
|
||||
add_action( 'after_setup_theme', 'default_after_setup_theme' );
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
<?php
|
||||
|
||||
// dummy theme
|
||||
|
||||
echo dirname(__FILE__).'/'.basename(__FILE__);
|
||||
|
||||
?>
|
||||
// Empty theme
|
||||
|
||||
Reference in New Issue
Block a user