Make WordPress Core

Changeset 39914


Ignore:
Timestamp:
01/16/2017 05:56:34 PM (8 years ago)
Author:
azaozz
Message:

Tests: wpautop() should not add extra </p> before <figcaption>.

Props pbearne.
See #39307.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/formatting/Autop.php

    r38592 r39914  
    535535        $this->assertEquals( $expected, trim( wpautop( $content ) ) );
    536536    }
     537
     538    /**
     539     * wpautop() should not add extra </p> before <figcaption>
     540     *
     541     * @covers ::wpautop
     542     * @uses trim
     543     *
     544     * @ticket 39307
     545     */
     546    function test_that_wpautop_doses_not_add_extra_closing_p_in_figure() {
     547        $content1 = $expected1 = '<figure><img src="example.jpg" /><figcaption>Caption</figcaption></figure>';
     548
     549        $content2 = '<figure>
     550<img src="example.jpg" />
     551<figcaption>Caption</figcaption>
     552</figure>';
     553
     554        $expected2 = '<figure>
     555<img src="example.jpg" /><figcaption>Caption</figcaption></figure>';
     556
     557        $this->assertEquals( $expected1, trim( wpautop( $content1 ) ) );
     558        $this->assertEquals( $expected2, trim( wpautop( $content2 ) ) );
     559    }
     560
    537561}
Note: See TracChangeset for help on using the changeset viewer.