Changeset 12507 for trunk/tests/phpunit/testcases/core/avatars.php
- Timestamp:
- 12/23/2019 07:56:32 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/core/avatars.php
r12246 r12507 371 371 return 51; 372 372 } 373 374 /** 375 * @group bp_core_delete_existing_avatar 376 */ 377 public function test_bp_core_delete_existing_avatar() { 378 $avatar_dir1 = bp_core_avatar_upload_path() . '/avatars/1'; 379 $avatar_dir2 = bp_core_avatar_upload_path() . '/avatars/2'; 380 wp_mkdir_p( $avatar_dir1 ); 381 wp_mkdir_p( $avatar_dir2 ); 382 383 copy( BP_TESTS_DIR . 'assets/upside-down.jpg', $avatar_dir1 . '/avatar-bpfull.jpg' ); 384 copy( BP_TESTS_DIR . 'assets/upside-down.jpg', $avatar_dir1 . '/avatar-bpthumb.jpg' ); 385 copy( BP_TESTS_DIR . 'assets/upside-down.jpg', $avatar_dir2 . '/avatar-bpfull.jpg' ); 386 copy( BP_TESTS_DIR . 'assets/upside-down.jpg', $avatar_dir2 . '/avatar-bpthumb.jpg' ); 387 388 $test = bp_core_delete_existing_avatar( array( 389 'item_id' => '2/../1', 390 'object' => 'user', 391 'avatar_dir' => false 392 ) ); 393 394 $this->assertTrue( is_dir( $avatar_dir1 ) ); 395 396 $test2 = bp_core_delete_existing_avatar( array( 397 'item_id' => '2', 398 'object' => 'user', 399 'avatar_dir' => false 400 ) ); 401 402 $this->assertFalse( is_dir( $avatar_dir2 ) ); 403 404 $test1 = bp_core_delete_existing_avatar( array( 405 'item_id' => 1.1, 406 'object' => 'user', 407 'avatar_dir' => false 408 ) ); 409 410 $this->assertTrue( is_dir( $avatar_dir1 ) ); 411 412 $test1 = bp_core_delete_existing_avatar( array( 413 'item_id' => 1, 414 'object' => 'user', 415 'avatar_dir' => false 416 ) ); 417 418 $this->assertFalse( is_dir( $avatar_dir1 ) ); 419 } 373 420 }
Note: See TracChangeset
for help on using the changeset viewer.