fix: preserve CHRNX incomplete podcast routing
This commit is contained in:
5 files changed
+47
-9
No files matched your search
@@ -251,6 +251,22 @@ class EditorialQueriesTest extends WP_UnitTestCase {
|
||||
$this->assertArrayNotHasKey( 'tax_query', chrnx_get_journal_query_args( $unsupported ) );
|
||||
}
|
||||
|
||||
/** Show archives constrain Journal results to actual show membership. */
|
||||
public function test_show_archive_context_excludes_podcasts_without_show_membership() {
|
||||
$member = $this->create_post( 'Show member', '2026-02-02 10:00:00', 'podcasts' );
|
||||
$loose = $this->create_post( 'Podcast without show', '2026-02-03 10:00:00', 'podcasts' );
|
||||
wp_set_object_terms( $member, 'silicon-ranch', 'chrnx_show' );
|
||||
$term = get_term_by( 'slug', 'silicon-ranch', 'chrnx_show' );
|
||||
$this->go_to( get_term_link( $term ) );
|
||||
|
||||
$context = chrnx_get_journal_request_context( array() );
|
||||
$this->assertSame( 'silicon-ranch', $context['chrnx_show'] );
|
||||
$ids = array_map( 'absint', wp_list_pluck( chrnx_run_eligible_query( chrnx_get_journal_query_args( $context ) )->posts, 'ID' ) );
|
||||
$this->assertContains( $member, $ids );
|
||||
$this->assertNotContains( $loose, $ids );
|
||||
$this->go_to( '/' );
|
||||
}
|
||||
|
||||
/** Malformed journal request values are ignored and never copied into query args. */
|
||||
public function test_journal_query_ignores_malformed_filters_and_caps_search() {
|
||||
$args = chrnx_get_journal_query_args(
|
||||
|
||||
Reference in new issue
Block a user