Changeset 10754 for trunk/tests/phpunit/testcases/core/avatars.php
- Timestamp:
- 05/14/2016 04:48:29 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/core/avatars.php
r10370 r10754 315 315 return $types; 316 316 } 317 318 /** 319 * @group BP7056 320 */ 321 public function test_no_grav_default_should_respect_thumb_type() { 322 $found = bp_core_fetch_avatar( array( 323 'item_id' => 12345, 324 'object' => 'user', 325 'type' => 'thumb', 326 'no_grav' => true, 327 'html' => false, 328 ) ); 329 330 $this->assertContains( 'mystery-man-50.jpg', $found ); 331 } 332 333 /** 334 * @group BP7056 335 */ 336 public function test_no_grav_default_should_return_thumb_avatar_for_small_enough_width() { 337 $found = bp_core_fetch_avatar( array( 338 'item_id' => 12345, 339 'object' => 'user', 340 'type' => 'full', 341 'width' => '50', 342 'no_grav' => true, 343 'html' => false, 344 ) ); 345 346 $this->assertContains( 'mystery-man-50.jpg', $found ); 347 } 348 349 /** 350 * @group BP7056 351 */ 352 public function test_no_grav_default_should_return_full_avatar_for_thumb_when_thumb_width_is_too_wide() { 353 add_filter( 'bp_core_avatar_thumb_width', array( $this, 'filter_thumb_width' ) ); 354 $found = bp_core_fetch_avatar( array( 355 'item_id' => 12345, 356 'object' => 'user', 357 'type' => 'thumb', 358 'no_grav' => true, 359 'html' => false, 360 ) ); 361 remove_filter( 'bp_core_avatar_thumb_width', array( $this, 'filter_thumb_width' ) ); 362 363 $this->assertContains( 'mystery-man.jpg', $found ); 364 } 365 366 public function filter_thumb_width() { 367 return 51; 368 } 317 369 }
Note: See TracChangeset
for help on using the changeset viewer.