WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#31389 closed enhancement (fixed)

Test coverage for get_page_template_slug()

Reported by: tyxla Owned by: SergeyBiryukov
Milestone: 4.2 Priority: normal
Severity: normal Version: 4.2
Component: Posts, Post Types Keywords: has-patch
Focuses: Cc:
PR Number:

Description

The get_page_template_slug() function could use some unit tests that cover the possible cases.

Attachments (2)

31389.patch (1.5 KB) - added by tyxla 5 years ago.
Add test coverage for get_page_template_slug()
31389.2.patch (1.5 KB) - added by tyxla 5 years ago.
Proper parameter order usage in assertEquals()

Download all attachments as: .zip

Change History (6)

@tyxla
5 years ago

Add test coverage for get_page_template_slug()

#1 @tyxla
5 years ago

  • Keywords has-patch added

#2 @SergeyBiryukov
5 years ago

  • Component changed from Build/Test Tools to Posts, Post Types
  • Milestone changed from Awaiting Review to 4.2

assertEquals() should list the expected result first:

$this->assertEquals( 'example.php', get_page_template_slug() );

@tyxla
5 years ago

Proper parameter order usage in assertEquals()

#3 @tyxla
5 years ago

Oops. @SergeyBiryukov: thanks for noticing.

Added a patch with proper order of the parameters in assertEquals().

#4 @SergeyBiryukov
5 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 31522:

Add unit tests for get_page_template_slug().

props tyxla.
fixes #31389.

Note: See TracTickets for help on using tickets.