Opened 22 months ago
Closed 22 months ago
#21 closed enhancement (fixed)
Unit tests for *_metadata_by_mid
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Legacy - Add New Tests |
| Component: | Capabilities | Keywords: | |
| Cc: | kovshenin |
Description
Let's create a few tests for the get, update and delete _metadata_by_mid() functions.
Attachments (4)
Change History (9)
Howdy all, this is my first time at unit testing for WordPress?, so go easy on me. I've created a short test for the update_metadata_by_mid() function which has a patch in this ticket http://core.trac.wordpress.org/ticket/18195
A local run went smooth with 5 assertions. Hoping for some feedback!
I've attached an improved version of the test case, moved all the initialization to the setup method, added some invalid keys and meta id runs. Cleanup after usage. Hopefully this will do better.
Third patch runs a test to see if caches got cleared after a meta update. This works with the latest patch to the function itself over at #wp18195. Let me know how this works for you. Thanks!
Here's a version that tests both update and delete functions. The patch for both functions together has been uploaded here #wp18195. Have a good day!

Here's a patch for the update_metadata_by_mid function test.