Skip to content

Commit 6e041af

Browse files
committed
Test with more counts; does the failure count also go closer?
1 parent 07da8ba commit 6e041af

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

tests/phpunit/tests/media/getPostGalleries.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -229,18 +229,14 @@ public function test_returns_no_srcs_with_block_in_post_with_no_attached_images(
229229
* @param $gallery
230230
*/
231231
public function tests_returns_requested_max_number_of_galleries( $gallery ) {
232-
// @todo Why is this necessary?
233-
234-
// add_shortcode( 'gallery', 'gallery_shortcode' );
235-
236232
$post_id = self::factory()->post->create(
237-
array( 'post_content' => str_repeat( "{$gallery}\n", 5 ) )
233+
array( 'post_content' => str_repeat( "{$gallery}\n", 15 ) )
238234
);
239235

240236
// Test negative counts, the zero count, and a max count above the total contained galleries.
241-
foreach ( range( -5, 10 ) as $max_count ) {
237+
foreach ( range( -5, 25 ) as $max_count ) {
242238
$this->assertCount(
243-
max( 0, min( 5, $max_count ) ),
239+
max( 0, min( 15, $max_count ) ),
244240
get_post_galleries( $post_id, false, $max_count ),
245241
'Failed to fetch up to the max requested number of galleries.'
246242
);

0 commit comments

Comments
 (0)