Changeset 49005
- Timestamp:
- 09/19/2020 11:11:00 AM (5 years ago)
- Location:
- trunk/tests/phpunit/tests
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/comment/slashes.php
r49004 r49005 8 8 class Tests_Comment_Slashes extends WP_UnitTestCase { 9 9 protected static $author_id; 10 protected static $post_id; 10 11 11 12 public static function wpSetUpBeforeClass( $factory ) { 12 13 // We need an admin user to bypass comment flood protection. 13 14 self::$author_id = $factory->user->create( array( 'role' => 'administrator' ) ); 15 self::$post_id = $factory->post->create(); 14 16 } 15 17 … … 34 36 */ 35 37 function test_wp_new_comment() { 36 $post_id = self:: factory()->post->create();38 $post_id = self::$post_id; 37 39 38 40 // Not testing comment_author_email or comment_author_url … … 73 75 */ 74 76 function test_edit_comment() { 75 $post_id = self:: factory()->post->create();77 $post_id = self::$post_id; 76 78 $comment_id = self::factory()->comment->create( 77 79 array( … … 119 121 */ 120 122 function test_wp_insert_comment() { 121 $post_id = self:: factory()->post->create();123 $post_id = self::$post_id; 122 124 123 125 $comment_id = wp_insert_comment( … … 150 152 */ 151 153 function test_wp_update_comment() { 152 $post_id = self:: factory()->post->create();154 $post_id = self::$post_id; 153 155 $comment_id = self::factory()->comment->create( 154 156 array( -
trunk/tests/phpunit/tests/meta/slashes.php
r49004 r49005 10 10 protected static $post_id; 11 11 protected static $comment_id; 12 protected static $user_id; 12 13 13 14 public static function wpSetUpBeforeClass( $factory ) { … … 15 16 self::$post_id = $factory->post->create(); 16 17 self::$comment_id = $factory->comment->create( array( 'comment_post_ID' => self::$post_id ) ); 18 self::$user_id = $factory->user->create(); 17 19 } 18 20 … … 35 37 */ 36 38 function test_edit_post() { 37 $post_id = self:: factory()->post->create();39 $post_id = self::$post_id; 38 40 39 41 if ( function_exists( 'wp_add_post_meta' ) ) { … … 112 114 */ 113 115 function test_add_post_meta() { 114 $post_id = self:: factory()->post->create();116 $post_id = self::$post_id; 115 117 116 118 add_post_meta( $post_id, 'slash_test_1', addslashes( $this->slash_1 ) ); … … 127 129 */ 128 130 function test_update_post_meta() { 129 $post_id = self:: factory()->post->create();131 $post_id = self::$post_id; 130 132 131 133 update_post_meta( $post_id, 'slash_test_1', addslashes( $this->slash_1 ) ); … … 192 194 */ 193 195 function test_add_user_meta() { 194 $user_id = self:: factory()->user->create();196 $user_id = self::$user_id; 195 197 196 198 add_user_meta( $user_id, 'slash_test_1', $this->slash_1 ); … … 215 217 */ 216 218 function test_update_user_meta() { 217 $user_id = self:: factory()->user->create();219 $user_id = self::$user_id; 218 220 219 221 add_user_meta( $user_id, 'slash_test_1', 'foo' ); -
trunk/tests/phpunit/tests/post/slashes.php
r49004 r49005 8 8 class Tests_Post_Slashes extends WP_UnitTestCase { 9 9 protected static $author_id; 10 protected static $post_id; 10 11 11 12 public static function wpSetUpBeforeClass( $factory ) { 12 13 self::$author_id = $factory->user->create( array( 'role' => 'editor' ) ); 14 self::$post_id = $factory->post->create(); 13 15 } 14 16 … … 33 35 */ 34 36 function test_edit_post() { 35 $post_id = self:: factory()->post->create();37 $post_id = self::$post_id; 36 38 37 39 $_POST = array(); … … 106 108 */ 107 109 function test_wp_update_post() { 108 $post_id = self:: factory()->post->create();110 $post_id = self::$post_id; 109 111 110 112 wp_update_post( -
trunk/tests/phpunit/tests/user/slashes.php
r49004 r49005 8 8 class Tests_User_Slashes extends WP_UnitTestCase { 9 9 protected static $author_id; 10 protected static $user_id; 10 11 11 12 public static function wpSetUpBeforeClass( $factory ) { 12 13 self::$author_id = $factory->user->create( array( 'role' => 'administrator' ) ); 14 self::$user_id = $factory->user->create(); 13 15 } 14 16 … … 88 90 */ 89 91 function test_edit_user() { 90 $user_id = self:: factory()->user->create();92 $user_id = self::$user_id; 91 93 92 94 $_POST = array(); … … 186 188 */ 187 189 function test_wp_update_user() { 188 $user_id = self:: factory()->user->create();190 $user_id = self::$user_id; 189 191 $user_id = wp_update_user( 190 192 array(
Note: See TracChangeset
for help on using the changeset viewer.