Make WordPress Core

Changeset 36914


Ignore:
Timestamp:
03/09/2016 11:27:28 PM (10 years ago)
Author:
obenland
Message:

Tests: Let's not reinvent wp_get_attachment_image().

See https://travis-ci.org/aaronjorbin/develop.wordpress/builds/114913862
See #36086.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/general/template.php

    r36911 r36914  
    245245
    246246                $this->_set_custom_logo();
    247                 $size     = get_theme_support( 'custom-logo', 'size' );
    248                 $expected = sprintf( '<a href="http://example.org/" class="custom-logo-link" rel="home" itemprop="url"><img width="50" height="50" src="%1$s" class="custom-logo attachment-%2$s" alt="%3$s" data-size="%2$s" itemprop="logo" /></a>', $this->custom_logo_url, $size, basename( $this->custom_logo_url ) );
    249 
    250                 $this->expectOutputString( $expected );
     247                $size  = get_theme_support( 'custom-logo', 'size' );
     248                $image = wp_get_attachment_image( $this->custom_logo_id, $size, false, array(
     249                        'class'     => "custom-logo attachment-$size",
     250                        'data-size' => $size,
     251                        'itemprop'  => 'logo',
     252                ) );
     253
     254                $this->expectOutputString( '<a href="http://example.org/" class="custom-logo-link" rel="home" itemprop="url">' . $image . '</a>' );
    251255                the_custom_logo();
    252256        }
Note: See TracChangeset for help on using the changeset viewer.