Make WordPress Core

Opened 19 months ago

Last modified 10 months ago

#55192 assigned defect (bug)

unit tests for _wp_check_existing_file_names

Reported by: pbearne's profile pbearne Owned by: hellofromtonya's profile hellofromTonya
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch has-unit-tests dev-feedback
Focuses: Cc:


Change History (13)

#1 @pbearne
19 months ago

  • Component changed from General to Build/Test Tools

This ticket was mentioned in PR #2332 on WordPress/wordpress-develop by pbearne.

19 months ago

  • Keywords has-patch has-unit-tests added

test for _wp_check_existing_file_names

Trac ticket: [](

#4 @pbearne
19 months ago

I found that a missing ext returns false so I have added a return early

#5 @costdev
19 months ago

  • Milestone changed from Awaiting Review to 6.0
  • Type changed from defect (bug) to enhancement

#6 @costdev
18 months ago

  • Type changed from enhancement to task (blessed)

#7 @hellofromTonya
17 months ago

  • Milestone changed from 6.0 to 6.1
  • Owner set to hellofromTonya
  • Status changed from new to assigned

With 6.0 RC1 tomorrow, moving this ticket to 6.1. It can committed when reviewed and ready.

This ticket was mentioned in Slack in #core by audrasjb. View the logs.

12 months ago

#9 @costdev
12 months ago

  • Keywords dev-feedback added

In 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:

'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.

This ticket was mentioned in Slack in #core by costdev. View the logs.

12 months ago

#11 @hellofromTonya
12 months ago

  • Milestone changed from 6.1 to Future Release

This ticket is for tests, not source. However, tomorrow is 6.1 RC1. Since there's been no activity on this ticket for months, punting it to Future Release. Once it's ready, then it can be moved into an active alpha/beta milestone.

#12 @hellofromTonya
12 months ago

  • Type changed from task (blessed) to defect (bug)

Changing the type to defect as it's not a blessed task.

#13 @pbearne
10 months ago

I have removed the extra
empty( $ext )
Last edited 10 months ago by pbearne (previous) (diff)
Note: See TracTickets for help on using tickets.