Make WordPress Core

Opened 2 years ago

Last modified 3 weeks ago

#55192 assigned defect (bug)

unit tests for _wp_check_existing_file_names

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


Change History (14)

#1 @pbearne
2 years ago

  • Component changed from General to Build/Test Tools

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

2 years ago

  • Keywords has-patch has-unit-tests added

test for _wp_check_existing_file_names

Trac ticket: [](

#4 @pbearne
2 years ago

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

#5 @costdev
2 years ago

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

#6 @costdev
2 years ago

  • Type changed from enhancement to task (blessed)

#7 @hellofromTonya
2 years 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.

19 months ago

#9 @costdev
19 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.

19 months ago

#11 @hellofromTonya
19 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
19 months ago

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

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

#13 @pbearne
18 months ago

I have removed the extra
empty( $ext )
Last edited 18 months ago by pbearne (previous) (diff)

#14 @hellofromTonya
3 weeks ago

  • Owner hellofromTonya deleted

As of today, I'm no longer a sponsored contributor and am starting a month or more AFK break. To not stand in the way, I'm clearing me as the ticket owner, which opens the ticket for someone to step in to shepherd this ticket forward to resolution.

Note: See TracTickets for help on using tickets.