Make WordPress Core


Ignore:
Timestamp:
01/15/2017 06:50:00 AM (8 years ago)
Author:
SergeyBiryukov
Message:

Themes: Add a unit test for get_theme_feature_list() to make sure that the list of theme features pulled from the WordPress.org API returns the expected data structure.

Props iandunn.
Fixes #28121.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/testcase.php

    r39626 r39906  
    438438        ksort( $actual );
    439439        $this->assertEquals( $expected, $actual );
     440    }
     441
     442    /**
     443     * Asserts that the given variable is a multidimensional array, and that all arrays are non-empty.
     444     *
     445     * @param array $array
     446     */
     447    function assertNonEmptyMultidimensionalArray( $array ) {
     448        $this->assertTrue( is_array( $array ) );
     449        $this->assertNotEmpty( $array );
     450
     451        foreach( $array as $sub_array ) {
     452            $this->assertTrue( is_array( $sub_array ) );
     453            $this->assertNotEmpty( $sub_array );
     454        }
    440455    }
    441456
Note: See TracChangeset for help on using the changeset viewer.