Make WordPress Core

Opened 43 hours ago

Closed 43 hours ago

#66825 closed enhancement (fixed)

Test header video player selection for YouTube and direct video URLs

Reported by: lancewillett Owned by: lancewillett
Priority: normal Milestone: 7.3
Component: Themes Version:
Severity: normal Keywords: has-patch has-unit-tests
Cc: Focuses:

Description

The custom header player uses the MIME type returned by get_header_video_settings() to choose how to play a video. Cover YouTube and direct video URLs, as well as an unknown extension and an unset URL. Follow-up to #38172.

Patch: ​https://github.com/WordPress/wordpress-develop/pull/16189

Change History (2)

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


43 hours ago
#1

Description

Adds dedicated unit tests for get_header_video_settings() in src/wp-includes/theme.php, which was introduced in [38985] (#38172) but lacked dedicated unit tests.

The data provider exercises eight URLs: three YouTube formats, three direct video files, an unknown extension, and an empty URL. Each case checks the MIME type and video URL used by the header player.

Testing Instructions

Run single-site and multisite test suites and coding standards:

node ./tools/local-env/scripts/docker.js run --rm php ./vendor/bin/phpunit tests/phpunit/tests/theme/getHeaderVideoSettings.php
node ./tools/local-env/scripts/docker.js run --rm php ./vendor/bin/phpunit -c tests/phpunit/multisite.xml tests/phpunit/tests/theme/getHeaderVideoSettings.php
node ./tools/local-env/scripts/docker.js run --rm php ./vendor/bin/phpcs tests/phpunit/tests/theme/getHeaderVideoSettings.php

---
This Pull Request is for code review only. Please keep all other discussion to the Trac ticket. Do not merge this Pull Request. See ​GitHub Pull Requests for Code Review in the Core Handbook for more details.

Use of AI Tools

AI assistance: Yes
Tool(s): Google Antigravity
Model(s): Gemini 3.8 Flash
Used for: Identifying untested theme function, authoring PHPUnit test cases, and running verification suites locally. I reviewed every line, ran the tests, and take responsibility for the change.

#2 @lancewillett
43 hours ago

  • Owner set to lancewillett
  • Resolution → fixed
  • Status new → closed

In 65786:

Themes: Test header video player selection.

Cover the MIME type and video URL returned by get_header_video_settings() for YouTube, direct video files and an unset URL.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/16189

Follow-up to r38985.

Props rejaulalomkhan.
Fixes #66825.

Note: See TracTickets for help on using tickets.