From b949c646db3f66765805d1bec76f4bf924416c1d Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 19 Jun 2022 15:43:34 +0000 Subject: [PATCH] Tests: Rename some test methods in `Tests_Image_Functions` for consistency. This matches the names of the functions being tested: * `file_is_valid_image()` * `file_is_displayable_image()` Follow-up to [184/tests], [53523], [53524], [53525], [53526]. See #55652. git-svn-id: https://develop.svn.wordpress.org/trunk@53527 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/image/functions.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/phpunit/tests/image/functions.php b/tests/phpunit/tests/image/functions.php index 8c94e8baca..69197ecb55 100644 --- a/tests/phpunit/tests/image/functions.php +++ b/tests/phpunit/tests/image/functions.php @@ -64,14 +64,14 @@ class Tests_Image_Functions extends WP_UnitTestCase { } /** - * @dataProvider data_is_image_positive + * @dataProvider data_file_is_valid_image_positive * * @covers ::file_is_valid_image * @covers ::wp_getimagesize * * @param string $file File name. */ - public function test_is_image_positive( $file ) { + public function test_file_is_valid_image_positive( $file ) { $this->assertTrue( file_is_valid_image( DIR_TESTDATA . '/images/' . $file ), "file_is_valid_image( '$file' ) should return true" @@ -83,7 +83,7 @@ class Tests_Image_Functions extends WP_UnitTestCase { * * @return array */ - public function data_is_image_positive() { + public function data_file_is_valid_image_positive() { // These are all image files recognized by PHP. $files = array( 'test-image-cmyk.jpg', @@ -108,14 +108,14 @@ class Tests_Image_Functions extends WP_UnitTestCase { } /** - * @dataProvider data_is_image_negative + * @dataProvider data_file_is_valid_image_negative * * @covers ::file_is_valid_image * @covers ::wp_getimagesize * * @param string $file File name. */ - public function test_is_image_negative( $file ) { + public function test_file_is_valid_image_negative( $file ) { $this->assertFalse( file_is_valid_image( DIR_TESTDATA . '/images/' . $file ), "file_is_valid_image( '$file' ) should return false" @@ -127,7 +127,7 @@ class Tests_Image_Functions extends WP_UnitTestCase { * * @return array */ - public function data_is_image_negative() { + public function data_file_is_valid_image_negative() { // These are actually image files but aren't recognized or usable by PHP. $files = array( 'test-image.pct', @@ -139,13 +139,13 @@ class Tests_Image_Functions extends WP_UnitTestCase { } /** - * @dataProvider data_is_displayable_image_positive + * @dataProvider data_file_is_displayable_image_positive * * @covers ::file_is_displayable_image * * @param string $file File name. */ - public function test_is_displayable_image_positive( $file ) { + public function test_file_is_displayable_image_positive( $file ) { $this->assertTrue( file_is_displayable_image( DIR_TESTDATA . '/images/' . $file ), "file_is_displayable_image( '$file' ) should return true" @@ -157,7 +157,7 @@ class Tests_Image_Functions extends WP_UnitTestCase { * * @return array */ - public function data_is_displayable_image_positive() { + public function data_file_is_displayable_image_positive() { // These are all usable in typical web browsers. $files = array( 'test-image.gif', @@ -181,13 +181,13 @@ class Tests_Image_Functions extends WP_UnitTestCase { } /** - * @dataProvider data_is_displayable_image_negative + * @dataProvider data_file_is_displayable_image_negative * * @covers ::file_is_displayable_image * * @param string $file File name. */ - public function test_is_displayable_image_negative( $file ) { + public function test_file_is_displayable_image_negative( $file ) { $this->assertFalse( file_is_displayable_image( DIR_TESTDATA . '/images/' . $file ), "file_is_displayable_image( '$file' ) should return false" @@ -199,7 +199,7 @@ class Tests_Image_Functions extends WP_UnitTestCase { * * @return array */ - public function data_is_displayable_image_negative() { + public function data_file_is_displayable_image_negative() { // These are image files but aren't suitable for web pages because of compatibility or size issues. $files = array( // 'test-image-cmyk.jpg', Allowed in r9727.