Opened 8 years ago
Closed 8 years ago
#38540 closed defect (bug) (fixed)
Add PHP unit tests for theme starter content
Reported by: | westonruter | Owned by: | westonruter |
---|---|---|---|
Milestone: | 4.7 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Customize | Keywords: | needs-patch |
Focuses: | Cc: |
Attachments (4)
Change History (17)
This ticket was mentioned in Slack in #core by helen. View the logs.
8 years ago
This ticket was mentioned in Slack in #core by welcher. View the logs.
8 years ago
#5
@
8 years ago
@welcher yeah, you're right. If $config
is anything other than an array
then it should be overridden to be an empty array.
#6
@
8 years ago
@westonruter the patch I added addresses the issue - should that get committed before the tests are completed? I can also add a separate patch for just the tests if that makes sense as well.
This ticket was mentioned in Slack in #core by jeffpaul. View the logs.
8 years ago
#9
follow-up:
↓ 10
@
8 years ago
@welcher are you going to flesh out the unit tests? Note that some key fixes were done as part of #38541.
#10
in reply to:
↑ 9
@
8 years ago
Replying to westonruter:
@welcher are you going to flesh out the unit tests? Note that some key fixes were done as part of #38541.
@westonruter I am working on updating my tests for reflect the key changes.
#11
@
8 years ago
@westonruter I've added some tests for the default content that is generated. The patch also contains the fix if for not passing the second parameter to add_theme_support
.
I'm hoping to keep working on the tests for the other items in this ticket but time is in short supply lately so if there is anyone that wants to jump in and help that would be awesome.
I'm writing up some tests for
\get_theme_starter_content
and noticed that it is possible to do thisadd_theme_support( 'starter-content' )
which causes a PHP invalid foreach error.I am not sure how common that would be but there is no check in
get_theme_starter_content
to ensure that$theme_support
is an array. I've attached a patch with tests to address this and introduce a new test file for the method.