Make WordPress Core

Ticket #56791: 56791-fix-a-non-snake_case-function-name.patch

File 56791-fix-a-non-snake_case-function-name.patch, 1.4 KB (added by jrf, 23 months ago)

Note: if I'm honest, this whole function declaration should be changed as it is now declared as a function in the global namespace, while only intended for one test, but that's outside the scope of this patch.

  • tests/phpunit/tests/blocks/wpBlock.php

    From ab8b2bf291be025ca00459eb2b97e5aa230141a7 Mon Sep 17 00:00:00 2001
    From: jrfnl <jrfnl@users.noreply.github.com>
    Date: Sun, 9 Oct 2022 19:58:38 +0200
    Subject: [PATCH] CS: fix a non snake_case function name
    
    Note: if I'm honest, this whole function declaration should be changed as it is now declared as a function in the global namespace, while only intended for one test (yikes!).
    ---
     tests/phpunit/tests/blocks/wpBlock.php | 6 +++---
     1 file changed, 3 insertions(+), 3 deletions(-)
    
    diff --git a/tests/phpunit/tests/blocks/wpBlock.php b/tests/phpunit/tests/blocks/wpBlock.php
    index c67a30df9d..09d0624417 100644
    a b class Tests_Blocks_wpBlock extends WP_UnitTestCase { 
    604604                        ),
    605605                );
    606606                $block         = new WP_Block( $parsed_block, $context, $this->registry );
    607                 function filterQuery( $query, $block, $page ) {
     607                function filter_the_query( $query, $block, $page ) {
    608608                        $query['post_type'] = 'book';
    609609                        return $query;
    610610                }
    611                 add_filter( 'query_loop_block_query_vars', 'filterQuery', 10, 3 );
     611                add_filter( 'query_loop_block_query_vars', 'filter_the_query', 10, 3 );
    612612                $query = build_query_vars_from_query_block( $block, 1 );
    613                 remove_filter( 'query_loop_block_query_vars', 'filterQuery' );
     613                remove_filter( 'query_loop_block_query_vars', 'filter_the_query' );
    614614                $this->assertSame(
    615615                        $query,
    616616                        array(