[wp-trac] [WordPress Trac] #25160: Unnecessarily passing $this by reference in core
WordPress Trac
noreply at wordpress.org
Wed Aug 28 18:40:56 UTC 2013
#25160: Unnecessarily passing $this by reference in core
-------------------------------------+------------------------------
Reporter: jdgrimes | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: trivial | Resolution:
Keywords: has-patch needs-testing |
-------------------------------------+------------------------------
Comment (by jdgrimes):
Replying to [comment:3 jdgrimes]:
> On another side note, I ran the tests suite in debug mode for the first
time - I got ~80 errors. A few notices about undefined properties or
variables, but by far mostly notices of using deprecated functions. If
those are expected, shouldn't we be silencing them with `@` or something?
I know its a separate topic - should I open a ticket for it, or is there
one already? Or is this behavior intended?
I'd like to ask another question about this. If you run the following
command:
`$ phpunit ./tests/dependencies/jquery`
With `WP_DEBUG` on, you'll get, e.g:
{{{
There was 1 error:
1)
Tests_Dependencies_jQuery::test_dont_allow_deregister_core_scripts_in_admin
wp_deregister_script was called <strong>incorrectly</strong>. Do not
deregister the <code>jquery</code> script in the administration area. To
target the frontend theme, use the <code>wp_enqueue_scripts</code> hook.
Please see <a
href="http://codex.wordpress.org/Debugging_in_WordPress">Debugging in
WordPress</a> for more information. (This message was added in version
3.6.)
/svn/wordpress/trunk/src/wp-includes/functions.php:3016
/svn/wordpress/trunk/src/wp-includes/functions.wp-scripts.php:129
/svn/wordpress/trunk/tests/tests/dependencies/jquery.php:55
}}}
This is the expected and correct result of that test.
So, are we not supposed to run tests in debug mode as a norm, or do we
want it to give these errors loudly when we do, rather than @suppressing
them so we can see any real errors? I was just assuming that, since
developing in debug mode is correct, testing with it on was expected too,
and I was expecting silencing of expected errors.
I'm sure there's a better place to ask this question, just point me in the
right direction...
--
Ticket URL: <http://core.trac.wordpress.org/ticket/25160#comment:10>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list