Ticket #28121: 28121.tests.diff
| File 28121.tests.diff, 2.3 KB (added by , 12 years ago) |
|---|
-
tests/phpunit/includes/testcase.php
160 160 $this->assertEquals( array(), array_diff( $actual, $expected ) ); 161 161 } 162 162 163 /** 164 * Asserts that the given variable is a multidimensional array, and that all arrays are non-empty. 165 * 166 * @param array $array 167 */ 168 function assertNonEmptyMultidimensionalArray( $array ) { 169 $this->assertTrue( is_array( $array ) ); 170 $this->assertNotEmpty( $array ); 171 172 foreach( $array as $sub_array ) { 173 $this->assertTrue( is_array( $sub_array ) ); 174 $this->assertNotEmpty( $sub_array ); 175 } 176 } 177 163 178 function go_to( $url ) { 164 179 // note: the WP and WP_Query classes like to silently fetch parameters 165 180 // from all over the place (globals, GET, etc), which makes it tricky -
tests/phpunit/tests/admin/includesTheme.php
65 65 $this->assertEquals( "subdir/template-sub-dir.php", $templates['Sub Dir'] ); 66 66 $this->assertEquals( "template-header.php", $templates['This Template Header Is On One Line'] ); 67 67 } 68 69 /** 70 * Test that The list of theme features pulled from the WordPress.org API returns the expected data structure. 71 * 72 * Differences in the structure can also trigger failure by causing PHP notices/warnings. 73 * 74 * @ticket 28121 75 */ 76 function test_get_theme_featured_list_api() { 77 wp_set_current_user( $this->factory->user->create( array( 'role' => 'administrator' ) ) ); 78 $featured_list_api = get_theme_feature_list( true ); 79 $this->assertNonEmptyMultidimensionalArray( $featured_list_api ); 80 } 81 82 /** 83 * Test that The list of theme features hardcoded into Core returns the expected data structure 84 * 85 * Differences in the structure can also trigger failure by causing PHP notices/warnings. 86 * 87 * @ticket 28121 88 */ 89 function test_get_theme_featured_list_hardcoded() { 90 $featured_list_hardcoded = get_theme_feature_list( false ); 91 $this->assertNonEmptyMultidimensionalArray( $featured_list_hardcoded ); 92 } 68 93 }