Make WordPress Core

Opened 3 years 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:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch has-unit-tests dev-feedback
Focuses: Cc:

Description


Change History (14)

#1 @pbearne
3 years ago

  • Component changed from General to Build/Test Tools

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


3 years ago
#2

  • Keywords has-patch has-unit-tests added

test for _wp_check_existing_file_names

Trac ticket: [](https://core.trac.wordpress.org/ticket/55192)

#4 @pbearne
3 years ago

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

#5 @costdev
3 years ago

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

#6 @costdev
3 years ago

  • Type changed from enhancement to task (blessed)

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


2 years ago

#9 @costdev
2 years 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:

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

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


2 years ago

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

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

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

#13 @pbearne
2 years ago

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

#14 @hellofromTonya
10 months 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.