[wp-trac] [WordPress Trac] #35976: Unit test: Check if the device can upload
WordPress Trac
noreply at wordpress.org
Thu Mar 3 02:39:22 UTC 2016
#35976: Unit test: Check if the device can upload
-------------------------+--------------------------
Reporter: borgesbruno | Owner: johnbillion
Type: enhancement | Status: reopened
Priority: normal | Milestone: 4.5
Component: Upload | Version:
Severity: normal | Resolution:
Keywords: needs-patch | Focuses:
-------------------------+--------------------------
Changes (by johnbillion):
* keywords: has-patch has-unit-tests => needs-patch
* status: closed => reopened
* resolution: fixed =>
Comment:
Tests are failing due to `wp_is_mobile()` being called indirectly in an
earlier test, which sets its `$is_mobile` static var to `false`, which
causes `_device_can_upload()` to always return false.
Running the `test_device_can_upload()` test in isolation succeeds.
The solution is to remove the somewhat pointless static var in
`wp_is_mobile()`, which only serves to avoid a handful of `strpos()` calls
which are fast anyway.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35976#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list