Make WordPress Core


Ignore:
Timestamp:
12/10/2017 12:30:32 AM (9 years ago)
Author:
johnbillion
Message:

Build/Test tools: Switch to PHPUnit's expectOutputString() method instead of manually using output buffers for output assertions.

Props birgire
Fixes #42098

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/functions/getArchives.php

    r42343 r42382  
    128128
    129129        function test_wp_get_archives_echo() {
    130                 $expected['echo'] = "<li><a href='" . $this->month_url . "'>" . date( 'F Y' ) . '</a></li>';
    131                 ob_start();
     130                $expected['echo'] = "\t<li><a href='" . $this->month_url . "'>" . date( 'F Y' ) . '</a></li>' . "\n";
     131                $this->expectOutputString( $expected['echo'] );
    132132                wp_get_archives( array( 'echo' => true ) );
    133                 $actual = ob_get_clean();
    134                 $this->assertEquals( $expected['echo'], trim( $actual ) );
    135133        }
    136134
Note: See TracChangeset for help on using the changeset viewer.