Changeset 41601
- Timestamp:
- 09/26/2017 08:53:20 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme.php
r41200 r41601 249 249 $this->headers['Name'] .= '/' . $this->stylesheet; 250 250 } 251 } 252 253 if ( ! $this->template && $this->stylesheet === $this->headers['Template'] ) { 254 /* translators: %s: Template */ 255 $this->errors = new WP_Error( 'theme_child_invalid', sprintf( __( 'The theme defines itself as its parent theme. Please check the "%s" header.' ), 'Template' ) ); 256 $this->cache_add( 'theme', array( 'headers' => $this->headers, 'errors' => $this->errors, 'stylesheet' => $this->stylesheet ) ); 257 258 return; 251 259 } 252 260 -
trunk/tests/phpunit/tests/theme/WPTheme.php
r40564 r41601 141 141 } 142 142 143 /** 144 * @ticket 40820 145 */ 146 function test_child_theme_with_itself_as_parent_should_appear_as_broken() { 147 $theme = new WP_Theme( 'child-parent-itself', $this->theme_root ); 148 $errors = $theme->errors(); 149 $this->assertWPError( $errors ); 150 $this->assertEquals( 'theme_child_invalid', $errors->get_error_code() ); 151 } 152 143 153 144 154 /** -
trunk/tests/phpunit/tests/theme/themeDir.php
r39173 r41601 176 176 */ 177 177 function test_broken_themes() { 178 $themes = get_themes(); 179 $expected = array('broken-theme' => array('Name' => 'broken-theme', 'Title' => 'broken-theme', 'Description' => __('Stylesheet is missing.'))); 178 $themes = get_themes(); 179 180 $expected = array( 181 'broken-theme' => array( 182 'Name' => 'broken-theme', 183 'Title' => 'broken-theme', 184 'Description' => __( 'Stylesheet is missing.' ), 185 ), 186 'Child and Parent Theme' => array( 187 'Name' => 'Child and Parent Theme', 188 'Title' => 'Child and Parent Theme', 189 'Description' => sprintf( __( 'The theme defines itself as its parent theme. Please check the "%s" header.' ), 'Template' ), 190 ), 191 ); 180 192 181 193 $this->assertEquals($expected, get_broken_themes() );
Note: See TracChangeset
for help on using the changeset viewer.