[wp-trac] [WordPress Trac] #55192: unit tests for _wp_check_existing_file_names

WordPress Trac noreply at wordpress.org
Fri Oct 7 22:25:29 UTC 2022


#55192: unit tests for _wp_check_existing_file_names
-------------------------------------------------+-------------------------
 Reporter:  pbearne                              |       Owner:
                                                 |  hellofromTonya
     Type:  task (blessed)                       |      Status:  assigned
 Priority:  normal                               |   Milestone:  6.1
Component:  Build/Test Tools                     |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests dev-        |     Focuses:
  feedback                                       |
-------------------------------------------------+-------------------------
Changes (by costdev):

 * keywords:  has-patch has-unit-tests => has-patch has-unit-tests dev-
     feedback


Comment:

 In [https://github.com/WordPress/wordpress-develop/pull/2332/ PR 2332],
 there is a source change in the `_wp_check_existing_file_names()` that
 adds `|| empty( $ext )` to a condition.

 The existing datasets in the PR will pass whether or not this condition is
 added. However, a dataset such as this shows that this is a BC break:
 {{{#!php
 <?php
 'found file with no extension' => array(
         'filename' => 'filename',
         'files'    => array( 'filename-scaled' ),
         'expected' => false,
 ),
 }}}

 Do we want to reject filenames without extensions even if there is a
 matching existing file (thereby breaking BC), or do we want to retain the
 existing behaviour? In any case, I think this type of change should have
 its own ticket, while this is strictly a test ticket.

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


More information about the wp-trac mailing list