WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (4 years ago)
Author:
pento
Message:

Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/hooks/hasFilter.php

    r42200 r42343  
    99
    1010    public function test_has_filter_with_function() {
    11         $callback = '__return_null';
    12         $hook = new WP_Hook();
    13         $tag = __FUNCTION__;
    14         $priority = rand( 1, 100 );
     11        $callback      = '__return_null';
     12        $hook          = new WP_Hook();
     13        $tag           = __FUNCTION__;
     14        $priority      = rand( 1, 100 );
    1515        $accepted_args = rand( 1, 100 );
    1616
     
    2121
    2222    public function test_has_filter_with_object() {
    23         $a = new MockAction();
    24         $callback = array( $a, 'action' );
    25         $hook = new WP_Hook();
    26         $tag = __FUNCTION__;
    27         $priority = rand( 1, 100 );
     23        $a             = new MockAction();
     24        $callback      = array( $a, 'action' );
     25        $hook          = new WP_Hook();
     26        $tag           = __FUNCTION__;
     27        $priority      = rand( 1, 100 );
    2828        $accepted_args = rand( 1, 100 );
    2929
     
    3434
    3535    public function test_has_filter_with_static_method() {
    36         $callback = array( 'MockAction', 'action' );
    37         $hook = new WP_Hook();
    38         $tag = __FUNCTION__;
    39         $priority = rand( 1, 100 );
     36        $callback      = array( 'MockAction', 'action' );
     37        $hook          = new WP_Hook();
     38        $tag           = __FUNCTION__;
     39        $priority      = rand( 1, 100 );
    4040        $accepted_args = rand( 1, 100 );
    4141
     
    4646
    4747    public function test_has_filter_without_callback() {
    48         $callback = '__return_null';
    49         $hook = new WP_Hook();
    50         $tag = __FUNCTION__;
    51         $priority = rand( 1, 100 );
     48        $callback      = '__return_null';
     49        $hook          = new WP_Hook();
     50        $tag           = __FUNCTION__;
     51        $priority      = rand( 1, 100 );
    5252        $accepted_args = rand( 1, 100 );
    5353
     
    6464    public function test_not_has_filter_with_callback() {
    6565        $callback = '__return_null';
    66         $hook = new WP_Hook();
    67         $tag = __FUNCTION__;
     66        $hook     = new WP_Hook();
     67        $tag      = __FUNCTION__;
    6868
    6969        $this->assertFalse( $hook->has_filter( $tag, $callback ) );
     
    7171
    7272    public function test_has_filter_with_wrong_callback() {
    73         $callback = '__return_null';
    74         $hook = new WP_Hook();
    75         $tag = __FUNCTION__;
    76         $priority = rand( 1, 100 );
     73        $callback      = '__return_null';
     74        $hook          = new WP_Hook();
     75        $tag           = __FUNCTION__;
     76        $priority      = rand( 1, 100 );
    7777        $accepted_args = rand( 1, 100 );
    7878
Note: See TracChangeset for help on using the changeset viewer.