Commit Graph

5 Commits

Author SHA1 Message Date
Andrew Nacin 31d3af406c Multisite: Add get_network_by_path() and wp_get_network() to begin cleanup of multisite load.
Tries to get network detection under control by simplifying wpmu_current_site(). It now also pops off each subdomain to find a more general match. Adds unit tests for get_network_by_path() and a new network factory for unit tests.

Much of this is likely to change in 3.9 as more of ms-load.php and ms-settings.php gets hacked to bits.

props jeremyfelt.
see #27003.


git-svn-id: https://develop.svn.wordpress.org/trunk@27178 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-13 23:06:12 +00:00
Scott Taylor ff4f1bb170 For unit tests that call `wpmu_create_blog()`, Blog factory, or installation code that attempts to clear transients: suppress database errors on `setUp` and restore on `tearDown`.
There are a few places in core that were preventing this from working by explicity setting `$wpdb->suppress_errors` to `false`. Instead, they should inherit the value that existed before errors were suppressed.

This allows Multisite unit tests to run without explosive database errors, and allows `$wpdb->suppress_errors` to be overridden all the way down the chain.

Fixes #26102.


git-svn-id: https://develop.svn.wordpress.org/trunk@26252 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-18 20:44:34 +00:00
Scott Taylor f3488744ce Add a default value to `WP_UnitTest_Factory_For_Comment::default_generation_definitions['comment_content']` to avoid a tornado of database errors in PHP 5.5/MySQL 5.6, even when `WP_DEBUG` is turned off.
See #25282.



git-svn-id: https://develop.svn.wordpress.org/trunk@25660 602fd350-edb4-49c9-b593-d223f7449a82
2013-10-02 19:46:58 +00:00
Scott Taylor 93cfccac2d Add unit test for `tax_query` against attachments.
See #22556.



git-svn-id: https://develop.svn.wordpress.org/trunk@25278 602fd350-edb4-49c9-b593-d223f7449a82
2013-09-06 14:43:49 +00:00
Andrew Nacin 8045afd81b Move PHPUnit tests into a tests/phpunit directory.
wp-tests-config.php can/should reside in the root of a develop checkout. `phpunit` should be run from the root.

see #25088.


git-svn-id: https://develop.svn.wordpress.org/trunk@25165 602fd350-edb4-49c9-b593-d223f7449a82
2013-08-29 18:39:34 +00:00