Make WordPress Core

Ticket #18776: 18776.unit-test.diff

File 18776.unit-test.diff, 591 bytes (added by MikeHansenMe, 10 years ago)

Unit tests using example provided

  • tests/phpunit/tests/shortcode.php

     
    407407                $this->assertTrue( has_shortcode( $content_nested, 'gallery' ) );
    408408                remove_shortcode( 'foo' );
    409409        }
     410
     411        /**
     412         * @ticket 18776
     413         */
     414        function test_shortcode_balance_tags() {
     415                $input = "something [shortcode]<b>[/shortcode]";
     416                $expected = "something [shortcode]<b>[/shortcode]";
     417                $this->assertEquals( $expected, balanceTags( $input ) );
     418        }
    410419}