Put an assertion in `test_nonexistent_array()` test.

The point of the test is to demonstrate that PHP doesn't throw a notice when
calling `unset()` on an undefined array key. To placate PHPUnit's useless test
detection, we add a redundant assertion.

Introduced in [25240].

See #36016.

git-svn-id: https://develop.svn.wordpress.org/trunk@36779 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Boone Gorges 2016-02-29 20:34:48 +00:00
parent 60b307b941
commit 070b8a6154
1 changed files with 5 additions and 0 deletions

View File

@ -91,13 +91,18 @@ EOF;
$this->assertEquals($expected, mask_input_value($in));
}
/**
* @ticket 17884
*/
function test_setting_nonexistent_arrays() {
$page = 1;
$field = 'settings';
$empty_array[$page][$field] = 'foo';
// Assertion not strictly needed; we mainly want to show that a notice is not thrown.
unset( $empty_array[$page]['bar']['baz'] );
$this->assertFalse( isset( $empty_array[ $page ]['bar']['baz'] ) );
}
function test_magic_getter() {