Commit Graph

8 Commits

Author SHA1 Message Date
John Blackbourn 6cf0caf13e Unify the initialisation of `$_SERVER` variables during test bootstrap. This abstracts the (re-)initialisation into a function that can be used inside of tests too, before assertions are performed.
See #35954


git-svn-id: https://develop.svn.wordpress.org/trunk@36715 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-25 21:59:56 +00:00
Andrew Ozz c7936b8785 Improve the performance of `wp_upload_dir()`:
- Cache the output in non-persistent cache.
- Cache the result from `wp_mkdir_p()` in persistent cache (when present).
- Introduce `wp_get_upload_dir()` for use when not uploading files. It is equivalent to `wp_upload_dir()` but does not check for the existence or create the upload directory.
- Change tests to use the non-cached `_wp_upload_dir()`. They change options on the fly (should never be used in production) to simulate different environments.
- Introduce `_upload_dir_no_subdir()` and `_upload_dir_https()` to facilitate testing. These use the proper `upload_dir` filter to simulate different environments.

Props kovshenin, azaozz.
See #34359.

git-svn-id: https://develop.svn.wordpress.org/trunk@36565 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-17 22:51:01 +00:00
Boone Gorges bf3773dbfb During PHPUnit tests, don't autodetect permalink structure during WP installation.
The unit tests expect non-pretty permalinks, so there's no benefit to detecting
the ability to have pretty permalinks. Moreover, the `wp_remote_get()` call can
cause installation to hang when there are DNS issues.

Fixes #31994.

git-svn-id: https://develop.svn.wordpress.org/trunk@32139 602fd350-edb4-49c9-b593-d223f7449a82
2015-04-16 23:59:01 +00:00
Scott Taylor 5c48c4f8a8 Allow `wp_die()` to die in plain text when running the test suite.
Props jorbin.
Fixes #27749.


git-svn-id: https://develop.svn.wordpress.org/trunk@28797 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-21 19:59:28 +00:00
Scott Taylor bf54ad6054 Add missing access modifiers to methods in `WP_Query`. Add magic methods for `__get()`, `__set()`, `__isset()`, `__unset()`, and `__call()`.
Add unit test for magic methods.

See #27881, #22234.


git-svn-id: https://develop.svn.wordpress.org/trunk@28523 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-19 06:48:56 +00:00
Scott Taylor d6a3c2a0de Add access modifiers to methods and members of list table classes:
* `WP_List_Table` is the base class that implements `__get()` and `__call()` for BC
* Adds unit tests to confirm that subclasses properly inherit magic methods
* Add modifiers to subclasses: `WP_Links_List_Table`, `WP_Media_List_Table`, `WP_MS_Sites_List_Table`, `WP_MS_Themes_List_Table`, `WP_MS_Users_List_Table`, `WP_Plugin_Install_List_Table`, `WP_Plugins_List_Table`, `WP_Posts_List_Table`, `WP_Terms_List_Table`, `WP_Theme_Install_List_Table`, `WP_Themes_List_Table`

See #27881, #22234.


git-svn-id: https://develop.svn.wordpress.org/trunk@28493 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-19 01:16:16 +00:00
Scott Taylor 85ac5c214d Add a unit test that demonstrates a magic getter.
See #27881.



git-svn-id: https://develop.svn.wordpress.org/trunk@28480 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-18 21:14:13 +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