[wp-trac] [WordPress Trac] #63532: Unit Testing: Checking if images already exists before starting tests

WordPress Trac noreply at wordpress.org
Fri Jun 6 11:45:55 UTC 2025


#63532: Unit Testing: Checking if images already exists before starting tests
-------------------------------------------------+-------------------------
 Reporter:  SirLouen                             |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  reopened
 Priority:  normal                               |   Milestone:  6.9
Component:  Media                                |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests needs-      |     Focuses:  tests
  testing has-test-info                          |
-------------------------------------------------+-------------------------
Changes (by sandeepdahiya):

 * keywords:  has-patch has-unit-tests needs-testing needs-test-info => has-
     patch has-unit-tests needs-testing has-test-info


Comment:

 == Test Report
 === Description
 This report validates whether the indicated patch works as expected.

 Patch tested: [https://github.com/WordPress/wordpress-develop/pull/8927/
 PR 8927]

 === Environment
 - WordPress: 6.9-alpha-60093-src
 - PHP: 8.2.28
 - Server: nginx/1.27.5
 - Database: mysqli (Server: 8.4.5 / Client: mysqlnd 8.2.28)
 - Browser: Firefox 139.0
 - OS: Windows 10/11
 - Theme: Twenty Twenty-Five 1.2
 - MU Plugins: None activated
 - Plugins:
   * Test Reports 1.2.0

 === Actual Results
 1.  ✅ OK, but incomplete, skipped, or risky tests!
        Tests: 710, Assertions: 1702, Skipped: 3.
 2.   When tried without patch, 1 test failed: -

 {{{
 1)
 Tests_Media::test_wp_get_attachment_image_should_use_wp_get_attachment_metadata
 Failed asserting that two strings are identical.
 --- Expected
 +++ Actual
 @@ @@
 -'<img width="999" height="999" src="http://example.org/wp-
 content/uploads/2025/06/test-image-testsize-999x999.jpg" class
 ="attachment-testsize size-testsize" alt="" decoding="async"
 loading="lazy" srcset="http://example.org/wp-content/uploads/2025/06/test-
 image-testsize-999x999.jpg 999w, http://example.org/wp-
 content/uploads/2025/06/test-image-large-150x150.jpg 150w" sizes="auto,
 (max-width: 999px) 100vw, 999px" />'
 +'<img width="999" height="999" src="http://example.org/wp-
 content/uploads/2025/06/test-image-testsize-999x999.jpg" class
 ="attachment-testsize size-testsize" alt="" decoding="async"
 loading="lazy" srcset="http://example.org/wp-content/uploads/2025/06/test-
 image-testsize-999x999.jpg 999w, http://example.org/wp-
 content/uploads/2025/06/test-image-large-1-150x150.jpg 150w" sizes="auto,
 (max-width: 999px) 100vw, 999px" />'

 /var/www/tests/phpunit/tests/media.php:2765

 }}}


 === Additional Notes
 - npm run test:php -- --group media fails 1 test for file
 {{{
 test-image-large.jpg
 }}}
  but it doesn't fail for the file (without patch)
 {{{
 test-image-large.jpeg
 }}}

 There was no failure when extension was .jpeg.
 === Supplemental Artifacts
 Test result without patch: [[Image(https://ibb.co/TxcvVtFQ)]]

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


More information about the wp-trac mailing list