#35976 closed enhancement (fixed)
Unit test: Check if the device can upload
Reported by: | borgesbruno | Owned by: | johnbillion |
---|---|---|---|
Milestone: | 4.5 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Upload | Keywords: | needs-patch |
Focuses: | Cc: |
Description
I've wrote some tests for the function that check whether a device can upload. The tests cover many devices through a small list of the user agents.
Attachments (2)
Change History (13)
#7
@
9 years ago
- Owner set to johnbillion
- Resolution set to fixed
- Status changed from new to closed
In 36810:
#8
@
9 years ago
- Keywords needs-patch added; has-patch has-unit-tests removed
- Resolution fixed deleted
- Status changed from closed to reopened
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 true.
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.
Note: See
TracTickets for help on using
tickets.
Thanks @borgesbruno.
Can you add an inline comment to each of the datas in the dataProvider stating which browser the user agent refers to? This will make maintenance, debugging, etc easier.