Changeset 7798
- Timestamp:
- 10/04/2026 09:11:46 AM (5 weeks ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/testcases/admin/tools.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/admin/tools.php
r7797 r7798 18 18 bbp_set_user_role( $this->keymaster_id, bbp_get_keymaster_role() ); 19 19 20 if ( ! function_exists( 'bbp_admin' ) ) { 21 require_once BBP_PLUGIN_DIR . 'includes/admin/actions.php'; 22 } 23 bbp_admin(); 24 20 25 if ( ! function_exists( 'bbp_admin_repair_page' ) ) { 21 26 require_once BBP_PLUGIN_DIR . 'includes/admin/tools/repair.php'; 22 27 require_once BBP_PLUGIN_DIR . 'includes/admin/tools/upgrade.php'; 28 } 29 if ( ! function_exists( 'bbp_admin_reset_page' ) ) { 30 require_once BBP_PLUGIN_DIR . 'includes/admin/tools/reset.php'; 23 31 } 24 32 } … … 1129 1137 1130 1138 /** 1131 * @covers ::bbp_admin_reset 1132 * @todo Implement test_bbp_admin_reset(). 1133 */ 1134 public function test_bbp_admin_reset() { 1135 // Remove the following lines when you implement this test. 1136 $this->markTestIncomplete( 1137 'This test has not been implemented yet.' 1138 ); 1139 * @covers ::bbp_admin_reset_page 1140 */ 1141 public function test_bbp_admin_reset_page() { 1142 ob_start(); 1143 bbp_admin_reset_page(); 1144 $output = ob_get_clean(); 1145 1146 $this->assertStringContainsString( 'name="bbpress-are-you-sure"', $output ); 1147 $this->assertStringContainsString( 'name="_wpnonce"', $output ); 1148 $this->assertStringContainsString( 'Reset bbPress', $output ); 1139 1149 } 1140 1150 1141 1151 /** 1142 1152 * @covers ::bbp_admin_reset_handler 1143 * @todo Implement test_bbp_admin_reset_handler().1144 1153 */ 1145 1154 public function test_bbp_admin_reset_handler() { 1146 // Remove the following lines when you implement this test. 1147 $this->markTestIncomplete( 1148 'This test has not been implemented yet.' 1149 ); 1155 $old_method = isset( $_SERVER['REQUEST_METHOD'] ) ? $_SERVER['REQUEST_METHOD'] : null; 1156 $old_post = $_POST; 1157 1158 try { 1159 $_SERVER['REQUEST_METHOD'] = 'GET'; 1160 $_POST = array( 'bbpress-are-you-sure' => '1' ); 1161 $this->assertNull( bbp_admin_reset_handler() ); 1162 $_SERVER['REQUEST_METHOD'] = 'POST'; 1163 $_POST = array(); 1164 $this->assertNull( bbp_admin_reset_handler() ); 1165 } finally { 1166 $_POST = $old_post; 1167 if ( null === $old_method ) { 1168 unset( $_SERVER['REQUEST_METHOD'] ); 1169 } else { 1170 $_SERVER['REQUEST_METHOD'] = $old_method; 1171 } 1172 } 1150 1173 } 1151 1174 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)