[wp-trac] [WordPress Trac] #47863: Fix odd, unexpected output from shortcode_parse_attts

WordPress Trac noreply at wordpress.org
Mon Aug 12 13:30:24 UTC 2019


#47863: Fix odd, unexpected output from shortcode_parse_attts
--------------------------------------+-----------------------------
 Reporter:  mauteri                   |       Owner:  SergeyBiryukov
     Type:  defect (bug)              |      Status:  reviewing
 Priority:  normal                    |   Milestone:  5.3
Component:  Shortcodes                |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+-----------------------------

Comment (by mauteri):

 @birgire this doesn't appear to be true from what I can tell...

 {{{
 * Returns empty string if trim( $text ) == ''.
 }}}

 I wrote a test for this and it failed. I then removed my code changes to
 see if I introduced a bug and it still failed.

 This was my dataProvider for the test:

 {{{
 array(
         '\'\'',
         '',
 ),
 }}}

 {{{
 There was 1 failure:

 1) Tests_Shortcode::test_shortcode_parse_atts with data set #0 ('''', '')
 Failed asserting that Array &0 () is identical to ''.

 /srv/www/wordpress-
 trunk/public_html/tests/phpunit/tests/shortcode.php:1054
 }}}

 Possible this was wrong for a while and no one noticed due to lack of
 tests?

 Curious if this is the case, that this function now only returns arrays
 and not strings. I can spend more time and see what kind of coverage we
 have for the function with the tests I've already written.

 Added `47863.1.patch` with most recent updates, though more changes to
 DocBlocks will definitely need to be added.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47863#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list