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.

git-svn-id: https://develop.svn.wordpress.org/trunk@39906 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2017-01-15 06:50:00 +00:00
parent 1348f5f3fe
commit 40f076d756
2 changed files with 42 additions and 0 deletions
+15
View File
@@ -439,6 +439,21 @@ class WP_UnitTestCase extends PHPUnit_Framework_TestCase {
$this->assertEquals( $expected, $actual );
}
/**
* Asserts that the given variable is a multidimensional array, and that all arrays are non-empty.
*
* @param array $array
*/
function assertNonEmptyMultidimensionalArray( $array ) {
$this->assertTrue( is_array( $array ) );
$this->assertNotEmpty( $array );
foreach( $array as $sub_array ) {
$this->assertTrue( is_array( $sub_array ) );
$this->assertNotEmpty( $sub_array );
}
}
/**
* Modify WordPress's query internals as if a given URL has been requested.
*