[wp-trac] [WordPress Trac] #21181: simplify and add filter to is_upload_space_available

WordPress Trac wp-trac at lists.automattic.com
Thu Sep 27 05:36:17 UTC 2012


#21181: simplify and add filter to is_upload_space_available
------------------------------------+-----------------------
 Reporter:  jkudish                 |       Owner:  westi
     Type:  enhancement             |      Status:  reopened
 Priority:  normal                  |   Milestone:  3.5
Component:  Multisite               |     Version:  3.4.1
 Severity:  normal                  |  Resolution:
 Keywords:  needs-unit-tests close  |
------------------------------------+-----------------------

Comment (by jkudish):

 The existing test gets skipped when I run the test suite with the
 following error:

 > This test is broken when blogs.dir does not exist.

 This is as intended, but even when I add a blogs.dir folder, it gets
 skipped. Maybe it's a case of me `doing_it_wrong()` in which case I'd
 appreciate a nudge in the right direction. Anyways, I have a suspicion
 that this may be why the error in [21387] never got caught, as testing
 `upload_is_user_over_quota()` should also in theory test
 `get_space_used()`.

 I still think having a separate test for `get_space_used()` is a good
 idea, but I am wondering what the best way to test it is. As is, it will
 return 0, since there's nothing in the upload directory. I am thinking
 uploading a temporary file in the test, calculating it's size, making sure
 `get_space_used()` matches it and then deleting the file, is what the test
 should do. What do you think?

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21181#comment:24>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list