File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -419,6 +419,34 @@ public function test_get_metadata_with_empty_key_nested_array_value() {
419419 $ this ->assertSame ( array ( $ value ), $ found ['foo ' ] );
420420 }
421421
422+ /**
423+ * @dataProvider data_get_metadata_with_non_existent_object_id
424+ */
425+ public function test_get_metadata_with_non_existent_object_id ( $ expected , $ args ) {
426+ $ this ->assertSame ( $ expected , get_metadata ( 'user ' , ...$ args ) );
427+ }
428+
429+ public function data_get_metadata_with_non_existent_object_id () {
430+ return array (
431+ 'should return empty array for default `$meta_key` and `$single` values ' => array (
432+ 'expected ' => array (),
433+ 'args ' => array ( PHP_INT_MAX ),
434+ ),
435+ 'should return empty array for default `$single` value ' => array (
436+ 'expected ' => array (),
437+ 'args ' => array ( PHP_INT_MAX , 'meta_key ' ),
438+ ),
439+ 'should return empty array when `$single` is `false` ' => array (
440+ 'expected ' => array (),
441+ 'args ' => array ( PHP_INT_MAX , 'meta_key ' , false ),
442+ ),
443+ 'should return empty string when `$single` is `true` ' => array (
444+ 'expected ' => '' ,
445+ 'args ' => array ( PHP_INT_MAX , 'meta_key ' , true ),
446+ ),
447+ );
448+ }
449+
422450 /** Helpers */
423451
424452 public function updated_meta ( $ meta_id ) {
You can’t perform that action at this time.
0 commit comments