Opened 11 years ago
Closed 11 years ago
#32635 closed defect (bug) (fixed)
Theme unit tests fail if a child theme is present
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 4.4 | Priority: | normal |
| Severity: | normal | Version: | 3.5 |
| Component: | Themes | Keywords: | has-patch commit |
| Focuses: | Cc: |
Description
If you place a child theme into your theme directory, the Tests_Theme::test_switch_theme() test will fail.
1) Tests_Theme::test_switch_theme Failed asserting that two strings are equal. --- Expected +++ Actual @@ @@ -'My Child Theme' +'Twenty Fifteen' ~/tests/phpunit/tests/theme.php:224
Needs investigating.
Attachments (2)
Change History (10)
#2
@
11 years ago
- Keywords needs-testing removed
- Version set to 3.5
Unit tests are failing because if template and stylesheet are passed to switch_theme(), $new_theme gets set before the second argument is appropriately handled, causing 'current_theme' to always be updated to the parent theme's name.
Introduced in [21131].
#3
@
11 years ago
- Component changed from Build/Test Tools to Themes
- Keywords has-patch added
- Milestone changed from Awaiting Review to Future Release
32635.diff sets $stylesheet to the second argument when available, always sets $template to the template property of the theme's WP_Theme.
This ticket was mentioned in Slack in #core by obenland. View the logs.
11 years ago
Note: See
TracTickets for help on using
tickets.
I noticed that too, been wanting to investigate that.