Make WordPress Core

Changeset 36779


Ignore:
Timestamp:
02/29/2016 08:34:48 PM (9 years ago)
Author:
boonebgorges
Message:

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.

File:
1 edited

Legend:

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

    r35244 r36779  
    9292    }
    9393
     94    /**
     95     * @ticket 17884
     96     */
    9497    function test_setting_nonexistent_arrays() {
    9598        $page = 1;
     
    98101        $empty_array[$page][$field] = 'foo';
    99102
     103        // Assertion not strictly needed; we mainly want to show that a notice is not thrown.
    100104        unset( $empty_array[$page]['bar']['baz'] );
     105        $this->assertFalse( isset( $empty_array[ $page ]['bar']['baz'] ) );
    101106    }
    102107
Note: See TracChangeset for help on using the changeset viewer.