Skip to content

added tests for wp_upload_bits#3659

Open
pbearne wants to merge 18 commits into
WordPress:trunkfrom
pbearne:57130_wp_upload_bits
Open

added tests for wp_upload_bits#3659
pbearne wants to merge 18 commits into
WordPress:trunkfrom
pbearne:57130_wp_upload_bits

Conversation

@pbearne

@pbearne pbearne commented Nov 22, 2022

Copy link
Copy Markdown

Trac ticket: https://core.trac.wordpress.org/ticket/65534

This is isn't working maybe someone else can work why we get this error

  1. tests_wp_upload_bits::test_second_parm_present
    Failed asserting that exception of type "PHPUnit\Framework\Error\Deprecated" is thrown.

@costdev costdev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @pbearne!

I've left some suggestions regarding the deprecation notices and failures I saw due to assumed filepaths in the test methods.

In addition, there's a lot of work needed in this PR to bring it up to Core test standards. See my review on this PR for some examples, and I'll add:

  • The file needs to be renamed for consistency with the rest of the test suite.
  • Now that the ticket is up, @ticket annotations should be added to each test method.
  • Test method names and descriptions could be improved.
    • Consider test method names like:
      • test_wp_upload_bits_should_do_something()
      • test_wp_upload_bits_should_not_do_something()
      • and write the test method description to reflect "Tests that wp_upload_bits does/does not do something".
  • Test methods with multiple assertions require a $message parameter to explain why an assertion failed.

When everything's looking good, feel free to ping me for another review.

Comment thread tests/phpunit/tests/functions/wpuploadbits.php Outdated
Comment thread tests/phpunit/tests/functions/wpuploadbits.php Outdated
Comment thread tests/phpunit/tests/functions/wpuploadbits.php Outdated
Comment thread tests/phpunit/tests/functions/wpuploadbits.php Outdated
Comment thread tests/phpunit/tests/functions/wpuploadbits.php Outdated
Comment thread tests/phpunit/tests/functions/wpuploadbits.php
Comment thread tests/phpunit/tests/functions/wpuploadbits.php Outdated
@SergeyBiryukov SergeyBiryukov changed the title added tests for wp_check_filetype added tests for wp_upload_bits Nov 22, 2022
pbearne and others added 6 commits November 22, 2022 12:37
Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com>
Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com>
Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com>
Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com>
Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com>

@costdev costdev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates @pbearne! I've left some additional/follow-up thoughts below.

Comment thread tests/phpunit/tests/functions/wpuploadbits.php Outdated
Comment thread tests/phpunit/tests/functions/wpuploadbits.php Outdated
Comment thread tests/phpunit/tests/functions/wpuploadbits.php Outdated
Comment thread tests/phpunit/tests/functions/wpuploadbits.php Outdated
Comment thread tests/phpunit/tests/functions/wpuploadbits.php Outdated
Comment thread tests/phpunit/tests/functions/wpuploadbits.php Outdated
Comment thread tests/phpunit/tests/functions/wpuploadbits.php Outdated
Comment thread tests/phpunit/tests/functions/wpuploadbits.php Outdated
Comment thread tests/phpunit/tests/functions/wpuploadbits.php Outdated
pbearne and others added 9 commits November 23, 2022 17:31
Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com>
Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com>
Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com>
Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com>
Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com>
Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com>
Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com>
Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com>
@mindctrl

Copy link
Copy Markdown

@pbearne if you're still working on this, could you bring it up to date with trunk? I'm unable to run the tests locally, I think due to some outdated Docker things still living in this branch.

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @pbearne@git.wordpress.org.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

Core Committers: Use this line as a base for the props when committing in SVN:

Props pbearne, costdev, mindctrl.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@pbearne

pbearne commented Jun 28, 2026

Copy link
Copy Markdown
Author

@pbearne if you're still working on this, could you bring it up to date with trunk? I'm unable to run the tests locally, I think due to some outdated Docker things still living in this branch.

Refreshed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants