#49365 closed enhancement (fixed)
Remove Tests_Post_Types::register_post_type()
Reported by: | SergeyBiryukov | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.4 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Build/Test Tools | Keywords: | good-first-bug has-patch |
Focuses: | Cc: |
Description (last modified by )
[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 (2)
Change History (11)
#5
follow-up:
↓ 6
@
5 years ago
I believe the method Tests_Post_Types::register_post_type()
needs to be removed instead of changing only the arguments.
I run the test in my environment after applying the patch and it works well.
This is my first attempt to send a patch here and please let me know if there's anything wrong. Thank you in advance.
#6
in reply to:
↑ 5
;
follow-up:
↓ 9
@
5 years ago
Replying to gh640:
This is my first attempt to send a patch here and please let me know if there's anything wrong. Thank you in advance.
49365.2.diff looks perfect, thank you :)
#7
@
5 years ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 47381:
#9
in reply to:
↑ 6
@
5 years ago
Replying to SergeyBiryukov:
Great! Thank you very much :)
Updated 6 test to make them more uniform with other tests for register_post_type