From 52e65717f92b0cf5869e08159e2457b76cebbc9e Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 16 Jun 2021 17:30:07 +0000 Subject: [PATCH] Tests: Make some optional parameters required in unit tests for previous/next attachment links. This resolves a "Deprecated: Required parameter follows optional parameter" notice on PHP 8. Follow-up to [48794], [51122]. See #45708, #52625. git-svn-id: https://develop.svn.wordpress.org/trunk@51172 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/media/getAdjacentImageLink.php | 2 +- tests/phpunit/tests/media/getNextImageLink.php | 4 ++-- tests/phpunit/tests/media/getPreviousImageLink.php | 4 ++-- tests/phpunit/tests/media/nextImageLink.php | 4 ++-- tests/phpunit/tests/media/previousImageLink.php | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/phpunit/tests/media/getAdjacentImageLink.php b/tests/phpunit/tests/media/getAdjacentImageLink.php index 3f3d6c3c28..265c5d6bb2 100644 --- a/tests/phpunit/tests/media/getAdjacentImageLink.php +++ b/tests/phpunit/tests/media/getAdjacentImageLink.php @@ -3,7 +3,7 @@ require_once __DIR__ . '/testcase-adjacent-image-link.php'; /** - * @group media + * @group media * @covers ::get_adjacent_image_link */ class Tests_Media_GetAdjacentImageLink extends WP_Test_Adjacent_Image_Link_TestCase { diff --git a/tests/phpunit/tests/media/getNextImageLink.php b/tests/phpunit/tests/media/getNextImageLink.php index 484f13ddf9..feb5fdbdf7 100644 --- a/tests/phpunit/tests/media/getNextImageLink.php +++ b/tests/phpunit/tests/media/getNextImageLink.php @@ -3,7 +3,7 @@ require_once __DIR__ . '/testcase-adjacent-image-link.php'; /** - * @group media + * @group media * @covers ::get_next_image_link */ class Tests_Media_GetNextImageLink extends WP_Test_Adjacent_Image_Link_TestCase { @@ -17,7 +17,7 @@ class Tests_Media_GetNextImageLink extends WP_Test_Adjacent_Image_Link_TestCase * * @dataProvider data_get_next_image_link */ - function test_get_next_image_link( $current_attachment_index, $expected_attachment_index = 0, $expected, array $args = array() ) { + function test_get_next_image_link( $current_attachment_index, $expected_attachment_index, $expected, array $args = array() ) { list( $expected, $args ) = $this->setup_test_scenario( $current_attachment_index, $expected_attachment_index, $expected, $args ); $actual = get_next_image_link( ...$args ); diff --git a/tests/phpunit/tests/media/getPreviousImageLink.php b/tests/phpunit/tests/media/getPreviousImageLink.php index 9c98c883cc..61763ee3a2 100644 --- a/tests/phpunit/tests/media/getPreviousImageLink.php +++ b/tests/phpunit/tests/media/getPreviousImageLink.php @@ -3,7 +3,7 @@ require_once __DIR__ . '/testcase-adjacent-image-link.php'; /** - * @group media + * @group media * @covers ::get_previous_image_link */ class Tests_Media_GetPreviousImageLink extends WP_Test_Adjacent_Image_Link_TestCase { @@ -17,7 +17,7 @@ class Tests_Media_GetPreviousImageLink extends WP_Test_Adjacent_Image_Link_TestC * * @dataProvider data_get_previous_image_link */ - function test_get_previous_image_link( $current_attachment_index, $expected_attachment_index = 0, $expected, array $args = array() ) { + function test_get_previous_image_link( $current_attachment_index, $expected_attachment_index, $expected, array $args = array() ) { list( $expected, $args ) = $this->setup_test_scenario( $current_attachment_index, $expected_attachment_index, $expected, $args ); $actual = get_previous_image_link( ...$args ); diff --git a/tests/phpunit/tests/media/nextImageLink.php b/tests/phpunit/tests/media/nextImageLink.php index fc4527f49e..f3ba340b7f 100644 --- a/tests/phpunit/tests/media/nextImageLink.php +++ b/tests/phpunit/tests/media/nextImageLink.php @@ -3,7 +3,7 @@ require_once __DIR__ . '/testcase-adjacent-image-link.php'; /** - * @group media + * @group media * @covers ::next_image_link */ class Tests_Media_NextImageLink extends WP_Test_Adjacent_Image_Link_TestCase { @@ -17,7 +17,7 @@ class Tests_Media_NextImageLink extends WP_Test_Adjacent_Image_Link_TestCase { * * @dataProvider data_next_image_link */ - function test_next_image_link( $current_attachment_index, $expected_attachment_index = 0, $expected, array $args = array() ) { + function test_next_image_link( $current_attachment_index, $expected_attachment_index, $expected, array $args = array() ) { list( $expected, $args ) = $this->setup_test_scenario( $current_attachment_index, $expected_attachment_index, $expected, $args ); $this->expectOutputString( $expected ); diff --git a/tests/phpunit/tests/media/previousImageLink.php b/tests/phpunit/tests/media/previousImageLink.php index 7cdb24e0bf..769d029d89 100644 --- a/tests/phpunit/tests/media/previousImageLink.php +++ b/tests/phpunit/tests/media/previousImageLink.php @@ -3,7 +3,7 @@ require_once __DIR__ . '/testcase-adjacent-image-link.php'; /** - * @group media + * @group media * @covers ::previous_image_link */ class Tests_Media_PreviousImageLink extends WP_Test_Adjacent_Image_Link_TestCase { @@ -17,7 +17,7 @@ class Tests_Media_PreviousImageLink extends WP_Test_Adjacent_Image_Link_TestCase * * @dataProvider data_previous_image_link */ - function test_previous_image_link( $current_attachment_index, $expected_attachment_index = 0, $expected, array $args = array() ) { + function test_previous_image_link( $current_attachment_index, $expected_attachment_index, $expected, array $args = array() ) { list( $expected, $args ) = $this->setup_test_scenario( $current_attachment_index, $expected_attachment_index, $expected, $args ); $this->expectOutputString( $expected );