Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#42298 closed enhancement (invalid)

Use wp_get_theme() and wp_get_themes() instead of deprecated get_theme(), get_themes() and get_current_theme() in Tests_Theme class.

Reported by: birgire's profile birgire Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch
Focuses: Cc:

Description

The Tests_Theme test class uses deprecated functions get_theme(), get_themes() and get_current_theme() with the annotations:

* @expectedDeprecated get_theme
* @expectedDeprecated get_themes
* @expectedDeprecated get_current_theme

I think we could update those with wp_get_theme() and wp_get_themes() instead and get rid of these extra annotations.

Attachments (1)

42298.diff (3.2 KB) - added by birgire 7 years ago.

Download all attachments as: .zip

Change History (6)

@birgire
7 years ago

#2 @birgire
7 years ago

  • Keywords has-patch added

42298.diff updates four test methods and removes the corresponding @expectedDeprecated annotations.

Excluded from this update is the test_extra_theme_headers() method that uses the deprecated get_theme_data() and corresponds to ticket #20897

Last edited 7 years ago by birgire (previous) (diff)

#3 @Frank Klein
7 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Thanks for the patch.

WordPress maintains existing test coverage for deprecated functions. These tests are meant to prevent any regressions that could break code still using deprecated APIs.

Removing the deprecated function usage in the tests would therefore reduce test coverage. Which is something that we would want to avoid.

#4 @birgire
7 years ago

Thanks @Frank Klein

Reviewing this again I see that I've misread the purpose of those tests.

I read them as a general way to get the theme(s), instead of specific tests of the get_theme(s) functions. Therefore I thought it made sense at the time to replace the deprecated functions.

So I absolutely agree with you here ;-)

#5 @netweb
7 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.