[wp-trac] [WordPress Trac] #43663: Unit Test test_theme_file_uri_returns_valid_uri fails on directories with spaces

WordPress Trac noreply at wordpress.org
Fri Mar 30 14:29:14 UTC 2018


#43663: Unit Test test_theme_file_uri_returns_valid_uri fails on directories with
spaces
-------------------------------------------------+-------------------------
 Reporter:  mattkeys                             |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
Component:  Build/Test Tools                     |  Review
 Severity:  normal                               |     Version:  4.9.5
 Keywords:  dev-feedback has-patch needs-        |  Resolution:
  testing                                        |     Focuses:
-------------------------------------------------+-------------------------

Comment (by birgire):

 @mattkeys thanks for the report and the patch.


 It looks to me that the problem with the
 {{{test_theme_file_uri_returns_valid_uri()}}} is that the current active
 theme is the one from:
 {{{/full/path/to/tests/phpunit/includes/../data/themedir1/default}}}. The
 themes from the test method's data provider haven't been activated. So we
 are dealing with a special case when {{{get_theme_root_uri()}}} can't
 determine the theme's URL and it returns the full directory path instead,
 namely this part:

 https://core.trac.wordpress.org/browser/tags/4.9/src/wp-
 includes/theme.php#L595


 If we activate the themes from the data provider with:

 {{{switch_theme( $expected_theme );}}}

 before the code in {{{test_theme_file_uri_returns_valid_uri()}}} then we
 are avoiding the above edge case and the spaces in the path are not
 involved.

 That's the case with [attachment:43636.3.diff].

--
Ticket URL: <https://core.trac.wordpress.org/ticket/43663#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list