Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/21/2015 04:41:38 PM (11 years ago)
Author:
djpaul
Message:

Tests: fix fetch avatar tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/core/avatars.php

    r10260 r10293  
    8282                // First, run the check with custom parameters, specifying no gravatar.
    8383                $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,
    97101                );
    98102
     
    132136                        }
    133137
    134                         $avatar_url = $host . md5( strtolower( $this->params['email'] ) ) . '?d=' . $default_grav . '&s=' . $this->params['width'];
     138                        $avatar_url = $host . md5( strtolower( $this->params['email'] ) ) . '?d=' . $default_grav . '&s=' . $this->params['width'];
    135139
    136140                        // Gravatar rating; http://bit.ly/89QxZA
    137                         $rating = get_option( 'avatar_rating' );
     141                        $rating = strtolower( get_option( 'avatar_rating' ) );
    138142                        if ( ! empty( $rating ) ) {
    139                                 $avatar_url .= "&r={$rating}";
     143                                $avatar_url .= "&r={$rating}";
    140144                        }
    141145                }
    142146
    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'] . ' />';
    144148
    145149                $this->assertEquals( $html, $expected_html );
Note: See TracChangeset for help on using the changeset viewer.