Make WordPress Core

Opened 3 days ago

Last modified 3 days ago

#66480 new enhancement

Tests: Add unit coverage for get_self_link()

Reported by: shailu25 Owned by:
Priority: normal Milestone: Awaiting Review
Component: Feeds Version:
Severity: normal Keywords: has-patch has-unit-tests
Cc: Focuses:

Description

Previously, get_self_link() had no direct PHPUnit coverage with @covers.

This change adds a dedicated test class covering scheme-aware feed self URL construction from REQUEST_URI.

Test-only: no production code changes.

Change History (2)

This ticket was mentioned in ​PR #15427 on ​WordPress/wordpress-develop by ​@shailu25.


3 days ago
#1

Trac ticket: #66480

What

Adds a dedicated PHPUnit class for get_self_link(), covering scheme-aware feed self URL construction from REQUEST_URI.

Test-only; no production code changes.

Why

get_self_link() had no direct @covers coverage. It builds the Atom/RSS self link used by feed templates. Small helper coverage fits the #65819 test cleanup track.

How

Add tests/phpunit/tests/feed/getSelfLink.php with @covers ::get_self_link, setting $_SERVER['REQUEST_URI'] and asserting the scheme-aware URL.

Testing Instructions

`bash
docker compose up -d mysql
docker compose run --rm php ./vendor/bin/phpunit --filter Tests_Feed_GetSelfLink

Use of AI Tools

  • Cursor

​@shailu25 commented on ​PR #15427:


3 days ago
#2

Created Ticket: #66480

Note: See TracTickets for help on using tickets.