Changeset 8131
- Timestamp:
- 03/14/2014 12:37:28 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-functions.php
r8130 r8131 638 638 } 639 639 640 // If nothing was found, return false640 // If nothing was found, return empty string 641 641 if ( empty( $values ) ) { 642 $retval = false;642 $retval = ''; 643 643 } else { 644 644 $retval = $values; 645 645 } 646 }647 648 // Legacy - On failure, expect false, not an empty string649 if ( '' === $retval ) {650 $retval = false;651 646 } 652 647 -
trunk/tests/testcases/activity/class.BP_Activity_Activity.php
r8125 r8131 65 65 66 66 $meta = bp_activity_get_meta( $activity, 'Paul' ); 67 $this->assert False($meta );67 $this->assertSame( '', $meta ); 68 68 } 69 69 -
trunk/tests/testcases/activity/functions.php
r8130 r8131 133 133 bp_activity_update_meta( $a, $krazy_key, 'bar' ); 134 134 135 $this->assert Empty(bp_activity_get_meta( $a, 'foo' ) );135 $this->assertSame( '', bp_activity_get_meta( $a, 'foo' ) ); 136 136 } 137 137 … … 155 155 $a = $this->factory->activity->create(); 156 156 bp_activity_update_meta( $a, 'foo', false ); 157 $this->assert False(bp_activity_get_meta( $a, 'foo' ) );157 $this->assertSame( '', bp_activity_get_meta( $a, 'foo' ) ); 158 158 } 159 159 … … 164 164 public function test_bp_activity_update_meta_new() { 165 165 $a = $this->factory->activity->create(); 166 $this->assert False(bp_activity_get_meta( $a, 'foo' ), '"foo" meta should be empty for this activity item.' );166 $this->assertSame( '', bp_activity_get_meta( $a, 'foo' ), '"foo" meta should be empty for this activity item.' ); 167 167 $this->assertTrue( bp_activity_update_meta( $a, 'foo', 'bar' ) ); 168 168 $this->assertSame( 'bar', bp_activity_get_meta( $a, 'foo' ) ); … … 239 239 240 240 $krazy_key = ' f!@#$%^o *(){}o?+'; 241 $this->assert Empty(bp_activity_get_meta( $a, $krazy_key ) );241 $this->assertSame( '', bp_activity_get_meta( $a, $krazy_key ) ); 242 242 } 243 243 … … 270 270 * @group bp_activity_get_meta 271 271 * @group activitymeta 272 * @ticket BP5399 272 273 */ 273 274 public function test_bp_activity_get_meta_no_results_returns_false() { 274 275 $a = $this->factory->activity->create(); 275 276 276 // @todo this is a quirk 277 $this->assertFalse( bp_activity_get_meta( $a, 'foo' ) ); 277 $this->assertSame( '', bp_activity_get_meta( $a, 'foo' ) ); 278 278 } 279 279 … … 347 347 bp_activity_update_meta( $a, 'foo', 'bar' ); 348 348 $this->assertTrue( bp_activity_delete_meta( $a, 'foo', 'bar' ) ); 349 $this->assert False(bp_activity_get_meta( $a, 'foo' ) );349 $this->assertSame( '', bp_activity_get_meta( $a, 'foo' ) ); 350 350 } 351 351 … … 359 359 bp_activity_update_meta( $a, 'foo1', 'bar1' ); 360 360 $this->assertTrue( bp_activity_delete_meta( $a ) ); 361 $this->assert False(bp_activity_get_meta( $a, 'foo' ) );362 $this->assert False(bp_activity_get_meta( $a, 'foo1' ) );361 $this->assertSame( '', bp_activity_get_meta( $a, 'foo' ) ); 362 $this->assertSame( '', bp_activity_get_meta( $a, 'foo1' ) ); 363 363 } 364 364 … … 371 371 bp_activity_update_meta( $a, 'foo', 'bar' ); 372 372 $this->assertTrue( bp_activity_delete_meta( $a, 'foo', 'bar' ) ); 373 $this->assert False(bp_activity_get_meta( $a, 'foo' ) );373 $this->assertSame( '', bp_activity_get_meta( $a, 'foo' ) ); 374 374 } 375 375 … … 409 409 410 410 $this->assertTrue( bp_activity_delete_meta( $a1, 'foo', '', true ) ); 411 $this->assert Empty( '', bp_activity_get_meta( $a1, 'foo' ) );412 $this->assert Empty( '', bp_activity_get_meta( $a2, 'foo' ) );411 $this->assertSame( '', bp_activity_get_meta( $a1, 'foo' ) ); 412 $this->assertSame( '', bp_activity_get_meta( $a2, 'foo' ) ); 413 413 $this->assertSame( 'bar1', bp_activity_get_meta( $a1, 'foo1' ) ); 414 414 $this->assertSame( 'bar1', bp_activity_get_meta( $a2, 'foo1' ) ); -
trunk/tests/testcases/blogs/functions.php
r8130 r8131 94 94 95 95 $this->assertTrue( bp_blogs_delete_blogmeta( 1, 'foo', '', true ) ); 96 $this->assert Empty( '', bp_blogs_get_blogmeta( 1, 'foo' ) );97 $this->assert Empty( '', bp_blogs_get_blogmeta( 2, 'foo' ) );96 $this->assertSame( '', bp_blogs_get_blogmeta( 1, 'foo' ) ); 97 $this->assertSame( '', bp_blogs_get_blogmeta( 2, 'foo' ) ); 98 98 $this->assertSame( 'bar1', bp_blogs_get_blogmeta( 1, 'foo1' ) ); 99 99 $this->assertSame( 'bar1', bp_blogs_get_blogmeta( 2, 'foo1' ) ); … … 117 117 bp_blogs_update_blogmeta( 1, 'foo', 'bar' ); 118 118 $krazy_key = ' f!@#$%^o *(){}o?+'; 119 $this->assert Empty(bp_blogs_get_blogmeta( 1, $krazy_key ) );119 $this->assertSame( '', bp_blogs_get_blogmeta( 1, $krazy_key ) ); 120 120 } 121 121 … … 175 175 $krazy_key = ' f!@#$%^o *(){}o?+'; 176 176 bp_blogs_update_blogmeta( 1, $krazy_key, 'bar' ); 177 $this->assert Empty(bp_blogs_get_blogmeta( 1, 'foo' ) );177 $this->assertSame( '', bp_blogs_get_blogmeta( 1, 'foo' ) ); 178 178 } 179 179 -
trunk/tests/testcases/groups/functions.php
r8129 r8131 308 308 public function test_groups_update_groupmeta_new() { 309 309 $g = $this->factory->group->create(); 310 $this->assert Equals( '', groups_get_groupmeta( $g, 'foo' ), '"foo" meta should be empty for this group.' );310 $this->assertSame( '', groups_get_groupmeta( $g, 'foo' ), '"foo" meta should be empty for this group.' ); 311 311 $this->assertTrue( groups_update_groupmeta( $g, 'foo', 'bar' ) ); 312 312 $this->assertSame( 'bar', groups_get_groupmeta( $g, 'foo' ) ); … … 365 365 366 366 $krazy_key = ' f!@#$%^o *(){}o?+'; 367 $this->assert Empty(groups_get_groupmeta( $g, $krazy_key ) );367 $this->assertSame( '', groups_get_groupmeta( $g, $krazy_key ) ); 368 368 } 369 369 … … 509 509 510 510 $this->assertTrue( groups_delete_groupmeta( $g1, 'foo', '', true ) ); 511 $this->assert Empty( '', groups_get_groupmeta( $g1, 'foo' ) );512 $this->assert Empty( '', groups_get_groupmeta( $g2, 'foo' ) );511 $this->assertSame( '', groups_get_groupmeta( $g1, 'foo' ) ); 512 $this->assertSame( '', groups_get_groupmeta( $g2, 'foo' ) ); 513 513 $this->assertSame( 'bar1', groups_get_groupmeta( $g1, 'foo1' ) ); 514 514 $this->assertSame( 'bar1', groups_get_groupmeta( $g2, 'foo1' ) ); -
trunk/tests/testcases/xprofile/functions.php
r8130 r8131 221 221 $this->assertSame( 'bar', bp_xprofile_get_meta( $g, 'group', 'foo' ) ); 222 222 $this->assertTrue( bp_xprofile_delete_meta( $g, 'group', 'foo', 'bar' ) ); 223 $this->assert Equals( '', bp_xprofile_get_meta( $g, 'group', 'foo' ) );223 $this->assertSame( '', bp_xprofile_get_meta( $g, 'group', 'foo' ) ); 224 224 } 225 225 … … 237 237 $this->assertTrue( bp_xprofile_delete_meta( $g, 'group' ) ); 238 238 239 $this->assert Equals( '', bp_xprofile_get_meta( $g, 'group', 'foo' ) );240 $this->assert Equals( '', bp_xprofile_get_meta( $g, 'group', 'foo2' ) );239 $this->assertSame( '', bp_xprofile_get_meta( $g, 'group', 'foo' ) ); 240 $this->assertSame( '', bp_xprofile_get_meta( $g, 'group', 'foo2' ) ); 241 241 } 242 242 … … 276 276 277 277 $this->assertTrue( bp_xprofile_delete_meta( $g1, 'group', 'foo', '', true ) ); 278 $this->assert Empty( '', bp_xprofile_get_meta( $g1, 'group', 'foo' ) );279 $this->assert Empty( '', bp_xprofile_get_meta( $g2, 'group', 'foo' ) );278 $this->assertSame( '', bp_xprofile_get_meta( $g1, 'group', 'foo' ) ); 279 $this->assertSame( '', bp_xprofile_get_meta( $g2, 'group', 'foo' ) ); 280 280 $this->assertSame( 'bar1', bp_xprofile_get_meta( $g1, 'group', 'foo1' ) ); 281 281 $this->assertSame( 'bar1', bp_xprofile_get_meta( $g2, 'group', 'foo1' ) ); … … 386 386 $krazy_key = ' f!@#$%^o *(){}o?+'; 387 387 bp_xprofile_update_meta( $g, 'group', $krazy_key, 'bar' ); 388 $this->assert Empty(bp_xprofile_get_meta( $g, 'group', 'foo' ) );388 $this->assertSame( '', bp_xprofile_get_meta( $g, 'group', 'foo' ) ); 389 389 } 390 390
Note: See TracChangeset
for help on using the changeset viewer.