Make WordPress Core


Ignore:
Timestamp:
09/04/2013 07:06:13 PM (13 years ago)
Author:
wonderboymusic
Message:

Remove unnecessary checks before setting $wp_settings_* arrays. Adds unit test for setting a nonexistent variable to a multi-dimensional array.

Props scribu.
Fixes #17884.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/basic.php

    r25002 r25240  
    8989                $this->assertEquals($expected, mask_input_value($in));
    9090        }
     91
     92        function test_setting_nonexistent_arrays() {
     93                $page = 1;
     94                $field = 'settings';
     95
     96                error_reporting( -1 );
     97
     98                $empty_array[$page][$field] = 'foo';
     99
     100                unset( $empty_array[$page]['bar']['baz'] );
     101        }
    91102}
Note: See TracChangeset for help on using the changeset viewer.