WordPress.org

Make WordPress Core

Opened 2 weeks ago

Last modified 8 days ago

#49365 new enhancement

Remove Tests_Post_Types::register_post_type()

Reported by: SergeyBiryukov Owned by:
Milestone: 5.5 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: good-first-bug has-patch
Focuses: Cc:

Description (last modified by SergeyBiryukov)

[36768] introduced Tests_Post_Types::register_post_type() as a helper for some tests in tests/phpunit/tests/post/types.php.

This method is only used in 6 tests (out of 36 in the file), is redundant, and causes a bit of confusion as to why some tests use that while others use register_post_type() directly.

Since register_post_type() returns the registered post type object on success,

$args = $this->register_post_type( array( ... ) )

can be replaced with:

$args = register_post_type( $this->post_type, array( ... ) );

Attachments (1)

49365.diff (2.7 KB) - added by varunshanbhag 8 days ago.
Updated 6 test to make them more uniform with other tests for register_post_type

Download all attachments as: .zip

Change History (5)

#1 @SergeyBiryukov
2 weeks ago

  • Description modified (diff)

#2 @SergeyBiryukov
2 weeks ago

  • Description modified (diff)

@varunshanbhag
8 days ago

Updated 6 test to make them more uniform with other tests for register_post_type

#3 @varunshanbhag
8 days ago

  • Keywords has-patch added; needs-patch removed

#4 @SergeyBiryukov
8 days ago

  • Milestone changed from Awaiting Review to 5.5
Note: See TracTickets for help on using tickets.