Opened 2 years ago
Closed 23 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)
comment:1
kovshenin
— 2 years ago
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!
comment:2
kovshenin
— 2 years ago
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.
comment:3
kovshenin
— 2 years ago
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 patch for the update_metadata_by_mid function test.