/** * @group get_fielddataid_byid */ public function test_get_fielddataid_byid_when_exists_in_cache() { $u = $this->factory->user->create(); $g = $this->factory->xprofile_group->create(); $f = $this->factory->xprofile_field->create(array('field_group_id' => $g)); // Fake the cache $d = new stdClass(); $d->id = 5; wp_cache_set("{$u}:{$f}", $d, 'bp_xprofile_data'); $this->assertSame(5, BP_XProfile_ProfileData::get_fielddataid_byid($f, $u)); }