#35976 closed enhancement (fixed)
Unit test: Check if the device can upload
| Reported by: | borgesbruno | Owned by: | johnbillion |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.5 |
| Component: | Upload | Version: | |
| Severity: | normal | Keywords: | needs-patch |
| Cc: | Focuses: |
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)
#8
@
10 years ago
- Keywords needs-patch added; has-patch has-unit-tests removed
- Resolution fixed
- Status closed → 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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.