[wp-trac] [WordPress Trac] #63532: Unit Testing: Checking if images already exists before starting tests
WordPress Trac
noreply at wordpress.org
Thu Jun 5 06:10:37 UTC 2025
#63532: Unit Testing: Checking if images already exists before starting tests
-------------------------------------------------+-------------------------
Reporter: SirLouen | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting
| Review
Component: Media | Version:
Severity: normal | Resolution:
Keywords: has-test-info has-patch has-unit- | Focuses: tests
tests |
-------------------------------------------------+-------------------------
Changes (by abcd95):
* keywords: has-test-info has-patch has-unit-tests needs-testing => has-
test-info has-patch has-unit-tests
Comment:
== Test Report
=== Description
This report validates that the patch works as expected.
Patch tested: [https://github.com/WordPress/wordpress-develop/pull/8899 PR
8899]
=== Environment
- WordPress: 6.9-alpha-60093-src
- PHP: 8.2.25
- Server: nginx/1.27.2
- Database: mysqli (Server: 8.4.4 / Client: mysqlnd 8.2.25)
- Browser: Chrome 137.0.0.0
- OS: macOS
- Theme: Twenty Seventeen 3.9
=== Results
✅ No errors occur when running tests with `npm run test:php -- --group
media`
Contrary to when running the same tests without the patch, facing the
failure -
{{{
There was 1 failure:
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" />'
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63532#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list