Changeset 10293
- Timestamp:
- 10/21/2015 04:41:38 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/core/avatars.php
r10260 r10293 82 82 // First, run the check with custom parameters, specifying no gravatar. 83 83 $this->params = array( 84 'item_id' => 1406, 85 'object' => 'custom_object', 86 'type' => 'full', 87 'avatar_dir' => 'custom-dir', 88 'width' => 48, 89 'height' => 54, 90 'class' => 'custom-class', 91 'css_id' => 'custom-css-id', 92 'alt' => 'custom alt', 93 'email' => 'avatar@avatar.org', 94 'no_grav' => true, 95 'html' => true, 96 'title' => 'custom-title', 84 'item_id' => 1406, 85 'object' => 'custom_object', 86 'type' => 'full', 87 'avatar_dir' => 'custom-dir', 88 'width' => 48, 89 'height' => 54, 90 'class' => 'custom-class', 91 'css_id' => 'custom-css-id', 92 'alt' => 'custom alt', 93 'email' => 'avatar@avatar.org', 94 'no_grav' => true, 95 'html' => true, 96 'title' => 'custom-title', 97 'extra_attr' => 'data-testing="buddypress"', 98 'scheme' => 'http', 99 'rating' => get_option( 'avatar_rating' ), 100 'force_default' => false, 97 101 ); 98 102 … … 132 136 } 133 137 134 $avatar_url = $host . md5( strtolower( $this->params['email'] ) ) . '?d=' . $default_grav . '& amp;s=' . $this->params['width'];138 $avatar_url = $host . md5( strtolower( $this->params['email'] ) ) . '?d=' . $default_grav . '&s=' . $this->params['width']; 135 139 136 140 // Gravatar rating; http://bit.ly/89QxZA 137 $rating = get_option( 'avatar_rating');141 $rating = strtolower( get_option( 'avatar_rating' ) ); 138 142 if ( ! empty( $rating ) ) { 139 $avatar_url .= "& amp;r={$rating}";143 $avatar_url .= "&r={$rating}"; 140 144 } 141 145 } 142 146 143 $expected_html = '<img src="' . $avatar_url . '" id="' . $this->params['css_id'] . '" class="' . $this->params['class'] . ' ' . $this->params['object'] . '-' . $this->params['item_id'] . '-avatar avatar-' . $this->params['width'] . ' photo" width="' . $this->params['width'] . '" height="' . $this->params['height'] . '" alt="' . $this->params['alt'] . '" title="' . $this->params['title'] . '" />';147 $expected_html = '<img src="' . $avatar_url . '" id="' . $this->params['css_id'] . '" class="' . $this->params['class'] . ' ' . $this->params['object'] . '-' . $this->params['item_id'] . '-avatar avatar-' . $this->params['width'] . ' photo" width="' . $this->params['width'] . '" height="' . $this->params['height'] . '" alt="' . $this->params['alt'] . '" title="' . $this->params['title'] . '" ' . $this->params['extra_attr'] . ' />'; 144 148 145 149 $this->assertEquals( $html, $expected_html );
Note: See TracChangeset
for help on using the changeset viewer.