Changeset 8012
- Timestamp:
- 03/01/2014 02:48:42 AM (11 years ago)
- Location:
- trunk/tests
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/includes/testcase.php
r7988 r8012 220 220 $r = wp_parse_args( $args, array( 221 221 'role' => 'subscriber', 222 'last_activity' => date( 'Y-m-d h:i:s', strtotime( bp_core_current_time() ) - 60*60*24*365 ),222 'last_activity' => date( 'Y-m-d H:i:s', strtotime( bp_core_current_time() ) - 60*60*24*365 ), 223 223 ) ); 224 224 -
trunk/tests/testcases/activity/class.BP_Activity_Activity.php
r7951 r8012 429 429 $now = time(); 430 430 $a1 = $this->factory->activity->create( array( 431 'recorded_time' => date( 'Y-m-d h:i:s', $now - 500 ),432 ) ); 433 $a2 = $this->factory->activity->create( array( 434 'recorded_time' => date( 'Y-m-d h:i:s', $now - 100 ),431 'recorded_time' => date( 'Y-m-d H:i:s', $now - 500 ), 432 ) ); 433 $a2 = $this->factory->activity->create( array( 434 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), 435 435 ) ); 436 436 $a3 = $this->factory->activity->create( array( 437 'recorded_time' => date( 'Y-m-d h:i:s', $now - 300 ),438 ) ); 439 440 $this->assertSame( date( 'Y-m-d h:i:s', $now - 100 ), BP_Activity_Activity::get_last_updated() );437 'recorded_time' => date( 'Y-m-d H:i:s', $now - 300 ), 438 ) ); 439 440 $this->assertSame( date( 'Y-m-d H:i:s', $now - 100 ), BP_Activity_Activity::get_last_updated() ); 441 441 } 442 442 } -
trunk/tests/testcases/members/template.php
r7846 r8012 105 105 global $members_template; 106 106 107 $time = date( 'Y-m-d h:i:s', time() - 24*60*60 );107 $time = date( 'Y-m-d H:i:s', time() - 24*60*60 ); 108 108 $members_template = new stdClass; 109 109 $members_template->member = new stdClass; … … 120 120 global $members_template; 121 121 122 $time = date( 'Y-m-d h:i:s', time() - 24*60*60 );122 $time = date( 'Y-m-d H:i:s', time() - 24*60*60 ); 123 123 $members_template = new stdClass; 124 124 $members_template->member = new stdClass; … … 135 135 global $members_template; 136 136 137 $time = date( 'Y-m-d h:i:s', time() - 24*60*60 );137 $time = date( 'Y-m-d H:i:s', time() - 24*60*60 ); 138 138 $members_template = new stdClass; 139 139 $members_template->member = new stdClass; -
trunk/tests/testcases/xprofile/activity.php
r7998 r8012 16 16 // Fake new/old values to ensure a change 17 17 $old_values = array( 18 $this->updated_profile_data['f'] ->id=> array(19 'value' => 'foo', 20 'visibility' => 'public', 21 ), 22 ); 23 $new_values = array( 24 $this->updated_profile_data['f'] ->id=> array(25 'value' => 'foo2', 26 'visibility' => 'public', 27 ), 28 ); 29 30 $this->assertFalse( bp_xprofile_updated_profile_activity( $d['u'], array( $d['f'] ->id), true ) );18 $this->updated_profile_data['f'] => array( 19 'value' => 'foo', 20 'visibility' => 'public', 21 ), 22 ); 23 $new_values = array( 24 $this->updated_profile_data['f'] => array( 25 'value' => 'foo2', 26 'visibility' => 'public', 27 ), 28 ); 29 30 $this->assertFalse( bp_xprofile_updated_profile_activity( $d['u'], array( $d['f'] ), true ) ); 31 31 } 32 32 … … 38 38 39 39 $time = time(); 40 $prev_time = date( 'Y-m-d h:i:s', $time - ( 119 * 60 ) );41 $now_time = date( 'Y-m-d h:i:s', $time );40 $prev_time = date( 'Y-m-d H:i:s', $time - ( 119 * 60 ) ); 41 $now_time = date( 'Y-m-d H:i:s', $time ); 42 42 43 43 $this->factory->activity->create( array( … … 50 50 // Fake new/old values to ensure a change 51 51 $old_values = array( 52 $this->updated_profile_data['f'] ->id=> array(53 'value' => 'foo', 54 'visibility' => 'public', 55 ), 56 ); 57 $new_values = array( 58 $this->updated_profile_data['f'] ->id=> array(59 'value' => 'foo2', 60 'visibility' => 'public', 61 ), 62 ); 63 64 $this->assertFalse( bp_xprofile_updated_profile_activity( $d['u'], array( $d['f'] ->id), false ) );52 $this->updated_profile_data['f'] => array( 53 'value' => 'foo', 54 'visibility' => 'public', 55 ), 56 ); 57 $new_values = array( 58 $this->updated_profile_data['f'] => array( 59 'value' => 'foo2', 60 'visibility' => 'public', 61 ), 62 ); 63 64 $this->assertFalse( bp_xprofile_updated_profile_activity( $d['u'], array( $d['f'] ), false ) ); 65 65 } 66 66 … … 71 71 $d = $this->setup_updated_profile_data(); 72 72 73 $time = time();74 $prev_time = date( 'Y-m-d h:i:s', $time - ( 121 * 60 ) );75 $now_time = date( 'Y-m-d h:i:s', $time );73 $time = strtotime( bp_core_current_time() ); 74 $prev_time = date( 'Y-m-d H:i:s', $time - ( 121 * 60 ) ); 75 $now_time = date( 'Y-m-d H:i:s', $time ); 76 76 77 77 $this->factory->activity->create( array( … … 84 84 // Fake new/old values to ensure a change 85 85 $old_values = array( 86 $this->updated_profile_data['f'] ->id=> array(87 'value' => 'foo', 88 'visibility' => 'public', 89 ), 90 ); 91 $new_values = array( 92 $this->updated_profile_data['f'] ->id=> array(93 'value' => 'foo2', 94 'visibility' => 'public', 95 ), 96 ); 97 98 $this->assertTrue( bp_xprofile_updated_profile_activity( $d['u'], array( $d['f'] ->id), false, $old_values, $new_values ) );86 $this->updated_profile_data['f'] => array( 87 'value' => 'foo', 88 'visibility' => 'public', 89 ), 90 ); 91 $new_values = array( 92 $this->updated_profile_data['f'] => array( 93 'value' => 'foo2', 94 'visibility' => 'public', 95 ), 96 ); 97 98 $this->assertTrue( bp_xprofile_updated_profile_activity( $d['u'], array( $d['f'] ), false, $old_values, $new_values ) ); 99 99 100 100 $existing = bp_activity_get( array( … … 118 118 // Fake new/old values to ensure a change 119 119 $old_values = array( 120 $this->updated_profile_data['f'] ->id=> array(121 'value' => 'foo', 122 'visibility' => 'public', 123 ), 124 ); 125 $new_values = array( 126 $this->updated_profile_data['f'] ->id=> array(127 'value' => 'foo2', 128 'visibility' => 'public', 129 ), 130 ); 131 132 $this->assertTrue( bp_xprofile_updated_profile_activity( $d['u'], array( $d['f'] ->id), false, $old_values, $new_values ) );120 $this->updated_profile_data['f'] => array( 121 'value' => 'foo', 122 'visibility' => 'public', 123 ), 124 ); 125 $new_values = array( 126 $this->updated_profile_data['f'] => array( 127 'value' => 'foo2', 128 'visibility' => 'public', 129 ), 130 ); 131 132 $this->assertTrue( bp_xprofile_updated_profile_activity( $d['u'], array( $d['f'] ), false, $old_values, $new_values ) ); 133 133 134 134 $existing = bp_activity_get( array( … … 151 151 152 152 $old_values = array( 153 $this->updated_profile_data['f'] ->id=> array(154 'value' => 'foo', 155 'visibility' => 'public', 156 ), 157 ); 158 $new_values = array( 159 $this->updated_profile_data['f'] ->id=> array(160 'value' => 'foo', 161 'visibility' => 'public', 162 ), 163 ); 164 165 $this->assertFalse( bp_xprofile_updated_profile_activity( $d['u'], array( $d['f'] ->id), false, $old_values, $new_values ) );153 $this->updated_profile_data['f'] => array( 154 'value' => 'foo', 155 'visibility' => 'public', 156 ), 157 ); 158 $new_values = array( 159 $this->updated_profile_data['f'] => array( 160 'value' => 'foo', 161 'visibility' => 'public', 162 ), 163 ); 164 165 $this->assertFalse( bp_xprofile_updated_profile_activity( $d['u'], array( $d['f'] ), false, $old_values, $new_values ) ); 166 166 } 167 167 … … 173 173 174 174 $old_values = array( 175 $this->updated_profile_data['f'] ->id=> array(176 'value' => 'foo', 177 'visibility' => 'loggedin', 178 ), 179 ); 180 $new_values = array( 181 $this->updated_profile_data['f'] ->id=> array(182 'value' => 'bar', 183 'visibility' => 'loggedin', 184 ), 185 ); 186 187 $this->assertFalse( bp_xprofile_updated_profile_activity( $d['u'], array( $d['f'] ->id), false, $old_values, $new_values ) );175 $this->updated_profile_data['f'] => array( 176 'value' => 'foo', 177 'visibility' => 'loggedin', 178 ), 179 ); 180 $new_values = array( 181 $this->updated_profile_data['f'] => array( 182 'value' => 'bar', 183 'visibility' => 'loggedin', 184 ), 185 ); 186 187 $this->assertFalse( bp_xprofile_updated_profile_activity( $d['u'], array( $d['f'] ), false, $old_values, $new_values ) ); 188 188 } 189 189 … … 195 195 196 196 $old_values = array( 197 $this->updated_profile_data['f'] ->id=> array(198 'value' => 'foo', 199 'visibility' => 'public', 200 ), 201 ); 202 $new_values = array( 203 $this->updated_profile_data['f'] ->id=> array(204 'value' => 'bar', 205 'visibility' => 'loggedin', 206 ), 207 ); 208 209 $this->assertFalse( bp_xprofile_updated_profile_activity( $d['u'], array( $d['f'] ->id), false, $old_values, $new_values ) );197 $this->updated_profile_data['f'] => array( 198 'value' => 'foo', 199 'visibility' => 'public', 200 ), 201 ); 202 $new_values = array( 203 $this->updated_profile_data['f'] => array( 204 'value' => 'bar', 205 'visibility' => 'loggedin', 206 ), 207 ); 208 209 $this->assertFalse( bp_xprofile_updated_profile_activity( $d['u'], array( $d['f'] ), false, $old_values, $new_values ) ); 210 210 } 211 211 … … 217 217 218 218 $old_values = array( 219 $this->updated_profile_data['f'] ->id=> array(220 'value' => 'foo', 221 'visibility' => 'loggedin', 222 ), 223 ); 224 $new_values = array( 225 $this->updated_profile_data['f'] ->id=> array(226 'value' => 'foo', 227 'visibility' => 'public', 228 ), 229 ); 230 231 $this->assertTrue( bp_xprofile_updated_profile_activity( $d['u'], array( $d['f'] ->id), false, $old_values, $new_values ) );219 $this->updated_profile_data['f'] => array( 220 'value' => 'foo', 221 'visibility' => 'loggedin', 222 ), 223 ); 224 $new_values = array( 225 $this->updated_profile_data['f'] => array( 226 'value' => 'foo', 227 'visibility' => 'public', 228 ), 229 ); 230 231 $this->assertTrue( bp_xprofile_updated_profile_activity( $d['u'], array( $d['f'] ), false, $old_values, $new_values ) ); 232 232 } 233 233 … … 240 240 $old_values = array(); 241 241 $new_values = array( 242 $this->updated_profile_data['f'] ->id=> array(243 'value' => 'bar', 244 'visibility' => 'public', 245 ), 246 ); 247 248 $this->assertTrue( bp_xprofile_updated_profile_activity( $d['u'], array( $d['f'] ->id), false, $old_values, $new_values ) );242 $this->updated_profile_data['f'] => array( 243 'value' => 'bar', 244 'visibility' => 'public', 245 ), 246 ); 247 248 $this->assertTrue( bp_xprofile_updated_profile_activity( $d['u'], array( $d['f'] ), false, $old_values, $new_values ) ); 249 249 } 250 250 … … 256 256 257 257 $old_values = array( 258 $this->updated_profile_data['f'] ->id=> array(259 'value' => 'foo', 260 'visibility' => 'public', 261 ), 262 ); 263 $new_values = array( 264 $this->updated_profile_data['f'] ->id=> array(265 'value' => 'bar', 266 'visibility' => 'public', 267 ), 268 ); 269 270 $this->assertTrue( bp_xprofile_updated_profile_activity( $d['u'], array( $d['f'] ->id), false, $old_values, $new_values ) );258 $this->updated_profile_data['f'] => array( 259 'value' => 'foo', 260 'visibility' => 'public', 261 ), 262 ); 263 $new_values = array( 264 $this->updated_profile_data['f'] => array( 265 'value' => 'bar', 266 'visibility' => 'public', 267 ), 268 ); 269 270 $this->assertTrue( bp_xprofile_updated_profile_activity( $d['u'], array( $d['f'] ), false, $old_values, $new_values ) ); 271 271 } 272 272 … … 277 277 $this->updated_profile_data['f'] = $this->factory->xprofile_field->create( array( 278 278 'type' => 'textbox', 279 'field_group_id' => $this->updated_profile_data['g'] ->id,279 'field_group_id' => $this->updated_profile_data['g'], 280 280 ) ); 281 281 -
trunk/tests/testcases/xprofile/class-bp-xprofile-profiledata.php
r7882 r8012 146 146 */ 147 147 public function test_get_value_byid_multipleusers_uncached() { 148 $time = date( 'Y-m-d h:i:s', time() - 60*60*24 );148 $time = date( 'Y-m-d H:i:s', time() - 60*60*24 ); 149 149 150 150 $u1 = $this->create_user(); … … 226 226 */ 227 227 public function test_get_value_byid_multipleusers_cached() { 228 $time = date( 'Y-m-d h:i:s', time() - 60*60*24 );228 $time = date( 'Y-m-d H:i:s', time() - 60*60*24 ); 229 229 230 230 $u1 = $this->create_user();
Note: See TracChangeset
for help on using the changeset viewer.