mirror of
git://develop.git.wordpress.org/
synced 2025-01-29 10:38:22 +01:00
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:
parent
60b307b941
commit
070b8a6154
@ -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() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user