[wp-trac] [WordPress Trac] #61530: Test tool and unit test improvements for 6.7
WordPress Trac
noreply at wordpress.org
Tue Jul 16 18:21:00 UTC 2024
#61530: Test tool and unit test improvements for 6.7
--------------------------------------+---------------------
Reporter: jonsurrell | Owner: (none)
Type: task (blessed) | Status: new
Priority: normal | Milestone: 6.7
Component: Build/Test Tools | Version:
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests | Focuses:
--------------------------------------+---------------------
Comment (by hellofromTonya):
In [changeset:"58738" 58738]:
{{{
#!CommitTicketReference repository="" revision="58738"
Tests: Don't declare nested named function in
Tests_Interactivity_API_wpInteractivityAPIFunctions.
Once the `test_process_directives_when_block_is_filtered()` method has
run, the named `test_render_block_data()` function declared nested within
becomes part of the global namespace, which could cause problems for other
tests.
Quite apart from the fact that the name starting with `test_` is
confusing (as methods prefixed with `test_` are supposed to be test
methods to be run by PHPUnit).
Using a closure for this callback fixes the issue. Declared as `static`
for a micro-optimization.
Follow-up to [57826].
Props jrf, hellofromTonya.
See #61530.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/61530#comment:23>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list