Changeset 35311
- Timestamp:
- 10/21/2015 03:17:36 AM (9 years ago)
- Location:
- trunk/tests/phpunit
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/testcase-ajax.php
r35242 r35311 27 27 * @var type 28 28 */ 29 protected $_core_actions_get = array( 'fetch-list', 'ajax-tag-search', 'wp-compression-test', 'imgedit-preview', 'oembed_cache' ); 29 protected static $_core_actions_get = array( 30 'fetch-list', 'ajax-tag-search', 'wp-compression-test', 'imgedit-preview', 'oembed-cache', 31 'autocomplete-user', 'dashboard-widgets', 'logged-in', 32 ); 30 33 31 34 /** … … 39 42 * @var type 40 43 */ 41 protected $_core_actions_post = array(44 protected static $_core_actions_post = array( 42 45 'oembed_cache', 'image-editor', 'delete-comment', 'delete-tag', 'delete-link', 43 46 'delete-meta', 'delete-post', 'trash-post', 'untrash-post', 'delete-page', 'dim-comment', … … 48 51 'sample-permalink', 'inline-save', 'inline-save-tax', 'find_posts', 'widgets-order', 49 52 'save-widget', 'set-post-thumbnail', 'date_format', 'time_format', 'wp-fullscreen-save-post', 50 'wp-remove-post-lock', 'dismiss-wp-pointer', 'heartbeat', 'nopriv_heartbeat', 53 'wp-remove-post-lock', 'dismiss-wp-pointer', 'heartbeat', 'nopriv_heartbeat', 'get-revision-diffs', 54 'save-user-color-scheme', 'update-widget', 'query-themes', 'parse-embed', 'set-attachment-thumbnail', 55 'parse-media-shortcode', 'destroy-sessions', 'install-plugin', 'update-plugin', 'press-this-save-post', 56 'press-this-add-category', 'crop-image', 'generate-password', 51 57 ); 58 59 public static function setUpBeforeClass() { 60 if ( ! defined( 'DOING_AJAX' ) ) { 61 define( 'DOING_AJAX', true ); 62 } 63 64 remove_action( 'admin_init', '_maybe_update_core' ); 65 remove_action( 'admin_init', '_maybe_update_plugins' ); 66 remove_action( 'admin_init', '_maybe_update_themes' ); 67 68 // Register the core actions 69 foreach ( array_merge( self::$_core_actions_get, self::$_core_actions_post ) as $action ) { 70 if ( function_exists( 'wp_ajax_' . str_replace( '-', '_', $action ) ) ) { 71 add_action( 'wp_ajax_' . $action, 'wp_ajax_' . str_replace( '-', '_', $action ), 1 ); 72 } 73 } 74 75 parent::setUpBeforeClass(); 76 } 52 77 53 78 /** … … 58 83 parent::setUp(); 59 84 60 // Register the core actions61 foreach ( array_merge( $this->_core_actions_get, $this->_core_actions_post ) as $action )62 if ( function_exists( 'wp_ajax_' . str_replace( '-', '_', $action ) ) )63 add_action( 'wp_ajax_' . $action, 'wp_ajax_' . str_replace( '-', '_', $action ), 1 );64 65 85 add_filter( 'wp_die_ajax_handler', array( $this, 'getDieHandler' ), 1, 1 ); 66 if ( !defined( 'DOING_AJAX' ) ) 67 define( 'DOING_AJAX', true ); 86 68 87 set_current_screen( 'ajax' ); 69 88 -
trunk/tests/phpunit/tests/ajax/Autosave.php
r35244 r35311 22 22 protected $_post = null; 23 23 24 /** 25 * user_id 26 * @var int 27 */ 28 protected $user_id = 0; 24 protected static $admin_id = 0; 25 protected static $editor_id = 0; 26 protected static $post; 27 protected static $post_id; 28 protected static $user_ids = array(); 29 30 public static function wpSetUpBeforeClass( $factory ) { 31 self::$user_ids[] = self::$admin_id = $factory->user->create( array( 'role' => 'administrator' ) ); 32 self::$user_ids[] = self::$editor_id = $factory->user->create( array( 'role' => 'editor' ) ); 33 34 self::$post_id = $factory->post->create( array( 'post_status' => 'draft' ) ); 35 self::$post = get_post( self::$post_id ); 36 } 37 38 public static function wpTearDownAfterClass() { 39 foreach ( self::$user_ids as $user_id ) { 40 self::delete_user( $user_id ); 41 } 42 43 wp_delete_post( self::$post_id, true ); 44 } 29 45 30 46 /** … … 34 50 parent::setUp(); 35 51 // Set a user so the $post has 'post_author' 36 $this->user_id = self::factory()->user->create( array( 'role' => 'administrator' ) ); 37 wp_set_current_user( $this->user_id ); 38 39 $post_id = self::factory()->post->create( array( 'post_status' => 'draft' ) ); 40 $this->_post = get_post( $post_id ); 52 wp_set_current_user( self::$admin_id ); 41 53 } 42 54 … … 47 59 public function test_autosave_post() { 48 60 // The original post_author 49 wp_set_current_user( $this->user_id );61 wp_set_current_user( self::$admin_id ); 50 62 51 63 // Set up the $_POST request … … 56 68 'data' => array( 57 69 'wp_autosave' => array( 58 'post_id' => $this->_post->ID,59 '_wpnonce' => wp_create_nonce( 'update-post_' . $this->_post->ID ),60 'post_content' => $this->_post->post_content . PHP_EOL . $md5,70 'post_id' => self::$post_id, 71 '_wpnonce' => wp_create_nonce( 'update-post_' . self::$post->ID ), 72 'post_content' => self::$post->post_content . PHP_EOL . $md5, 61 73 'post_type' => 'post', 62 74 ), … … 79 91 80 92 // Check that the edit happened 81 $post = get_post( $this->_post->ID);82 $this->assertGreaterThanOrEqual( 0, strpos( $post->post_content, $md5 ) );93 $post = get_post( self::$post_id ); 94 $this->assertGreaterThanOrEqual( 0, strpos( self::$post->post_content, $md5 ) ); 83 95 } 84 96 … … 89 101 public function test_autosave_locked_post() { 90 102 // Lock the post to another user 91 $another_user_id = self::factory()->user->create( array( 'role' => 'editor' ) ); 92 wp_set_current_user( $another_user_id ); 93 wp_set_post_lock( $this->_post->ID ); 103 wp_set_current_user( self::$editor_id ); 104 wp_set_post_lock( self::$post_id ); 94 105 95 wp_set_current_user( $this->user_id );106 wp_set_current_user( self::$admin_id ); 96 107 97 108 // Ensure post is locked 98 $this->assertEquals( $another_user_id, wp_check_post_lock( $this->_post->ID) );109 $this->assertEquals( self::$editor_id, wp_check_post_lock( self::$post_id ) ); 99 110 100 111 // Set up the $_POST request … … 105 116 'data' => array( 106 117 'wp_autosave' => array( 107 'post_id' => $this->_post->ID,108 '_wpnonce' => wp_create_nonce( 'update-post_' . $this->_post->ID),109 'post_content' => $this->_post->post_content . PHP_EOL . $md5,118 'post_id' => self::$post_id, 119 '_wpnonce' => wp_create_nonce( 'update-post_' . self::$post_id ), 120 'post_content' => self::$post->post_content . PHP_EOL . $md5, 110 121 'post_type' => 'post', 111 122 ), … … 127 138 128 139 // Check that the original post was NOT edited 129 $post = get_post( $this->_post->ID);140 $post = get_post( self::$post_id ); 130 141 $this->assertFalse( strpos( $post->post_content, $md5 ) ); 131 142 132 143 // Check if the autosave post was created 133 $autosave = wp_get_post_autosave( $this->_post->ID, get_current_user_id() );144 $autosave = wp_get_post_autosave( self::$post_id, get_current_user_id() ); 134 145 $this->assertNotEmpty( $autosave ); 135 146 $this->assertGreaterThanOrEqual( 0, strpos( $autosave->post_content, $md5 ) ); … … 142 153 public function test_with_invalid_nonce( ) { 143 154 144 wp_set_current_user( $this->user_id );155 wp_set_current_user( self::$admin_id ); 145 156 146 157 // Set up the $_POST request … … 150 161 'data' => array( 151 162 'wp_autosave' => array( 152 'post_id' => $this->_post->ID,163 'post_id' => self::$post_id, 153 164 '_wpnonce' => substr( md5( uniqid() ), 0, 10 ), 154 165 ), -
trunk/tests/phpunit/tests/ajax/DeleteComment.php
r35242 r35311 20 20 * @var array 21 21 */ 22 protected $_comments = array(); 23 24 /** 25 * Set up the test fixture 26 */ 27 public function setUp() { 28 parent::setUp(); 29 $post_id = self::factory()->post->create(); 30 $this->_comments = self::factory()->comment->create_post_comments( $post_id, 15 ); 31 $this->_comments = array_map( 'get_comment', $this->_comments ); 22 protected static $comments = array(); 23 24 protected static $admin_id = 0; 25 protected static $editor_id = 0; 26 protected static $post; 27 protected static $post_id; 28 protected static $user_ids = array(); 29 30 public static function wpSetUpBeforeClass( $factory ) { 31 self::$user_ids[] = self::$admin_id = $factory->user->create( array( 'role' => 'administrator' ) ); 32 self::$user_ids[] = self::$editor_id = $factory->user->create( array( 'role' => 'editor' ) ); 33 34 self::$post_id = $factory->post->create(); 35 self::$post = get_post( self::$post_id ); 36 37 $comment_ids = $factory->comment->create_post_comments( self::$post_id, 8 ); 38 self::$comments = array_map( 'get_comment', $comment_ids ); 39 } 40 41 public static function wpTearDownAfterClass() { 42 foreach ( self::$user_ids as $user_id ) { 43 self::delete_user( $user_id ); 44 } 45 46 wp_delete_post( self::$post_id, true ); 47 48 foreach ( self::$comments as $c ) { 49 wp_delete_comment( $c->ID, true ); 50 } 32 51 } 33 52 … … 67 86 $_POST['_ajax_nonce'] = wp_create_nonce( 'delete-comment_' . $comment->comment_ID ); 68 87 $_POST[$action] = 1; 69 $_POST['_total'] = count( $this->_comments );88 $_POST['_total'] = count( self::$comments ); 70 89 $_POST['_per_page'] = 100; 71 90 $_POST['_page'] = 1; … … 125 144 $_POST['_ajax_nonce'] = wp_create_nonce( 'delete-comment_' . $comment->comment_ID ); 126 145 $_POST[$action] = 1; 127 $_POST['_total'] = count( $this->_comments );146 $_POST['_total'] = count( self::$comments ); 128 147 $_POST['_per_page'] = 100; 129 148 $_POST['_page'] = 1; … … 155 174 $_POST['_ajax_nonce'] = wp_create_nonce( uniqid() ); 156 175 $_POST[$action] = 1; 157 $_POST['_total'] = count( $this->_comments );176 $_POST['_total'] = count( self::$comments ); 158 177 $_POST['_per_page'] = 100; 159 178 $_POST['_page'] = 1; … … 184 203 $_POST['_ajax_nonce'] = wp_create_nonce( 'delete-comment_12346789' ); 185 204 $_POST[$action] = 1; 186 $_POST['_total'] = count( $this->_comments );205 $_POST['_total'] = count( self::$comments ); 187 206 $_POST['_per_page'] = 100; 188 207 $_POST['_page'] = 1; … … 220 239 $_POST['_ajax_nonce'] = wp_create_nonce( 'delete-comment_' . $comment->comment_ID ); 221 240 $_POST[$action] = 1; 222 $_POST['_total'] = count( $this->_comments );241 $_POST['_total'] = count( self::$comments ); 223 242 $_POST['_per_page'] = 100; 224 243 $_POST['_page'] = 1; … … 255 274 */ 256 275 public function test_ajax_comment_trash_actions_as_administrator() { 257 258 // Test trash/untrash 259 $comment = array_pop( $this->_comments ); 260 $this->_test_as_admin( $comment, 'trash' ); 261 $this->_test_as_admin( $comment, 'untrash' ); 262 263 // Test spam/unspam 264 $comment = array_pop( $this->_comments ); 265 $this->_test_as_admin( $comment, 'spam' ); 266 $this->_test_as_admin( $comment, 'unspam' ); 267 268 // Test delete 269 $comment = array_pop( $this->_comments ); 270 $this->_test_as_admin( $comment, 'delete' ); 276 // Test trash/untrash 277 $this->_test_as_admin( self::$comments[0], 'trash' ); 278 $this->_test_as_admin( self::$comments[0], 'untrash' ); 279 280 // Test spam/unspam 281 $this->_test_as_admin( self::$comments[1], 'spam' ); 282 $this->_test_as_admin( self::$comments[1], 'unspam' ); 283 284 // Test delete 285 $this->_test_as_admin( self::$comments[2], 'delete' ); 271 286 } 272 287 … … 276 291 */ 277 292 public function test_ajax_comment_trash_actions_as_subscriber() { 278 279 // Test trash/untrash 280 $comment = array_pop( $this->_comments ); 281 $this->_test_as_subscriber( $comment, 'trash' ); 282 $this->_test_as_subscriber( $comment, 'untrash' ); 283 284 // Test spam/unspam 285 $comment = array_pop( $this->_comments ); 286 $this->_test_as_subscriber( $comment, 'spam' ); 287 $this->_test_as_subscriber( $comment, 'unspam' ); 288 289 // Test delete 290 $comment = array_pop( $this->_comments ); 291 $this->_test_as_subscriber( $comment, 'delete' ); 293 // Test trash/untrash 294 $this->_test_as_subscriber( self::$comments[0], 'trash' ); 295 $this->_test_as_subscriber( self::$comments[0], 'untrash' ); 296 297 // Test spam/unspam 298 $this->_test_as_subscriber( self::$comments[1], 'spam' ); 299 $this->_test_as_subscriber( self::$comments[1], 'unspam' ); 300 301 // Test delete 302 $this->_test_as_subscriber( self::$comments[2], 'delete' ); 292 303 } 293 304 … … 297 308 */ 298 309 public function test_ajax_trash_comment_no_id() { 299 300 // Test trash/untrash 301 $comment = array_pop( $this->_comments ); 302 $this->_test_as_admin( $comment, 'trash' ); 303 $this->_test_as_admin( $comment, 'untrash' ); 304 305 // Test spam/unspam 306 $comment = array_pop( $this->_comments ); 307 $this->_test_as_admin( $comment, 'spam' ); 308 $this->_test_as_admin( $comment, 'unspam' ); 309 310 // Test delete 311 $comment = array_pop( $this->_comments ); 312 $this->_test_as_admin( $comment, 'delete' ); 310 // Test trash/untrash 311 $this->_test_as_admin( self::$comments[0], 'trash' ); 312 $this->_test_as_admin( self::$comments[0], 'untrash' ); 313 314 // Test spam/unspam 315 $this->_test_as_admin( self::$comments[1], 'spam' ); 316 $this->_test_as_admin( self::$comments[1], 'unspam' ); 317 318 // Test delete 319 $this->_test_as_admin( self::$comments[2], 'delete' ); 313 320 } 314 321 … … 318 325 */ 319 326 public function test_ajax_trash_comment_bad_nonce() { 320 321 // Test trash/untrash 322 $comment = array_pop( $this->_comments ); 323 $this->_test_with_bad_nonce( $comment, 'trash' ); 324 $this->_test_with_bad_nonce( $comment, 'untrash' ); 325 326 // Test spam/unspam 327 $comment = array_pop( $this->_comments ); 328 $this->_test_with_bad_nonce( $comment, 'spam' ); 329 $this->_test_with_bad_nonce( $comment, 'unspam' ); 330 331 // Test delete 332 $comment = array_pop( $this->_comments ); 333 $this->_test_with_bad_nonce( $comment, 'delete' ); 327 // Test trash/untrash 328 $this->_test_with_bad_nonce( self::$comments[0], 'trash' ); 329 $this->_test_with_bad_nonce( self::$comments[0], 'untrash' ); 330 331 // Test spam/unspam 332 $this->_test_with_bad_nonce( self::$comments[1], 'spam' ); 333 $this->_test_with_bad_nonce( self::$comments[1], 'unspam' ); 334 335 // Test delete 336 $this->_test_with_bad_nonce( self::$comments[2], 'delete' ); 334 337 } 335 338 … … 339 342 */ 340 343 public function test_ajax_trash_double_action() { 341 342 // Test trash/untrash 343 $comment = array_pop( $this->_comments ); 344 $this->_test_double_action( $comment, 'trash' ); 345 $this->_test_double_action( $comment, 'untrash' ); 346 347 // Test spam/unspam 348 $comment = array_pop( $this->_comments ); 349 $this->_test_double_action( $comment, 'spam' ); 350 $this->_test_double_action( $comment, 'unspam' ); 351 352 // Test delete 353 $comment = array_pop( $this->_comments ); 354 $this->_test_double_action( $comment, 'delete' ); 344 // Test trash/untrash 345 $this->_test_double_action( self::$comments[0], 'trash' ); 346 $this->_test_double_action( self::$comments[0], 'untrash' ); 347 348 // Test spam/unspam 349 $this->_test_double_action( self::$comments[1], 'spam' ); 350 $this->_test_double_action( self::$comments[1], 'unspam' ); 351 352 // Test delete 353 $this->_test_double_action( self::$comments[2], 'delete' ); 355 354 } 356 355 } -
trunk/tests/phpunit/tests/ajax/GetComments.php
r35242 r35311 20 20 * @var mixed 21 21 */ 22 protected $_comment_post = null;22 protected static $comment_post = null; 23 23 24 24 /** … … 26 26 * @var mixed 27 27 */ 28 protected $_no_comment_post = null;28 protected static $no_comment_post = null; 29 29 30 /** 31 * Set up the test fixture 32 */ 33 public function setUp() { 34 parent::setUp(); 35 $post_id = self::factory()->post->create(); 36 self::factory()->comment->create_post_comments( $post_id, 5 ); 37 $this->_comment_post = get_post( $post_id ); 30 protected static $comment_ids = array(); 38 31 39 $post_id = self::factory()->post->create(); 40 $this->_no_comment_post = get_post( $post_id ); 32 public static function wpSetUpBeforeClass( $factory ) { 33 self::$comment_post = $factory->post->create_and_get(); 34 self::$comment_ids = $factory->comment->create_post_comments( self::$comment_post->ID, 5 ); 35 self::$no_comment_post = $factory->post->create_and_get(); 36 } 41 37 42 unset( $GLOBALS['post_id'] ); 38 public static function wpTearDownAfterClass() { 39 foreach ( self::$comment_ids as $comment_id ) { 40 wp_delete_comment( $comment_id, true ); 41 } 42 43 wp_delete_post( self::$comment_post->ID, true ); 44 wp_delete_post( self::$no_comment_post->ID, true ); 43 45 } 44 46 … … 56 58 $_POST['_ajax_nonce'] = wp_create_nonce( 'get-comments' ); 57 59 $_POST['action'] = 'get-comments'; 58 $_POST['p'] = $this->_comment_post->ID;60 $_POST['p'] = self::$comment_post->ID; 59 61 60 62 // Make the request … … 93 95 $_POST['_ajax_nonce'] = wp_create_nonce( 'get-comments' ); 94 96 $_POST['action'] = 'get-comments'; 95 $_POST['p'] = $this->_comment_post->ID;97 $_POST['p'] = self::$comment_post->ID; 96 98 97 99 // Make the request … … 113 115 $_POST['_ajax_nonce'] = wp_create_nonce( uniqid() ); 114 116 $_POST['action'] = 'get-comments'; 115 $_POST['p'] = $this->_comment_post->ID;117 $_POST['p'] = self::$comment_post->ID; 116 118 117 119 // Make the request … … 153 155 $_POST['_ajax_nonce'] = wp_create_nonce( 'get-comments' ); 154 156 $_POST['action'] = 'get-comments'; 155 $_POST['p'] = $this->_no_comment_post->ID;157 $_POST['p'] = self::$no_comment_post->ID; 156 158 157 159 // Make the request -
trunk/tests/phpunit/tests/ajax/ReplytoComment.php
r35242 r35311 20 20 * @var mixed 21 21 */ 22 protected $_comment_post = null;22 protected static $comment_post = null; 23 23 24 24 /** … … 26 26 * @var mixed 27 27 */ 28 protected $_draft_post = null; 29 30 /** 31 * Set up the test fixture 32 */ 33 public function setUp() { 34 parent::setUp(); 35 $post_id = self::factory()->post->create(); 36 self::factory()->comment->create_post_comments( $post_id, 5 ); 37 $this->_comment_post = get_post( $post_id ); 38 39 $post_id = self::factory()->post->create( array( 'post_status' => 'draft' ) ); 40 $this->_draft_post = get_post( $post_id ); 28 protected static $draft_post = null; 29 30 protected static $comment_ids = array(); 31 32 public static function wpSetUpBeforeClass( $factory ) { 33 self::$comment_post = $factory->post->create_and_get(); 34 self::$comment_ids = $factory->comment->create_post_comments( self::$comment_post->ID, 5 ); 35 self::$draft_post = $factory->post->create_and_get( array( 'post_status' => 'draft' ) ); 36 } 37 38 public static function wpTearDownAfterClass() { 39 foreach ( self::$comment_ids as $comment_id ) { 40 wp_delete_comment( $comment_id, true ); 41 } 42 43 wp_delete_post( self::$comment_post->ID, true ); 44 wp_delete_post( self::$draft_post->ID, true ); 41 45 } 42 46 … … 58 62 // Get a comment 59 63 $comments = get_comments( array( 60 'post_id' => $this->_comment_post->ID64 'post_id' => self::$comment_post->ID 61 65 ) ); 62 66 $comment = array_pop( $comments ); … … 66 70 $_POST['comment_ID'] = $comment->comment_ID; 67 71 $_POST['content'] = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'; 68 $_POST['comment_post_ID'] = $this->_comment_post->ID;72 $_POST['comment_post_ID'] = self::$comment_post->ID; 69 73 70 74 // Make the request … … 102 106 // Get a comment 103 107 $comments = get_comments( array( 104 'post_id' => $this->_comment_post->ID108 'post_id' => self::$comment_post->ID 105 109 ) ); 106 110 $comment = array_pop( $comments ); … … 110 114 $_POST['comment_ID'] = $comment->comment_ID; 111 115 $_POST['content'] = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'; 112 $_POST['comment_post_ID'] = $this->_comment_post->ID;116 $_POST['comment_post_ID'] = self::$comment_post->ID; 113 117 114 118 // Make the request … … 129 133 // Get a comment 130 134 $comments = get_comments( array( 131 'post_id' => $this->_comment_post->ID135 'post_id' => self::$comment_post->ID 132 136 ) ); 133 137 $comment = array_pop( $comments ); … … 137 141 $_POST['comment_ID'] = $comment->comment_ID; 138 142 $_POST['content'] = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'; 139 $_POST['comment_post_ID'] = $this->_comment_post->ID;143 $_POST['comment_post_ID'] = self::$comment_post->ID; 140 144 141 145 // Make the request … … 177 181 $_POST['_ajax_nonce-replyto-comment'] = wp_create_nonce( 'replyto-comment' ); 178 182 $_POST['content'] = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'; 179 $_POST['comment_post_ID'] = $this->_draft_post->ID;183 $_POST['comment_post_ID'] = self::$draft_post->ID; 180 184 181 185 // Make the request … … 199 203 $_POST['_ajax_nonce-replyto-comment'] = wp_create_nonce( 'replyto-comment' ); 200 204 $_POST['content'] = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'; 201 $_POST['comment_post_ID'] = $this->_comment_post->ID;205 $_POST['comment_post_ID'] = self::$comment_post->ID; 202 206 203 207 // Block comments from being saved, simulate a DB error -
trunk/tests/phpunit/tests/ajax/TagSearch.php
r25002 r35311 20 20 * @var array 21 21 */ 22 private $_terms = array(22 private static $terms = array( 23 23 'chattels', 'depo', 'energumen', 'figuriste', 'habergeon', 'impropriation' 24 24 ); 25 25 26 /** 27 * Setup 28 * @todo use a term factory 29 */ 30 public function setUp() { 31 parent::setUp(); 26 private static $term_ids = array(); 32 27 33 foreach ( $this->_terms as $term ) 34 wp_insert_term( $term, 'post_tag' ); 28 public static function wpSetUpBeforeClass() { 29 foreach ( self::$terms as $t ) { 30 self::$term_ids[] = wp_insert_term( $t, 'post_tag' ); 31 } 32 } 33 34 public static function wpTearDownAfterClass() { 35 foreach ( self::$term_ids as $t ) { 36 wp_delete_term( $t, 'post_tag' ); 37 } 35 38 } 36 39
Note: See TracChangeset
for help on using the changeset viewer.