[buddypress-trac] [BuddyPress Trac] #6278: Attachment Library

buddypress-trac noreply at wordpress.org
Tue Apr 14 11:31:45 UTC 2015


#6278: Attachment Library
------------------------------------+-----------------------
 Reporter:  imath                   |       Owner:  imath
     Type:  enhancement             |      Status:  assigned
 Priority:  normal                  |   Milestone:  2.3
Component:  API                     |     Version:
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |
------------------------------------+-----------------------

Comment (by imath):

 Replying to [comment:58 DJPaul]:

 6278.unittests.patch is simply adding unit tests for the BP Attachment
 class following your recommandations

 > In the tests:
 >
 > * `BP_Attachment_Extend` doesn't make sense to me as a class name for
 the unit tests. I suggest something like `BP_Tests_Attachment`??.

 Renamed it to `BPTest_Attachment_Extension`

 > * Do we really need to upload files in our unit tests and write them to
 disk? It will be slow. Can't we just fake some data to pretend that has
 happened?

 To fake uploads, i suggest to interrupt `_wp_handle_upload()` just before
 it tries moving the temp file. To do so i'm including a specific upload
 error handler function in the upload overrides that creates an error
 'fake_upload_success'. So we only need at the very list to include a new
 asset to fake the temporary file and i suggest to use this file :
 https://buddypress.org/media/disc.png

 > * The `rrmdir` function would best go in the base `BP_UnitTestCase` to
 avoid duplicating them.

 Moved it in `BP_UnitTestCase` and removed it in the
 `/testcases/core/avatars.php`

 > * For `test_bp_upload_dir_ms`, please see #6162.
 This test is now using `$this->markTestSkipped();` for default test config

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6278#comment:66>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list