[wp-trac] [WordPress Trac] #43826: get_post_galleries() should return gallery blocks

WordPress Trac noreply at wordpress.org
Tue Nov 6 16:41:18 UTC 2018


#43826: get_post_galleries() should return gallery blocks
----------------------------------------------------+---------------------
 Reporter:  pento                                   |       Owner:  (none)
     Type:  enhancement                             |      Status:  new
 Priority:  normal                                  |   Milestone:  5.0
Component:  Media                                   |     Version:
 Severity:  normal                                  |  Resolution:
 Keywords:  has-patch has-unit-tests needs-testing  |     Focuses:
----------------------------------------------------+---------------------

Comment (by birgire):

 Thanks for the patch and tests in [attachment:"43826.2.diff"]

 Few suggestions for the tests:

 It would be nice to have a test case for a content containing both gallery
 shortcode and a gallery block.

 I also wonder if we need more coverage for the {{{$html = false}}} input
 argument.

 We could add {{{@group blocks}}} to the descriptions of the test methods:
  - {{{test_block_inner_post_gallery_images()}}}
  - {{{test_block_post_gallery_images()}}}
  - {{{test_block_post_galleries()}}}.

 It seems we can reduce some code by combining the two foreach loops with
 range 1 to 3 and 4 to 6 into a single foreach loop with range 1 to 6.
 (same for the older test cases).

 But it seems benificial to move all the tests for
 {{{get_post_galleries()}}} under it's own test class, e.g.
 {{{/tests/phpunit/tests/media/getPostGalleries.php}}}.

 Then we could share the fixtures to avoid duplication.

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


More information about the wp-trac mailing list