- Timestamp:
- 02/14/2014 06:29:30 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/testcases/xprofile/class-bp-xprofile-profiledata.php
r7880 r7882 146 146 */ 147 147 public function test_get_value_byid_multipleusers_uncached() { 148 $time = bp_core_current_time(); 149 150 $u1 = $this->create_user( array( 151 'last_activity' => $time, 152 ) ); 153 $u2 = $this->create_user( array( 154 'last_activity' => $time, 155 ) ); 156 $g = $this->factory->xprofile_group->create(); 157 $f = $this->factory->xprofile_field->create( array( 158 'type' => 'textbox', 159 'field_group_id' => $g, 160 ) ); 148 $time = date( 'Y-m-d h:i:s', time() - 60*60*24 ); 149 150 $u1 = $this->create_user(); 151 $u2 = $this->create_user(); 152 $g = $this->factory->xprofile_group->create(); 153 $f = $this->factory->xprofile_field->create( array( 154 'type' => 'textbox', 155 'field_group_id' => $g, 156 ) ); 157 158 // To make the tests reliable, we have to force the last_updated 159 // BP doesn't easily allow this except via filter 160 $this->last_updated = $time; 161 add_filter( 'xprofile_data_last_updated_before_save', array( $this, 'filter_time' ) ); 161 162 162 163 $d1 = new BP_XProfile_ProfileData(); … … 174 175 $d2->save(); 175 176 177 remove_filter( 'xprofile_data_last_updated_before_save', array( $this, 'filter_time' ) ); 178 176 179 // Ensure it's deleted from cache 177 180 wp_cache_delete( $f, 'bp_xprofile_data_' . $u1 ); … … 223 226 */ 224 227 public function test_get_value_byid_multipleusers_cached() { 225 $time = bp_core_current_time(); 226 227 $u1 = $this->create_user( array( 228 'last_activity' => $time, 229 ) ); 230 $u2 = $this->create_user( array( 231 'last_activity' => $time, 232 ) ); 228 $time = date( 'Y-m-d h:i:s', time() - 60*60*24 ); 229 230 $u1 = $this->create_user(); 231 $u2 = $this->create_user(); 233 232 $g = $this->factory->xprofile_group->create(); 234 233 $f = $this->factory->xprofile_field->create( array( … … 429 428 } 430 429 430 public function filter_time() { 431 return $this->last_updated; 432 } 431 433 }
Note: See TracChangeset
for help on using the changeset viewer.